AndroidManifest里面已经加了读取权限,在真机上我又允许读写手机存储,可以读取dex。可是又报了其他错误。
2022-10-10 17:00:42.561 25835-25835/? I/xample.shell00: Late-enabling -Xcheck:jni
2022-10-10 17:00:42.981 25835-25835/com.example.shell001 I/Perf: Connecting to perf service.
2022-10-10 17:00:43.003 25835-25835/com.example.shell001 E/linker: library "/storage/emulated/0/oat/arm64/classes.odex" ("/storage/emulated/0/oat/arm64/classes.odex") needed or dlopened by "/system/lib64/libart.so" is not accessible for the namespace: [name="(default)", ld_library_paths="", default_library_paths="/system/lib64", permitted_paths="/system/lib64/drm:/system/lib64/extractors:/system/lib64/hw:/system/product/lib64:/system/framework:/system/app:/system/priv-app:/vendor/framework:/vendor/app:/vendor/priv-app:/odm/framework:/odm/app:/odm/priv-app:/oem/app:/system/product/framework:/system/product/app:/system/product/priv-app:/data:/mnt/expand"]
2022-10-10 17:00:43.005 25835-25835/com.example.shell001 I/xample.shell00: The ClassLoaderContext is a special shared library.
2022-10-10 17:00:43.015 25835-25835/com.example.shell001 W/xample.shell00: Accessing hidden method Landroid/app/ActivityThread;->currentActivityThread()Landroid/app/ActivityThread; (light greylist, reflection)
2022-10-10 17:00:43.016 25835-25835/com.example.shell001 W/xample.shell00: Accessing hidden field Landroid/app/ActivityThread;->mPackages:Landroid/util/ArrayMap; (light greylist, reflection)
2022-10-10 17:00:43.016 25835-25835/com.example.shell001 W/xample.shell00: Accessing hidden field Landroid/app/LoadedApk;->mClassLoader:Ljava/lang/ClassLoader; (light greylist, reflection)
2022-10-10 17:00:43.016 25835-25835/com.example.shell001 E/mClassLoader: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.shell001-cKaRC36GH0QM8P33I_SSaA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.shell001-cKaRC36GH0QM8P33I_SSaA==/lib/arm64, /system/lib64]]]
2022-10-10 17:00:43.016 25835-25835/com.example.shell001 I/shell: Start
2022-10-10 17:00:43.018 25835-25835/com.example.shell001 D/AndroidRuntime: Shutting down VM
--------- beginning of crash
2022-10-10 17:00:43.022 25835-25835/com.example.shell001 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.shell001, PID: 25835
java.lang.RuntimeException: Unable to instantiate application com.example.shell001.StubApplication: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.LoadedApk.makeApplication(LoadedApk.java:1073)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5925)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6815)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:922)
at android.app.ContextImpl.startActivity(ContextImpl.java:898)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:389)
at com.example.shell001.StubApplication.attachBaseContext(StubApplication.java:31)
at android.app.Application.attach(Application.java:215)
at android.app.Instrumentation.newApplication(Instrumentation.java:1122)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1065)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5925)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6815)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
2022-10-10 17:00:43.057 25835-25835/com.example.shell001 I/Process: Sending signal. PID: 25835 SIG: 9