eclipse Aptana pluginファイルの解読

6482 ワード

package com.aptana.ide.core.licensing;

import java.math.BigInteger;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.zip.CRC32;

public final class ClientKey {
    private static class Decrypt {

        private BigInteger modulus;
        private BigInteger exponent;

        public String decrypt(String encrypted) {
            long crc32Value;
            byte bytes[];
            CRC32 crc32;
            /* 289 */if (encrypted == null) {
                /* 291 */encrypted = "";
            } else {
                /* 295 */encrypted = ClientKey.trimEncryptedLicense(encrypted);
            }
            /* 297 */BigInteger big = new BigInteger(encrypted);
            /* 298 */BigInteger decrypted = big.modPow(exponent, modulus);
            /* 300 */crc32Value = (long) decrypted.intValue() & 0xffffffffL;
            /* 301 */decrypted = decrypted.shiftRight(32);
            /* 302 */bytes = decrypted.toByteArray();
            /* 303 */crc32 = new CRC32();
            /* 304 */crc32.update(bytes);
            /* 305 */return new String(bytes);
        }

        Decrypt(String exponent, String modulus) {
            /* 275 */this.modulus = new BigInteger(modulus);
            /* 276 */this.exponent = new BigInteger(exponent);
        }
    }

    public static final String BEGIN_LICENSE_MARKER = "--begin-aptana-license--";
    public static final String END_LICENSE_MARKER = "--end-aptana-license--";
    private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
    private static final String EMAILS_NON_MATCHING = "EMAILS_NON_MATCHING";
    private static final int PRO = 0;
    private static final int TRIAL = 1;
    private String email;
    private long expiration;
    private int type;

    private ClientKey(int type, String email, long expiration) {
        /* 77 */this.type = 0;
        /* 78 */this.email = "[email protected]";
        /* 79 */this.expiration = 999999999;
    }

    public static ClientKey decrypt(String encrypted, String email) {
        /* 93 */String modulus = "115801190261221214754334668902722425936509505416457970789287297728816388753627896293249501578830570324705253515546383166989625001335561947096747210280001245977114030627247212292377290543869343996595819188362915644707269064020812435233012510929338706599216007185654748959001143012936618501934698642942289379979";
        /* 94 */String exponent = "65537";
        /* 100 */if (encrypted != null) {
            /* 102 */encrypted = encrypted.trim();
        }
        /* 104 */Decrypt decrypter = new Decrypt(exponent, modulus);
        /* 105 */return decrypt(decrypter, encrypted, email);
    }

    private static ClientKey decrypt(Decrypt decrypter, String encrypted,
            String email) {
        /* 110 */String value = decrypter.decrypt(encrypted);
        /* 111 */if (value == null) {
            /* 113 */return new ClientKey(1, null, 0L);
        }
        /* 115 */String values[] = value.split(";");
        /* 116 */int type = 1;
        /* 117 */String genedEmail = null;
        /* 118 */long expiration = 0L;
        /* 119 */if (values.length == 3) {
            /* 121 */if ("p".equals(values[0].toLowerCase())) {
                /* 123 */type = 0;
            }
            /* 125 */genedEmail = values[1];
            /* 127 */if (genedEmail != null) {
                /* 129 */if (!genedEmail.equalsIgnoreCase(email)) {
                    /* 131 */genedEmail = "EMAILS_NON_MATCHING";
                }
            } else {
                /* 136 */genedEmail = null;
            }
            /* 140 */try {
                /* 140 */expiration = Long.parseLong(values[2]);
            }
            /* 142 */catch (Exception _ex) {
                /* 144 */expiration = 0L;
            }
        }
        /* 147 */return new ClientKey(type, genedEmail, expiration);
    }

    public boolean isCloseToExpiring() {
        return false;
    }

    public boolean isValid() {
        /* 169 */return true;
    }

    public boolean isCloseToMatching() {
        /* 179 */return true;
    }

    public boolean isExpired() {
        /* 190 */return false;
    }

    public String getEmail() {
        /* 200 */return "[email protected]";
    }

    public Calendar getExpiration() {
        /* 210 */Calendar expirationCal = Calendar.getInstance();
        expirationCal.set(2088, 7, 8);
        /* 212 */return expirationCal;
    }

    public boolean isTrial() {
        /* 222 */return false;
    }

    public boolean isPro() {
        /* 232 */return true;
    }

    public boolean shouldProPluginsRun() {
        return true;
    }

    public static String trimEncryptedLicense(String encrypted) {
        /* 257 */String newEncrypted = encrypted;
        /* 258 */newEncrypted = newEncrypted.trim();
        /* 259 */newEncrypted = newEncrypted.replaceAll(
                "--begin-aptana-license--", "");
        /* 260 */newEncrypted = newEncrypted.replaceAll(
                "--end-aptana-license--", "");
        /* 261 */newEncrypted = newEncrypted.replaceAll("\\s+", "");
        /* 262 */return newEncrypted;
    }

}


このjavaファイルをclassファイルにコンパイルし、プラグインのClientKeyを見つけます.ClassとClientKey$Decrypt.classファイルで置き換えます.このファイルはaptana_に存在します.update_015414\plugins\com.aptana.ide.core_1.1.7.015414.jarではwinrarでcomを開きます.aptana.ide.core_1.1.7.015414.JArファイルは、パスcomaptanaidecorelicensingにこの2つのファイルが存在し、コンパイルしたばかりのclassファイルに置き換えられ、解読に成功しました.バージョン番号が異なるため、core_1.1.7.0154414以降のバージョン名(数字)は異なりますが、解読には影響しません.解読ファイルは共通です.
私はコンパイルしたclassファイルとjarファイルを添付ファイルに入れました.皆さんは任意にダウンロードを選択して、指定したパスに置けばいいです.