1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| package com.nb.demo;
import com.github.unidbg.AndroidEmulator; import com.github.unidbg.Module; import com.github.unidbg.linux.android.AndroidEmulatorBuilder; import com.github.unidbg.linux.android.AndroidResolver; import com.github.unidbg.linux.android.dvm.*; import com.github.unidbg.memory.Memory;
import java.io.File;
public class HaiNan extends AbstractJni { public static AndroidEmulator emulator; public static Memory memory; public static VM vm; public static Module module;
public HaiNan() { emulator = AndroidEmulatorBuilder.for32Bit().setProcessName("com.hainan").build();
memory = emulator.getMemory();
memory.setLibraryResolver(new AndroidResolver(23));
vm = emulator.createDalvikVM(new File("apks/hainan/v9.0.0.apk")); vm.setJni(this);
DalvikModule dm = vm.loadLibrary(new File("apks/hainan/libsignature.so"), false); dm.callJNI_OnLoad(emulator);
module = dm.getModule(); }
public void sign() { DvmClass HNASignature = vm.resolveClass("com/rytong/hnair/HNASignature"); String method = "getHNASignature(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"; StringObject obj = HNASignature.callStaticJniMethodObject( emulator, method, new StringObject(vm, "{}"), new StringObject(vm, "{}"), new StringObject(vm, "{\"abuild\":\"64249\",\"akey\":\"184C5F04D8BE43DCBD2EE3ABC928F616\",\"aname\":\"com.rytong.hnair\",\"atarget\":\"standard\",\"aver\":\"9.0.0\",\"caller\":\"AD_H5\",\"did\":\"2c1c0689406f11f3\",\"dname\":\"Google_Pixel 2 XL\",\"gtcid\":\"f27ae4d8106eade7f93544fac0fa366a\",\"hver\":\"9.0.0.35417.7ac793f2e.standard\",\"mchannel\":\"huawei\",\"schannel\":\"AD\",\"slang\":\"zh-CN\",\"sname\":\"google\\/taimen\\/taimen:11\\/RP1A.201005.004.A1\\/6934943:user\\/release-keys\",\"stime\":\"1708611990194\",\"sver\":\"11\",\"system\":\"AD\",\"szone\":\"+0800\",\"riskToken\":\"65d75727UbwY9H3Ya4JUMA5JATe6L2ImaxZYHvH3\"}"), new StringObject(vm, "21047C596EAD45209346AE29F0350491"), new StringObject(vm, "F6B15ABD66F91951036C955CB25B069F")
);
System.out.println(obj.getValue());
}
public static void main(String[] args) {
HaiNan hn = new HaiNan(); hn.sign(); } }
|