Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in thread "main" java.lang.IllegalStateException: Illegal JNI version: 0xffffffff #709

Open
autumnhlf opened this issue Jan 7, 2025 · 0 comments

Comments

@autumnhlf
Copy link

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.linux.android.dvm.jni.ProxyDvmObject;
import com.github.unidbg.memory.Memory;
import java.io.File;
import java.util.HashMap;
import java.util.Map;

public class Tongc extends AbstractJni {
private final AndroidEmulator emulator;
private final VM vm;
public static Module module;
Tongc(){
emulator = AndroidEmulatorBuilder.for32Bit()
.setProcessName("com.tongcheng.android")
.build();
Memory memory = emulator.getMemory();
memory.setLibraryResolver(new AndroidResolver(23));
vm = emulator.createDalvikVM(new File("apks/tongcheng/1085.apk"));
DalvikModule dm = vm.loadLibrary(new File("apks/tongcheng/turingbase.so"), false);

    vm.setJni(this);
    vm.setVerbose(true);
    dm.callJNI_OnLoad(emulator);
    module = dm.getModule();

}

public void sign(){
    Map<String, String> map = new HashMap<>();
    map.put("2009","1");
    map.put("2008","0");
    map.put("2011","1");
    map.put("2010","1");

    String method4 = "i77(Landroid/util/SparseArray;Landroid/content/Context;Ljava/util/Map;)Landroid/util/SparseArray;";
    DvmClass cls = vm.resolveClass("com/tencent/turingfd/sdk/base/TNative$aa");
    StringObject obj = cls.callStaticJniMethodObject(
            emulator,
            method4,
            vm.resolveClass("android/util/SparseArray").newObject(null),
            vm.resolveClass("android/content/Context").newObject(null),
            ProxyDvmObject.createObject(vm, map)
    );
    Object value = obj.getValue();
    System.out.println(value);
}


public static void main(String[] args) {
    Tongcobj = new Tongc();
    obj.sign();
}

}

运行的时候报这个错误
Exception in thread "main" java.lang.IllegalStateException: Illegal JNI version: 0xffffffff
at com.github.unidbg.linux.android.dvm.BaseVM.checkVersion(BaseVM.java:228)
at com.github.unidbg.linux.android.dvm.DalvikModule.callJNI_OnLoad(DalvikModule.java:39)
at com.tongcheng.Tongcheng.(Tongcheng.java:31)
at com.tongcheng.Tongcheng.main(Tongcheng.java:58)

这个是so文件
turingbase.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant