BinTianqi / OwnDroid

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

[BUG] Crash on App manager #69

Closed HarriBuh closed 1 month ago

HarriBuh commented 1 month ago
[Device Brand]: google
[Device Model]: Pixel 7
[Android Version]: 14
[Android API Level]: 34
[Process ID]: 25498
[CPU ABI]: arm64-v8a
[Package Name]: com.bintianqi.owndroid
[Version Name]: 6.0
[Version Code]: 32
[Target SDK]: 34
[Min SDK]: 21
[Error Type]: JVM
[Crash Time]: 2024-08-15T15:00:40.002
[Stack Trace]:
java.lang.SecurityException: Admin ComponentInfo{com.bintianqi.owndroid/com.bintianqi.owndroid.Receiver} does not exist or is not owned by uid 10296
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3183)
    at android.os.Parcel.createException(Parcel.java:3167)
    at android.os.Parcel.readException(Parcel.java:3150)
    at android.os.Parcel.readException(Parcel.java:3092)
    at android.app.admin.IDevicePolicyManager$Stub$Proxy.isPackageSuspended(IDevicePolicyManager.java:8210)
    at android.app.admin.DevicePolicyManager.isPackageSuspended(DevicePolicyManager.java:9734)
    at A1.a.r(SourceFile:1)
    at k0.d.r(SourceFile:16)
    at A1.L.i(SourceFile:193)
    at R.b.e(SourceFile:44)
    at R.b.i(SourceFile:9)
    at F.z.l(SourceFile:390)
    at R.b.l(SourceFile:52)
    at J.d.a(SourceFile:222)
    at S.h.e(SourceFile:162)
    at a0.t.o(SourceFile:90)
    at androidx.navigation.compose.o.l(SourceFile:75)
    at R.b.l(SourceFile:52)
    at J.d.b(SourceFile:150)
    at a0.t.k(SourceFile:51)
    at androidx.navigation.compose.t.i(SourceFile:73)
    at R.b.e(SourceFile:44)
    at R.b.i(SourceFile:9)
    at D.w0.k(SourceFile:268)
    at R.b.c(SourceFile:44)
    at R.b.k(SourceFile:9)
    at androidx.compose.animation.a.a(SourceFile:1287)
    at s.c.l(SourceFile:273)
    at R.b.l(SourceFile:52)
    at a0.t.i(SourceFile:927)
    at a0.t.m(SourceFile:275)
    at a0.t.l(SourceFile:46)
    at A1.M.k(SourceFile:1865)
    at R.b.c(SourceFile:44)
    at R.b.k(SourceFile:9)
    at H.y0.l(SourceFile:112)
    at R.b.l(SourceFile:52)
    at F.z.l(SourceFile:332)
    at R.b.l(SourceFile:52)
    at J.d.I(SourceFile:15)
    at J.q.q(SourceFile:122)
    at J.q.k(SourceFile:11)
    at J.v.k(SourceFile:35)
    at J.x0.a(SourceFile:45)
    at J.o.a(SourceFile:5)
    at J.v.l(SourceFile:9)
    at q0.B.i(SourceFile:22)
    at q0.B.h(SourceFile:118)
    at q0.w.g0(SourceFile:167)
    at H.B0.l(SourceFile:881)
    at q0.y.c(SourceFile:74)
    at s0.t.a(SourceFile:38)
    at s0.D.d(SourceFile:565)
    at T.s.d(SourceFile:60)
    at T.v.a(SourceFile:52)
    at T.w.c(SourceFile:153)
    at s0.f0.a(SourceFile:3)
    at s0.I.m0(SourceFile:129)
    at s0.I.a(SourceFile:91)
    at x.k.c(SourceFile:83)
    at s0.t.a(SourceFile:38)
    at c0.J.g(SourceFile:1)
    at s0.y.a(SourceFile:11)
    at c0.J.g(SourceFile:1)
    at s0.y.a(SourceFile:11)
    at s0.D.d(SourceFile:565)
    at T.s.d(SourceFile:60)
    at T.v.a(SourceFile:52)
    at T.w.c(SourceFile:153)
    at s0.f0.a(SourceFile:3)
    at s0.I.m0(SourceFile:129)
    at s0.I.a(SourceFile:91)
    at s.l.c(SourceFile:24)
    at s0.t.a(SourceFile:38)
    at s.B.g(SourceFile:191)
    at s0.y.a(SourceFile:11)
    at c0.J.g(SourceFile:1)
    at s0.y.a(SourceFile:11)
    at D.R0.k(SourceFile:151)
    at q0.s.g(SourceFile:8)
    at s0.y.a(SourceFile:11)
    at s0.D.d(SourceFile:565)
    at T.s.d(SourceFile:60)
    at T.v.a(SourceFile:52)
    at T.w.c(SourceFile:153)
    at s0.f0.a(SourceFile:3)
    at s0.I.m0(SourceFile:129)
    at s0.I.a(SourceFile:91)
    at s.f.c(SourceFile:40)
    at s0.t.a(SourceFile:38)
    at s.i.g(SourceFile:1)
    at s0.c.g(SourceFile:10)
    at s0.y.a(SourceFile:11)
    at c0.J.g(SourceFile:1)
    at s0.y.a(SourceFile:11)
    at x.v.g(SourceFile:59)
    at s0.c.g(SourceFile:10)
    at s0.y.a(SourceFile:11)
    at x.r.g(SourceFile:99)
    at s0.y.a(SourceFile:11)
    at s0.D.d(SourceFile:565)
    at T.s.d(SourceFile:60)
    at T.v.a(SourceFile:52)
    at T.w.c(SourceFile:153)
    at s0.f0.a(SourceFile:3)
    at s0.I.m0(SourceFile:129)
    at s0.Q.d(SourceFile:55)
    at s0.Q.l(SourceFile:124)
    at s0.Q.f(SourceFile:121)
    at s0.Q.e(SourceFile:44)
    at androidx.compose.ui.platform.AndroidComposeView.n(SourceFile:3)
    at s0.I.m0(SourceFile:58)
    at s0.Q.d(SourceFile:18)
    at s0.Q.n(SourceFile:18)
    at s0.Q.k(SourceFile:64)
    at androidx.compose.ui.platform.AndroidComposeView.onMeasure(SourceFile:83)
    at android.view.View.measure(View.java:27866)
    at androidx.compose.ui.platform.a.e(SourceFile:64)
    at androidx.compose.ui.platform.a.onMeasure(SourceFile:4)
    at android.view.View.measure(View.java:27866)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7028)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.view.View.measure(View.java:27866)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7028)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1608)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:878)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
    at android.view.View.measure(View.java:27866)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7028)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at com.android.internal.policy.DecorView.onMeasure(DecorView.java:768)
    at android.view.View.measure(View.java:27866)
    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:4486)
    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:3012)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3333)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2718)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9937)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1406)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
    at android.view.Choreographer.doCallbacks(Choreographer.java:1015)
    at android.view.Choreographer.doFrame(Choreographer.java:945)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1389)
    at android.os.Handler.handleCallback(Handler.java:959)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loopOnce(Looper.java:232)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8592)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
Caused by: android.os.RemoteException: Remote stack trace:
    at com.android.server.devicepolicy.DevicePolicyManagerService.getCallerIdentity(DevicePolicyManagerService.java:2391)
    at com.android.server.devicepolicy.DevicePolicyManagerService.isPackageSuspended(DevicePolicyManagerService.java:13018)
    at android.app.admin.IDevicePolicyManager$Stub.onTransact$isPackageSuspended$(IDevicePolicyManager.java:14279)
    at android.app.admin.IDevicePolicyManager$Stub.onTransact(IDevicePolicyManager.java:3848)
    at android.os.Binder.execTransactInternal(Binder.java:1500)

Root granted via Sui/ Shizuku

BinTianqi commented 1 month ago

I see, I will fix it

You can activate OwnDroid as Device owner to solve this problem.

HarriBuh commented 1 month ago

I see, I will fix it

You can activate OwnDroid as Device owner to solve this problem.

There will be another error (inside the app) when I try your advice:

Error: 255com.bintianqi.owndroid/.Receiver was already an admin for user 0. No need to set it again.

Exception occurred while executing 'set-device-owner':
java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device.
    at com.android.server.devicepolicy.DevicePolicyManagerService.enforceCanSetDeviceOwnerLocked(DevicePolicyManagerService.java:10811)
    at com.android.server.devicepolicy.DevicePolicyManagerService.setDeviceOwner(DevicePolicyManagerService.java:9457)
    at com.android.server.devicepolicy.DevicePolicyManagerServiceShellCommand.runSetDeviceOwner(DevicePolicyManagerServiceShellCommand.java:264)
    at com.android.server.devicepolicy.DevicePolicyManagerServiceShellCommand.onCommand(DevicePolicyManagerServiceShellCommand.java:87)
    at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
    at android.os.ShellCommand.exec(ShellCommand.java:38)
    at com.android.server.devicepolicy.DevicePolicyManagerService.onShellCommand(DevicePolicyManagerService.java:11244)
    at android.os.Binder.shellCommand(Binder.java:1230)
    at android.os.Binder.onTransact(Binder.java:1043)
    at android.app.admin.IDevicePolicyManager$Stub.onTransact(IDevicePolicyManager.java:6414)
    at android.os.Binder.execTransactInternal(Binder.java:1505)
    at android.os.Binder.execTransact(Binder.java:1444)
BinTianqi commented 1 month ago

There will be another error (inside the app) when I try your advice

https://owndroid.pages.dev/FAQ.html#accounts-restriction

HarriBuh commented 1 month ago

There will be another error (inside the app) when I try your advice

https://owndroid.pages.dev/FAQ.html#accounts-restriction

It says: You should remove all accounts on your device

No offense, but this is ridiculous. I will not do that, because I need these accounts.

If there is nothing more I could do about it, I will then wait for your fix.

BinTianqi commented 1 month ago

No offense, but this is ridiculous. I will not do that, because I need these accounts.

I know it is hard for everyone to do so, but "remove all accounts before activate device owner" is enforced by Android system, I can't change it. OwnDroid at a deactivated status can do almost nothing.

You can disable account holder apps temporarily and enable them after owndroid is successfully activated, your account won't lose.

HarriBuh commented 1 month ago

This sounds really smart, I will try this 👍🏼

Edit: Everything except Google's own account can be easily deactivated by me. I don't know how exactly I could do that.

BinTianqi commented 1 month ago

Everything except Google's own account can be easily deactivated by me. I don't know how exactly I could do that.

Try disable com.google.android.gms (maybe called Google service core)

HarriBuh commented 1 month ago

It still won't work, giving me the exact same error message as before 😥

Screenshot_20240815-173139.png

BinTianqi commented 1 month ago

list accounts using this command (adb shell or shizuku in owndroid)

dumpsys account
HarriBuh commented 1 month ago

Accounts: 5 Account {name=xxx@gmail.com, type=com.google} Account {name=WhatsApp, type=com.whatsapp} Account {name=xxx, type=com.github.android} Account {name=Molly, type=im.molly.app} Account {name=xxx, type=www.instagram.com}

All of these accounts are deactivated with root, though.

BinTianqi commented 1 month ago

All of these accounts are deactivated with root, though.

If your device is rooted and lsposed is installed, you can try HookDPM to bypass account amount restriction

HarriBuh commented 1 month ago

All of these accounts are deactivated with root, though.

If your device is rooted and lsposed is installed, you can try HookDPM to bypass account amount restriction

This did the trick. It's working now. Thank you for your dedicated help 👍🏼👍🏼👍🏼

Edit: I forgot that this ticket was about another issue in the first place, lol

This fix did also fix the first issue; I can now access the app manager without issues as well. So I'm gonna finally close this issue then.

islam2hamy commented 1 month ago

I see, I will fix it

You can activate OwnDroid as Device owner to solve this problem.

Hello ,will this be fixed?

BinTianqi commented 1 month ago

Hello ,will this be fixed?

Of course

islam2hamy commented 1 month ago

Hello ,will this be fixed?

Of course

Thank you.