BinTianqi / OwnDroid

Own your Android! 使用Device owner管理你的安卓设备。Manage your device with Device owner privilege
https://owndroid.pages.dev
GNU General Public License v3.0
218 stars 11 forks source link

Version 5.3.1 crashes when creating work profile on A14 QPR2 (5.2 works) #25

Closed NielSync closed 1 month ago

NielSync commented 1 month ago
FATAL EXCEPTION: main
Process: com.bintianqi.owndroid, PID: 25576
java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode
    at androidx.fragment.app.i.l(SourceFile:11)
    at androidx.fragment.app.i.startActivityForResult(SourceFile:5)
    at Q0.b.b(SourceFile:1)
    at androidx.activity.g.b(SourceFile:289)
    at E0.q.r(SourceFile:32)
    at I.p.d(SourceFile:500)
    at s.e0.q(SourceFile:446)
    at u.L0.s(SourceFile:134)
    at F1.a.n(SourceFile:9)
    at U1.y.r(SourceFile:79)
    at U1.f.q(SourceFile:105)
    at U1.f.E(SourceFile:33)
    at U1.f.n(SourceFile:17)
    at l0.D.v0(SourceFile:51)
    at l0.D.S(SourceFile:31)
    at t.f.S(SourceFile:3)
    at t.d.S(SourceFile:5)
    at l0.g.h(SourceFile:157)
    at l0.g.h(SourceFile:136)
    at l0.g.h(SourceFile:136)
    at l0.g.h(SourceFile:136)
    at l0.g.h(SourceFile:136)
    at l0.g.h(SourceFile:136)
    at C.Z0.q(SourceFile:36)
    at F.z.f(SourceFile:138)
    at androidx.compose.ui.platform.AndroidComposeView.G(SourceFile:81)
    at androidx.compose.ui.platform.AndroidComposeView.o(SourceFile:214)
    at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(SourceFile:76)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3124)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2805)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3124)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2805)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3124)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2805)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3124)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2805)
    at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:496)
    at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1947)
    at android.app.Activity.dispatchTouchEvent(Activity.java:4413)
    at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:454)
    at android.view.View.dispatchPointerEvent(View.java:16157)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:7436)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7224)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6625)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6682)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6648)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6814)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6656)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6871)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6629)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6682)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6648)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6656)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6629)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:9700)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9651)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:9620)
    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9826)
    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:267)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:344)
    at android.os.Looper.loopOnce(Looper.java:189)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8501)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
    Suppressed: Z1.f: [androidx.compose.ui.platform.v0@18f24bd, I.g@e526ab2, j0{Cancelling}@d45da03, W@7ced80]
Minoricew commented 1 month ago

Issue reproduced. I believe I found where the problem is. Function context.registerForActivityResult() requires the dependency "androidx.fragment" but OwnDroid didn't add it into build.gradle.kts. After I added it to the dependencies, the function seems like it works.

All I'm thinking is, why it works well in OwnDroid version lower than v5.3. Because fragment wasn't introduce before v5.3?

BinTianqi commented 1 month ago

OwnDroid-v5.3.1-fix-issue-25.zip