-
Notifications
You must be signed in to change notification settings - Fork 713
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
oriain os4上的奇怪bug #451
Comments
这个问题你解决了吗 |
没有,目前只能提示用户去 Shizuku 中关闭授权 |
Shizuku/server/src/main/java/rikka/shizuku/server/ShizukuService.java Lines 527 to 532 in 9792354
正常情况下,它应该永远不是 null。 听说一些厂商在限制后台运行的时候的行为也包括,使应用的 provider 不能被获取。可以看看是不是这个原因( |
这个问题和我的一样,我发现的规律是,我自己的应用打开后,需要稍微等待一会儿,大概1.8s左右,就有大概率是PASS的。如果一开始失败了,后续继续尝试,大概过10s以后,也会成功。 查了一下,可能是provider的 onCreate有耗时操作,disableAutomatic一SuiInitialization不清楚这个API是否能改善这个情况。 参考仓库中的代码实现,可以继承一下ShizukuProvider,重写他的OnCreate方法。 |
Sui.isSui() 里面就很简单的 binder 通信,它不可能说需要秒级别的时间的 |
添加了PASS和FAIL时的logcat日志对比图 |
2024-05-01 00:59:16.455 10738-10767 BinderSender shizuku_server D onUidCachedChanged: uid=10087, cached=false |
实验了很多次,翻了好多次log,fail和pass的流程十分相似,仅仅是sh稍有不同。不知道是不是应用启动流程的影响。 |
确实很奇怪 目前oriain os上很多用户反馈失败,然后给shizuku和app都关了再打开才能用 |
经过测试,多获取几次provider,就会成功,但是如果失败,进程退出,就需要等10s以上,才能成功。 for(int i=0;i<50;i++)
{
provider = ActivityManagerApis.getContentProviderExternal(name, userId, null, name);
if (provider == null)
{
Thread.sleep(200);
Log.w(TAG, String.format("provider is null %s %d,try times %d", name, userId,i+1));
}
else
break;
} 2024-06-22 10:29:30.725 32298-32298 ShizukuServiceStarter rikka.shizuku.demo W provider is null moe.shizuku.privileged.api.shizuku 0,try times 1 提交了一个request, #533 |
@laiqun 直接 Thread.sleep 不是特别的好,个人觉得好一点的做法是用 handler.postDelayed,并且还要加入如果目标进程已经没了就移除掉(removeCallbacks)。 |
我有个疑问啊,如果改成handler.postDelayed,那需要先启动消息循环,也就是Looper.loop();要先执行,而这应该是个死循环,不退出这个循环,后续的代码就不会执行。 if (!sendBinder(service, token)) {
System.exit(1);
}
Looper.loop(); 但是需要触发事件到事件循环里,那么做法由两种:
这个文件的逻辑框架,就需要大改了~ 而且逻辑和之前也有不同,sendBinder是事件循环开启的先决条件;而现在sendBinder却会在事件循环中完成,而不是启动事件循环的先决条件了。 |
添加了使用handler的版本~ 结构上的变化让我有点恐慌,我本地测试是好的~ 但这样的修改,改动稍微有点大~ |
@RikkaW Could you help evaluate the change? |
@RikkaW 如果第N次获取失败,可能又需要等10s以上。长时间的等待会造成极差的用户体验。 |
您解决此问题了吗,我在vivo上遇到了相似的问题 |
@RikkaW 鉴于定制UI的此类问题 |
@laiqun 目前相对稳定的方案,你可以看看,java代码 有概率,shizuku被终止后无法连上,请自行引导用户取消shizuku对自己的软件的授权 onDestroy可以加一个 |
谢谢,我暂时用的是我提到的work。around |
Please report bugs of Shizuku itself.
Requirements:
Change "[ ]" to "[x]" if it meets the requirements.
Reports not meet the requirements will be immediately closed.
Information:
Logs:
2024-03-18 21:14:56.855 24920-25844 UserServiceManager app_process I New service record bin.mt.plus.canary:bin.mt.shell.ShizukuCommand (5622e135-41bb-4141-9274-3b4885936704-1710767696854): version=24031888, daemon=false, apk=/data/app/~~2PtiKLLFHpA44MoyTj1ipg==/bin.mt.plus.canary-ZiBV-tbRIhYb6BbzhvoiWQ==/base.apk
2024-03-18 21:14:56.855 24920-25844 UserServiceRecord app_process V Set starting timeout for service record 5622e135-41bb-4141-9274-3b4885936704-1710767696854: 30000
2024-03-18 21:14:56.856 24920-25063 UserServiceManager app_process V Starting process for service record bin.mt.plus.canary:bin.mt.shell.ShizukuCommand (5622e135-41bb-4141-9274-3b4885936704-1710767696854)...
2024-03-18 21:14:56.932 25561-25561 ImeFocusController bin.mt.plus.canary V onWindowFocus: DecorView@f97d4de[MainLightIcon] softInputMode=STATE_UNSPECIFIED|ADJUST_RESIZE
2024-03-18 21:14:56.978 27578-27578 app_process pid-27578 E finding bbqNumWrapPrototype() failed [undefined symbol: ged_kpi_target_FPS_hint]
2024-03-18 21:14:56.986 27578-27578 appproc pid-27578 E checkAndSetEnv get_baksize open file /data/dalvik-cache/classpath failed , error(Permission denied)
2024-03-18 21:14:56.986 27578-27578 appproc pid-27578 E checkAndSetEnv write_classpathbak open file failed:Permission denied
2024-03-18 21:14:56.986 27578-27578 appproc pid-27578 E checkAndSetEnv get_baksize open file /data/dalvik-cache/classpath2 failed , error(Permission denied)
2024-03-18 21:14:56.986 27578-27578 appproc pid-27578 E checkAndSetEnv write_classpathbak open file failed:Permission denied
2024-03-18 21:14:56.986 27578-27578 appproc pid-27578 E checkAndSetEnv get_baksize open file /data/dalvik-cache/classpath3 failed , error(Permission denied)
2024-03-18 21:14:56.986 27578-27578 appproc pid-27578 E checkAndSetEnv write_classpathbak open file failed:Permission denied
2024-03-18 21:14:56.986 27578-27578 appproc pid-27578 E checkAndSetEnv get_baksize open file /data/dalvik-cache/classpath4 failed , error(Permission denied)
2024-03-18 21:14:56.986 27578-27578 appproc pid-27578 E checkAndSetEnv write_classpathbak open file failed:Permission denied
2024-03-18 21:14:56.986 27578-27578 AndroidRuntime pid-27578 D >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
2024-03-18 21:14:56.992 27578-27578 AndroidRuntime pid-27578 I Using default boot image
2024-03-18 21:14:56.992 27578-27578 AndroidRuntime pid-27578 I Leaving lock profiling enabled
2024-03-18 21:14:56.994 27578-27578 app_process pid-27578 I Using CollectorTypeCC GC.
2024-03-18 21:14:57.080 27578-27578 nativeloader pid-27578 D InitDefaultPublicLibraries for_preload=1: libandroid.so:libaaudio.so:libamidi.so:libbinder_ndk.so:libc.so:libcamera2ndk.so:libdl.so:libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libicu.so:libicui18n.so:libicuuc.so:libjnigraphics.so:liblog.so:libmediandk.so:libm.so:libnativehelper.so:libnativewindow.so:libOpenMAXAL.so:libOpenSLES.so:libRS.so:libstdc++.so:libsync.so:libvulkan.so:libwebviewchromium_plat_support.so:libz.so
2024-03-18 21:14:57.090 27578-27578 app_process pid-27578 D Time zone APEX ICU file found: /apex/com.android.tzdata/etc/icu/icu_tzdata.dat
2024-03-18 21:14:57.090 27578-27578 app_process pid-27578 D I18n APEX ICU file found: /apex/com.android.i18n/etc/icu/icudt72l.dat
2024-03-18 21:14:57.106 27578-27578 VivoSystem...orkFactory pid-27578 I Instance implClass com.vivo.VivoSystemFrameworkFactoryImpl
2024-03-18 21:14:57.154 27578-27578 libc pid-27578 W Access denied finding property "ro.product.name_for_attestation"
2024-03-18 21:14:57.155 27578-27578 libc pid-27578 W Access denied finding property "ro.product.brand_for_attestation"
2024-03-18 21:14:57.155 27578-27578 libc pid-27578 W Access denied finding property "ro.product.model_for_attestation"
2024-03-18 21:14:57.151 27578-27578 main pid-27578 W type=1400 audit(0.0:14674): avc: denied { read } for name="u:object_r:build_attestation_prop:s0" dev="tmpfs" ino=173 scontext=u:r:shell:s0 tcontext=u:object_r:build_attestation_prop:s0 tclass=file permissive=0
2024-03-18 21:14:57.156 27578-27578 libc pid-27578 W Access denied finding property "ro.vendor.mtk.hbt_binfmt_misc_support"
2024-03-18 21:14:57.156 27578-27578 libc pid-27578 W Access denied finding property "ro.vendor.mtk.hbt_binfmt_misc_support"
2024-03-18 21:14:57.151 27578-27578 main pid-27578 W type=1400 audit(0.0:14675): avc: denied { read } for name="u:object_r:build_attestation_prop:s0" dev="tmpfs" ino=173 scontext=u:r:shell:s0 tcontext=u:object_r:build_attestation_prop:s0 tclass=file permissive=0
2024-03-18 21:14:57.156 27578-27578 libc pid-27578 W Access denied finding property "ro.vendor.mtk.app32_boost_support"
2024-03-18 21:14:57.156 27578-27578 libc pid-27578 W Access denied finding property "ro.vendor.mtk.hbt_dyn_type"
2024-03-18 21:14:57.156 27578-27578 libc pid-27578 W Access denied finding property "persist.vendor.mtk.hbt_dyn_type"
2024-03-18 21:14:57.151 27578-27578 main pid-27578 W type=1400 audit(0.0:14676): avc: denied { read } for name="u:object_r:build_attestation_prop:s0" dev="tmpfs" ino=173 scontext=u:r:shell:s0 tcontext=u:object_r:build_attestation_prop:s0 tclass=file permissive=0
2024-03-18 21:14:57.151 27578-27578 main pid-27578 W type=1400 audit(0.0:14677): avc: denied { read } for name="u:object_r:system_mtk_app32_boost_prop:s0" dev="tmpfs" ino=399 scontext=u:r:shell:s0 tcontext=u:object_r:system_mtk_app32_boost_prop:s0 tclass=file permissive=0
2024-03-18 21:14:57.151 27578-27578 main pid-27578 W type=1400 audit(0.0:14678): avc: denied { read } for name="u:object_r:system_mtk_app32_boost_prop:s0" dev="tmpfs" ino=399 scontext=u:r:shell:s0 tcontext=u:object_r:system_mtk_app32_boost_prop:s0 tclass=file permissive=0
2024-03-18 21:14:57.166 27578-27578 AndroidRuntime pid-27578 D Calling main entry moe.shizuku.starter.ServiceStarter
2024-03-18 21:14:57.180 25561-25561 WindowOnBackDispatcher bin.mt.plus.canary W sendCancelIfRunning: isInProgress=falsecallback=android.view.ViewRootImpl$$ExternalSyntheticLambda17@59006cd
2024-03-18 21:14:57.188 25561-27310 OpenGLRenderer bin.mt.plus.canary D endAllActiveAnimators on 0xb40000752fc4f2c0 (MenuPopupWindow$MenuDropDownListView) with handle 0xb40000753fb54ca0
2024-03-18 21:14:57.200 25561-25561 InputTransport bin.mt.plus.canary D Destroy ARC handle: 0xb40000753fb4e010
2024-03-18 21:14:57.201 25561-27280 BLASTBufferQueue bin.mt.plus.canary D VRI[PopupWindow:2dd5817]#3 destructor()
2024-03-18 21:14:57.201 25561-27280 BufferQueueConsumer bin.mt.plus.canary D VRI[PopupWindow:2dd5817]#3(BLAST Consumer)3 disconnect
2024-03-18 21:14:57.301 27578-27578 ShizukuServiceStarter pid-27578 I starting service bin.mt.plus.canary/bin.mt.shell.ShizukuCommand...
2024-03-18 21:14:57.302 27578-27578 ziparchive pid-27578 W Unable to open '/system_ext/framework/mediatek-framework.dm': No such file or directory
2024-03-18 21:14:57.302 27578-27578 ziparchive pid-27578 W Unable to open '/system_ext/framework/mediatek-framework.dm': No such file or directory
2024-03-18 21:14:57.307 27578-27578 VivoConfigStore pid-27578 D init begin
2024-03-18 21:14:57.319 27578-27578 VivoConfigStore pid-27578 D key:vivo.software.globaltheme isCached is true and value is true
2024-03-18 21:14:57.319 27578-27578 libc pid-27578 W Access denied finding property "qemu.sf.lcd_density"
2024-03-18 21:14:57.319 27578-27578 libc pid-27578 W Access denied finding property "qemu.sf.lcd_density"
2024-03-18 21:14:57.413 27578-27578 app_process pid-27578 W unable to execute idmap2: Permission denied
2024-03-18 21:14:57.413 27578-27578 OverlayConfig pid-27578 W 'idmap2 create-multiple' failed: no mutable="false" overlays targeting "android" will be loaded
2024-03-18 21:14:57.415 27578-27578 VivoConfigStore pid-27578 D key:vivo.software.globaltheme isCached is true and value is true
2024-03-18 21:14:57.416 27578-27578 VivoConfigStore pid-27578 D key:vivo.software.pem.ddc isCached is true and value is true
2024-03-18 21:14:57.419 27578-27578 VgcUtil pid-27578 D getFile name :theme_dir_path not exit in vgc_path_config.xml
2024-03-18 21:14:57.419 27578-27578 VivoConfigStore pid-27578 D key:vivo.software.globaltheme isCached is true and value is true
2024-03-18 21:14:57.420 27578-27578 VivoConfigStore pid-27578 D key:vivo.software.globaltheme isCached is true and value is true
2024-03-18 21:14:57.420 27578-27578 VgcUtil pid-27578 D getFile name :theme_dir_path not exit in vgc_path_config.xml
2024-03-18 21:14:57.422 27578-27578 VivoConfigStore pid-27578 D key:vivo.software.globaltheme isCached is true and value is true
2024-03-18 21:14:57.422 27578-27578 VivoConfigStore system_process D key:vivo.software.globaltheme isCached is true and value is true
2024-03-18 21:14:57.422 27578-27578 VivoConfigStore system_process D key:vivo.software.globaltheme isCached is true and value is true
2024-03-18 21:14:57.433 27578-27578 app_process system_process W ClassLoaderContext classpath size mismatch. expected=1, found=0 (PCL[/system/framework/com.android.location.provider.jar3994156536] | PCL[])
2024-03-18 21:14:57.435 27578-27578 app_process system_process W ClassLoaderContext classpath size mismatch. expected=8, found=0 (PCL[/system/framework/com.android.location.provider.jar3994156536:/system/framework/services.jar2465108973:/system/framework/services.jar!classes2.dex1101484240:/system/framework/services.jar!classes3.dex379007127:/system/framework/vivo-services.jar200236959:/system/framework/vivo-services.jar!classes2.dex1583215136:/system/framework/soc-services.jar2396945984:/system/framework/services-adapter.jar*3705662762] | PCL[])
2024-03-18 21:14:57.447 27578-27578 System system_process W No Compatibility callbacks set! Querying change 263076149
2024-03-18 21:14:57.447 27578-27578 System system_process W No Compatibility callbacks set! Querying change 263076149
2024-03-18 21:14:57.447 27578-27578 System system_process W No Compatibility callbacks set! Querying change 263076149
2024-03-18 21:14:57.457 27578-27578 nativeloader system_process D InitApexLibraries:
com_android_art: libnativehelper.so
com_android_i18n: libicui18n.so:libicuuc.so:libicu.so
com_android_neuralnetworks: libneuralnetworks.so
2024-03-18 21:14:57.457 27578-27578 nativeloader system_process D InitDefaultPublicLibraries for_preload=0: libandroid.so:libaaudio.so:libamidi.so:libbinder_ndk.so:libc.so:libcamera2ndk.so:libclang_rt.hwasan-aarch64-android.so:libdl.so:libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libjnigraphics.so:liblog.so:libmediandk.so:libm.so:libnativewindow.so:libOpenMAXAL.so:libOpenSLES.so:libRS.so:libstdc++.so:libsync.so:libvulkan.so:libwebviewchromium_plat_support.so:libz.so
2024-03-18 21:14:57.457 27578-27578 nativeloader system_process D Configuring clns-1 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=30, uses_libraries=ALL, library_path=/data/app/~~2PtiKLLFHpA44MoyTj1ipg==/bin.mt.plus.canary-ZiBV-tbRIhYb6BbzhvoiWQ==/lib/arm64:/data/app/~~2PtiKLLFHpA44MoyTj1ipg==/bin.mt.plus.canary-ZiBV-tbRIhYb6BbzhvoiWQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand
2024-03-18 21:14:57.457 27578-27578 nativeloader system_process D InitExtendedPublicLibraries: libapuwareapusys.mtk.so:libapuwareapusys_v2.mtk.so:libapuwarexrp.mtk.so:libapuwarexrp_v2.mtk.so:libapuwareutils.mtk.so:libapuwareutils_v2.mtk.so:libapuwarehmp.mtk.so:libmcv_runtime_usdk.mtk.so:libneuron_graph_delegate.mtk.so:libneuronusdk_adapter.mtk.so:libtflite_mtk.mtk.so:libarmnn_ndk.mtk.so:libcmdl_ndk.mtk.so:libnir_neon_driver_ndk.mtk.so:libmvpu_runtime.mtk.so:libmvpu_runtime_pub.mtk.so:libmvpu_engine_pub.mtk.so:libmvpu_pattern_pub.mtk.so:libmvpuop_mtk_cv.mtk.so:libmvpuop_mtk_nn.mtk.so:libmvpu_runtime_25.mtk.so:libmvpu_runtime_25_pub.mtk.so:libmvpu_engine_25_pub.mtk.so:libmvpu_pattern_25_pub.mtk.so:libmvpuop25_mtk_cv.mtk.so:libmvpuop25_mtk_nn.mtk.so:libmvpu_config.mtk.so:libteeservice_client.trustonic.so
2024-03-18 21:14:57.457 27578-27578 nativeloader system_process D Extending system_exposed_libraries: libapuwareapusys.mtk.so:libapuwareapusys_v2.mtk.so:libapuwarexrp.mtk.so:libapuwarexrp_v2.mtk.so:libapuwareutils.mtk.so:libapuwareutils_v2.mtk.so:libapuwarehmp.mtk.so:libmcv_runtime_usdk.mtk.so:libneuron_graph_delegate.mtk.so:libneuronusdk_adapter.mtk.so:libtflite_mtk.mtk.so:libarmnn_ndk.mtk.so:libcmdl_ndk.mtk.so:libnir_neon_driver_ndk.mtk.so:libmvpu_runtime.mtk.so:libmvpu_runtime_pub.mtk.so:libmvpu_engine_pub.mtk.so:libmvpu_pattern_pub.mtk.so:libmvpuop_mtk_cv.mtk.so:libmvpuop_mtk_nn.mtk.so:libmvpu_runtime_25.mtk.so:libmvpu_runtime_25_pub.mtk.so:libmvpu_engine_25_pub.mtk.so:libmvpu_pattern_25_pub.mtk.so:libmvpuop25_mtk_cv.mtk.so:libmvpuop25_mtk_nn.mtk.so:libmvpu_config.mtk.so:libteeservice_client.trustonic.so
2024-03-18 21:14:57.458 27578-27578 nativeloader system_process D InitVendorPublicLibraries: libOpenCL.so:libnir_neon_driver_ndk.mtk.vndk.so:libcmdl_ndk.mtk.vndk.so:libarmnn_ndk.mtk.vndk.so
2024-03-18 21:14:57.458 27578-27578 nativeloader system_process D InitProductPublicLibraries:
2024-03-18 21:14:57.458 27578-27578 ziparchive system_process W Unable to open '/data/app/~~2PtiKLLFHpA44MoyTj1ipg==/bin.mt.plus.canary-ZiBV-tbRIhYb6BbzhvoiWQ==/base.dm': No such file or directory
2024-03-18 21:14:57.458 27578-27578 ziparchive system_process W Unable to open '/data/app/~~2PtiKLLFHpA44MoyTj1ipg==/bin.mt.plus.canary-ZiBV-tbRIhYb6BbzhvoiWQ==/base.dm': No such file or directory
---------------------------- PROCESS STARTED (27578) for package bin.mt.plus.canary ----------------------------
2024-03-18 21:14:57.958 27578-27578 nativeloader bin.mt.plus.canary D Configuring clns-2 for other apk /data/app/~~2PtiKLLFHpA44MoyTj1ipg==/bin.mt.plus.canary-ZiBV-tbRIhYb6BbzhvoiWQ==/base.apk. target_sdk_version=30, uses_libraries=, library_path=/data/app/~~2PtiKLLFHpA44MoyTj1ipg==/bin.mt.plus.canary-ZiBV-tbRIhYb6BbzhvoiWQ==/lib/arm64:/data/app/~~2PtiKLLFHpA44MoyTj1ipg==/bin.mt.plus.canary-ZiBV-tbRIhYb6BbzhvoiWQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand
2024-03-18 21:14:57.958 27578-27578 nativeloader bin.mt.plus.canary D Extending system_exposed_libraries: libapuwareapusys.mtk.so:libapuwareapusys_v2.mtk.so:libapuwarexrp.mtk.so:libapuwarexrp_v2.mtk.so:libapuwareutils.mtk.so:libapuwareutils_v2.mtk.so:libapuwarehmp.mtk.so:libmcv_runtime_usdk.mtk.so:libneuron_graph_delegate.mtk.so:libneuronusdk_adapter.mtk.so:libtflite_mtk.mtk.so:libarmnn_ndk.mtk.so:libcmdl_ndk.mtk.so:libnir_neon_driver_ndk.mtk.so:libmvpu_runtime.mtk.so:libmvpu_runtime_pub.mtk.so:libmvpu_engine_pub.mtk.so:libmvpu_pattern_pub.mtk.so:libmvpuop_mtk_cv.mtk.so:libmvpuop_mtk_nn.mtk.so:libmvpu_runtime_25.mtk.so:libmvpu_runtime_25_pub.mtk.so:libmvpu_engine_25_pub.mtk.so:libmvpu_pattern_25_pub.mtk.so:libmvpuop25_mtk_cv.mtk.so:libmvpuop25_mtk_nn.mtk.so:libmvpu_config.mtk.so:libteeservice_client.trustonic.so
2024-03-18 21:14:57.963 27578-27578 ShizukuServiceStarter bin.mt.plus.canary E provider is null moe.shizuku.privileged.api.shizuku 0
2024-03-18 21:14:57.966 27578-27578 app_process bin.mt.plus.canary I System.exit called, status: 1
---------------------------- PROCESS ENDED (27578) for package bin.mt.plus.canary ----------------------------
2024-03-18 21:14:57.966 27578-27578 AndroidRuntime bin.mt.plus.canary I VM exiting with result code 1.
Describe the bug:
调用 Shizuku.bindUserService 后可能接收不到 onServiceConnected 回调,logcat 中出现 provider is null moe.shizuku.privileged.api.shizuku 0 错误。
而且这个问题是概率性的,每当重新启动 Shizuku 服务后,要么一直成功,要么一直错误。
目前发现出现这个错误后,去 Shizuku 中关闭 APP 的授权再重新打开,就正常了。但如果重启 Shizuku 服务,就可能再次出现该问题。
Additional context:
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: