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

返回结果为Null,然后应该怎么做。 #700

Open
abbypop opened this issue Nov 6, 2024 · 0 comments
Open

返回结果为Null,然后应该怎么做。 #700

abbypop opened this issue Nov 6, 2024 · 0 comments

Comments

@abbypop
Copy link

abbypop commented Nov 6, 2024

JNIEnv->FindClass(com/yxcorp/gifshow/util/CPU) was called from RX@0x1200240c[libcore.so]0x240c
JNIEnv->RegisterNatives(com/yxcorp/gifshow/util/CPU, RW@0x12006018[libcore.so]0x6018, 2) was called from RX@0x12002430[libcore.so]0x2430
RegisterNative(com/yxcorp/gifshow/util/CPU, getClock(Landroid/content/Context;[BI)Ljava/lang/String;, RX@0x12002030[libcore.so]0x2030)
RegisterNative(com/yxcorp/gifshow/util/CPU, getMagic(Landroid/content/Context;I)Ljava/lang/String;, RX@0x12002330[libcore.so]0x2330)
JNIEnv->GetMethodID(java/lang/Class.getName()Ljava/lang/String;) => 0x4a974877 was called from RX@0x12000aa0[libcore.so]0xaa0
JNIEnv->CallObjectMethodV(class android/content/Context, getName() => "android.content.Context") was called from RX@0x12000ba4[libcore.so]0xba4
JNIEnv->GetStringUtfChars("android.content.Context") was called from RX@0x12001868[libcore.so]0x1868
JNIEnv->ReleaseStringUTFChars("android.content.Context") was called from RX@0x12001894[libcore.so]0x1894
Exception in thread "main" java.lang.NullPointerException
at com.kuaishou.KuaishouSign.getSig(KuaishouSign.java:129)
at com.kuaishou.KuaishouSign.main(KuaishouSign.java:138)

设置参数的方法为:

public String getSig(String plainText) {
        List<Object> list = new ArrayList<>(10);
        list.add(vm.getJNIEnv());
        list.add(0);
        DvmObject<?> context = vm.resolveClass("android/content/Context").newObject(null);
        list.add(vm.addLocalObject(context));
        try {
            list.add(vm.addLocalObject(new ByteArray(vm, plainText.getBytes("UTF-8"))));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        list.add(vm.addLocalObject(DvmInteger.valueOf(vm, 23)));
        Number number = module.callFunction(emulator,0x2030, list.toArray());
        String result = vm.getObject(number.intValue()).getValue().toString();
        return result;
}
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