Skip to content

Instantly share code, notes, and snippets.

@sharpicx
Last active January 30, 2025 20:55
Show Gist options
  • Save sharpicx/6efd4211d82179ea534b24e9541b32d3 to your computer and use it in GitHub Desktop.
Save sharpicx/6efd4211d82179ea534b24e9541b32d3 to your computer and use it in GitHub Desktop.

Revisions

  1. sharpicx revised this gist Jan 30, 2025. 1 changed file with 41 additions and 0 deletions.
    41 changes: 41 additions & 0 deletions a.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    setTimeout(function () {
    Java.perform(function () {
    let b = Java.use("x.b");
    b["c"].implementation = function () {
    console.log(`b.c is called`);
    let result = this["c"]();
    console.log(`Root: ${result}`);
    return false;
    };
    b["b"].implementation = function () {
    console.log(`b.b is called`);
    let result = this["b"]();
    console.log(`adb_enabled: ${result}`);
    return false;
    };
    let MySdkUtils = Java.use("com.my.abcd.myandroidsdk.MySdkUtils");
    MySdkUtils["GetAndroidID"].implementation = function () {
    return "fuckkkkkkkkkkkkkkkkkkkkkkkkkkkkk";
    };
    b["a"].implementation = function () {
    console.log(`android-id`);
    return "kiddosssssssssssssssssssssssssssss";
    };
    let a = Java.use("m1.a");
    a["d"].implementation = function (str) {
    console.log(`\n(encrypted) before: ${str}\n`);
    let result = this["d"](str);
    console.log(`\n(encrypted) after: ${result}\n`);
    return result;
    };
    a["b"].implementation = function (str) {
    console.log(`\n(decrypted) before: ${str}\n`);
    let result = this["b"](str);
    console.log(`\n(decrypted) after: ${result}\n`);
    return result;
    };
    MySdkUtils["GetCountryCode"].implementation = function () {
    return "LO_NYARI_NEGARA_MANA_NYET_KWOAKOWAKWOKAOWK";
    };
    });
    }, 0);
  2. sharpicx created this gist Jan 30, 2025.
    57 changes: 57 additions & 0 deletions a.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    import java.util.Base64;
    import java.security.MessageDigest;
    import javax.crypto.Cipher;
    import javax.crypto.spec.IvParameterSpec;
    import javax.crypto.spec.SecretKeySpec;
    import java.util.HexFormat;

    class Main {
    public static byte[] f44153a = {104, 51, 94, 37, 52, 126, 115, 120, 106, 108, 115, 100, 57, 49};

    public static void main(String[] args) {
    System.out.println(encrypt("Try programiz.pro"));
    System.out.println(decrypt("UwwXMPrXT5JGty9VfrHiZ+0aR+nbNg71pnRhmKORxjQ="));
    }
    private static String decrypt(String str) {
    try {
    byte[] keyBytes = MessageDigest.getInstance("MD5").digest(f44153a);
    SecretKeySpec secretKeySpec = new SecretKeySpec(keyBytes, "AES");
    byte[] ivBytes = new byte[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
    IvParameterSpec ivParameterSpec = new IvParameterSpec(ivBytes);
    Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
    cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivParameterSpec);
    int paddingLength = (4 - (str.length() % 4)) % 4;
    str = str + "=".repeat(paddingLength);
    byte[] decode = Base64.getDecoder().decode(str);
    byte[] decryptedBytes = cipher.doFinal(decode);
    return new String(decryptedBytes);
    } catch (Exception e) {
    e.printStackTrace();
    return null;
    }
    }

    private static String encrypt(String str) {
    try {
    byte[] keyBytes = MessageDigest.getInstance("MD5").digest(f44153a);
    SecretKeySpec secretKeySpec = new SecretKeySpec(keyBytes, "AES");
    byte[] ivBytes = new byte[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
    IvParameterSpec ivParameterSpec = new IvParameterSpec(ivBytes);
    System.out.println("Key (Hex): " + bytesToHex(keyBytes));
    System.out.println("IV (Hex): " + bytesToHex(ivBytes));
    Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
    cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);
    String base64Encoded = Base64.getEncoder().encodeToString(cipher.doFinal(str.getBytes(), 0, str.getBytes().length));
    int paddingLength = (4 - (base64Encoded.length() % 4)) % 4;
    base64Encoded = base64Encoded + "=".repeat(paddingLength);
    return base64Encoded;
    } catch (Exception e7) {
    e7.printStackTrace();
    return null;
    }
    }
    private static String bytesToHex(byte[] bytes) {
    HexFormat hexFormat = HexFormat.of();
    return hexFormat.formatHex(bytes);
    }
    }