Skip to content

[Bug] 疑似硬编码 userid 导致双开/工作资料环境下无法启动打包后的应用 #82

@KsharpMoring

Description

@KsharpMoring

Steps to reproduce/复现步骤

  1. 在双开/工作资料环境(如 炼妖壶 创建的 user 10)下安装 NPatch 以及 打包的应用
  2. 启动打包的应用,应用直接闪退,并且进入系统设置-应用管理,找到该应用在工作资料空间的那一个,点开应用设置页面,再点开通知设置,会提示“在已安装应用的列表中找不到该应用”
  3. 抓取 打包后的应用 启动时的 logcat,发现:
Caused by: java.io.IOException: Unable to create cache directory: 
/data/user/0/com.baidu.tieba/cache

错误提示中显示的路径来自主用户(user 0)而非工作资料环境(user 10)

Expected behaviour/预期行为

在双开环境(如 炼妖壶 创建的 user 10)下安装 NPatch 以及 打包的应用,打包的应用 应当 正常运行 并可以正常设置通知等权限

Actual behaviour/实际行为

启动打包的应用,应用直接闪退,并且进入系统设置-应用管理,找到该应用在工作资料空间的那一个,点开应用设置页面,再点开通知设置,会提示“在已安装应用的列表中找不到该应用”

Xposed Module List/Xposed 模块列表

com.forbidad4tieba.hook

NPatch version/NPatch 版本

v1.0.2(看TG群说1.0.5已经发了,但是我看releases里最新的还是1.0.2)

Android version/Android 版本

12

Shizuku version/Shizuku 版本

13.5

Version requirement/版本要求

  • I am using latest debug CI version of NPatch and enable verbose log/我正在使用最新 CI 调试版本且启用详细日志

Apk file/Apk 文件

No response

Logs/日志

Details
--------- beginning of crash
05-10 01:59:12.437 17423 17439 E AndroidRuntime: FATAL EXCEPTION: queued-work-looper
05-10 01:59:12.437 17423 17439 E AndroidRuntime: Process: com.baidu.tieba, PID: 17423
05-10 01:59:12.437 17423 17439 E AndroidRuntime: java.lang.ExceptionInInitializerError
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at org.lsposed.npatch.metaloader.LSPAppComponentFactoryStub.a(r8-map-id-561344b7dbca88a9dc10d23c0dee936c3891a850079c4f183569c73dd0605d19:64)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at org.lsposed.npatch.metaloader.LSPAppComponentFactoryStub.<clinit>(r8-map-id-561344b7dbca88a9dc10d23c0dee936c3891a850079c4f183569c73dd0605d19:23)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at java.lang.Class.newInstance(Native Method)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.app.LoadedApk.createAppFactory(LoadedApk.java:288)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:1118)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.app.LoadedApk.getClassLoader(LoadedApk.java:1205)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.app.ActivityThread.processAysncPreloadClassMsg(ActivityThread.java:2719)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.app.ActivityThread.access$2600(ActivityThread.java:313)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.app.ActivityThread$PreloadThreadHandler.handleMessage(ActivityThread.java:2693)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:117)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:205)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:293)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at android.os.HandlerThread.run(HandlerThread.java:110)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: Caused by: java.io.IOException: Unable to create cache directory: /data/user/0/com.baidu.tieba/cache
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at org.lsposed.npatch.metaloader.LSPAppComponentFactoryStub.b(r8-map-id-561344b7dbca88a9dc10d23c0dee936c3891a850079c4f183569c73dd0605d19:7)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	at org.lsposed.npatch.metaloader.LSPAppComponentFactoryStub.a(r8-map-id-561344b7dbca88a9dc10d23c0dee936c3891a850079c4f183569c73dd0605d19:49)
05-10 01:59:12.437 17423 17439 E AndroidRuntime: 	... 12 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions