Closed OfficialKatana closed 1 year ago
看起来并没有在主线程掉用 Init,这不是正确使用。应该要在主线成调用。并且没看到 JniOnLoad 的 native 调用栈,可能并没有 bypass 掉 Non-SDK API restriction 而引发崩溃。
看起来并没有在主线程掉用 Init,这不是正确使用。应该要在主线成调用。并且没看到 JniOnLoad 的 native 调用栈,可能并没有 bypass 掉 Non-SDK API restriction 而引发崩溃。
The probable was found, devices carrying UniSoc may miss this function: _ZN3artL18DexFile_setTrustedEP7_JNIEnvP7_jclassP8_jobject Which may cause initialization failed, searching this function will lead to collapse, maybe due to the malformed functions on Android Go devices. Changing code below may fix:
if (sdk_int >= __ANDROID_API_P__) [[likely]] {
if (!RETRIEVE_FUNC_SYMBOL(DexFile_setTrusted,
"_ZN3artL18DexFile_setTrustedEP7_JNIEnvP7_jclassP8_jobject",
true)) {
return false;
}
}
to
if (sdk_int >= __ANDROID_API_P__) [[likely]] {
if (!RETRIEVE_FUNC_SYMBOL(DexFile_setTrusted,
"_ZN3artL18DexFile_setTrustedEP7_JNIEnvP7_jclassP8_jobject",
true)) {
LOGE("Dex files trusting method not found?");
}
}
The actual reason may cause by the compiler's InstrProfSymtab pass which may modify specific (libart) functions and cause bugs.
Your fix is correct. Since this function is not mandatory.
Can you provide libart.so?
Both test cases and app with lsplant initializer were crashed on start up. e.g. POCO C40 / Nokia C2 Logs may looks like these: