topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
48.59k stars 12.43k forks source link

Can't access MagiskHide if repackaged in 8.0.1 #3276

Closed mb300sd closed 4 years ago

mb300sd commented 4 years ago

If magisk manager is repackaged, it closes after displaying the loading screen when you click magisk hide. It loads properly if it's not repackaged.

mb300sd commented 4 years ago

https://streamable.com/j8z95u

topjohnwu commented 4 years ago

@mb300sd please switch to canary Magisk Manager and record a logcat when the crash occurs

mb300sd commented 4 years ago

I don't seem to have a canary channel, only stable and beta.

Here's the logcat when it crashes.


10-08 11:12:53.526  1688  2309 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.UMULJqCDhUtK0ldf/QLa.I bnds=[1128,2244][1400,2688]} from uid 10186
10-08 11:12:53.576  1688  1767 I ActivityManager: Start proc 29505:com.UMULJqCDhUtK0ldf/u0a328 for pre-top-activity {com.UMULJqCDhUtK0ldf/QLa.I}
10-08 11:12:53.968  1688  1765 I ActivityTaskManager: Displayed com.UMULJqCDhUtK0ldf/QLa.I: +212ms
10-08 11:12:54.427  1102  1102 E Layer   : [Surface(name=AppWindowToken{7b73e65 token=Token{b06fb5c ActivityRecord{c7245cf u0 com.UMULJqCDhUtK0ldf/QLa.I t13437}}})/@0x72df38c - animation-leash#0] No local sync point found
10-08 11:12:54.434  1102  1102 E Layer   : [Surface(name=AppWindowToken{7b73e65 token=Token{b06fb5c ActivityRecord{c7245cf u0 com.UMULJqCDhUtK0ldf/QLa.I t13437}}})/@0x72df38c - animation-leash#0] No local sync point found
10-08 11:12:54.483 29505 29536 I chatty  : uid=10328(com.UMULJqCDhUtK0ldf) DefaultDispatch identical 1 line
10-08 11:12:54.512  1688  4623 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.UMULJqCDhUtK0ldf/uK.OTj bnds=[1128,2244][1400,2688]} from uid 10328
10-08 11:12:54.550 29505 29505 D AppCompatDelegate: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.UMULJqCDhUtK0ldf/a.b}
10-08 11:13:03.535  1688  2109 W InputDispatcher: channel '23a25fd com.UMULJqCDhUtK0ldf/uK.OTj (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
10-08 11:13:03.535  1688  2109 E InputDispatcher: channel '23a25fd com.UMULJqCDhUtK0ldf/uK.OTj (server)' ~ Channel is unrecoverably broken and will be disposed!
10-08 11:13:03.558  1688  4286 I ActivityManager: Process com.UMULJqCDhUtK0ldf (pid 29505) has died: fore TOP
10-08 11:13:03.560  1688  4286 W ActivityTaskManager: Force removing ActivityRecord{587d345 u0 com.UMULJqCDhUtK0ldf/uK.OTj t13437}: app died, no saved state
10-08 11:13:03.564  1688  4286 W InputDispatcher: Attempted to unregister already unregistered input channel '23a25fd com.UMULJqCDhUtK0ldf/uK.OTj (server)'
mb300sd commented 4 years ago

It also breaks safetynet when it crashes. I have to uninstall MM and reinstall it before it'll pass safetynet again.

mb300sd commented 4 years ago

Still happening in 8.0.2 as well.

mb300sd commented 4 years ago

Found canary, but it won't open at all once it's repackaged.

10-08 11:32:15.073  2634  2812 E android_os_HwBinder: Uncaught exception!
10-08 11:32:15.304  5230  5257 E A       :
10-08 11:32:15.304  5230  5257 E A       : java.io.FileNotFoundException: https://raw.githubusercontent.com/topjohnwu/magisk_files/canary/release.json
10-08 11:32:15.304  5230  5257 E A       :      at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:255)
10-08 11:32:15.304  5230  5257 E A       :      at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:211)
10-08 11:32:15.304  5230  5257 E A       :      at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:30)
10-08 11:32:15.304  5230  5257 E A       :      at uR.O(:2)
10-08 11:32:15.304  5230  5257 E A       :      at uR.y(:1)
10-08 11:32:15.304  5230  5257 E A       :      at l.k(Unknown Source:2)
10-08 11:32:15.304  5230  5257 E A       :      at uR.g(Unknown Source:0)
10-08 11:32:15.304  5230  5257 E A       :      at S.run(Unknown Source:6)
10-08 11:32:15.304  5230  5257 E A       :      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
10-08 11:32:15.304  5230  5257 E A       :      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-08 11:32:15.304  5230  5257 E A       :      at java.lang.Thread.run(Thread.java:919)
10-08 11:32:15.359 23995 24047 W SessionLifecycleManager: Handover failed. Creating new session controller.
10-08 11:32:15.361 23995 24047 E PBSessionCacheImpl: sessionId[105532728160983022] not persisted.
10-08 11:32:15.364 23995  2593 I PBSessionCacheImpl: Deleted sessionId[105532728160983022] from persistence.
10-08 11:32:15.395 23995 24047 I MicroDetectionState: Should stop hotword detection immediately - true
10-08 11:32:16.069  5509  5688 I FirebaseCrash: Sending crashes
zgfg commented 4 years ago

Isn't this a duplicate of 3297 (or vice versa)

Problem is in the link, should be canary/debug.json, not release.json

mb300sd commented 4 years ago

@zgfg I think it's 2 separate issues. 8.0.2 repackages correctly, but crashes when you open MagiskHide. Canary will not open at all when repackaged.

zgfg commented 4 years ago

I was looking to your log as posted two days ago, starting with the uncaught exception due to the wrong link to ...canary/release.json (Magisk Manager not opening upon repackaging)

Ok, that part is duplicate to the mentioned issue - sorry, didn't read what you originally started the report about crashing on Magisk hide

Btw, I have repackaged Magisk Manager Canary 308 this way: https://forum.xda-developers.com/showpost.php?p=83680873&postcount=42033 and I can open/load the Magisk Hide list with no crashing

topjohnwu commented 4 years ago

@mb300sd please retry on the latest canary, you should be able to hide the app and capture logs

mb300sd commented 4 years ago

Here's the logcat from opening MagiskHide in the latest canary.

10-11 23:13:21.828  1688  6249 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=.cgbtiyd/nfh.dN bnds=[856,2042][1128,2486]} from uid 10186
10-11 23:13:21.871  1688  1767 I ActivityManager: Start proc 7819:.cgbtiyd/u0a346 for pre-top-activity {.cgbtiyd/nfh.dN}
10-11 23:13:21.901  7819  7819 E .cgbtiyd: Not starting debugger since process cannot load the jdwp agent.
10-11 23:13:21.922  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:21.924  7819  7819 W .cgbtiyd: Core platform API violation: Ljava/lang/reflect/Executable;->accessFlags:I from Lcom/swift/sandhook/SandHook; using reflection
10-11 23:13:21.924  7819  7819 W .cgbtiyd: Core platform API violation: Ljava/lang/Thread;->nativePeer:J from Lcom/swift/sandhook/SandHook; using reflection
10-11 23:13:21.924  7819  7819 W .cgbtiyd: Core platform API violation: Ljava/lang/reflect/Executable;->artMethod:J from Lcom/swift/sandhook/SandHook; using reflection
10-11 23:13:21.924  7819  7819 W .cgbtiyd: Core platform API violation: Ljava/lang/reflect/Executable;->dexMethodIndex:I from Lcom/swift/sandhook/SandHook; using reflection
10-11 23:13:21.924  7819  7819 W .cgbtiyd: Core platform API violation: Ljava/lang/Class;->dexCache:Ljava/lang/Object; from Lcom/swift/sandhook/SandHook; using reflection
10-11 23:13:21.924  7819  7819 W .cgbtiyd: Core platform API violation: Ljava/lang/DexCache;->resolvedMethods:J from Lcom/swift/sandhook/SandHook; using reflection
10-11 23:13:21.934  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:21.998  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.017  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.023  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.369  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.370  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.371  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.371  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.372  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.374  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.376  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.377  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.378  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.378  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.379  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.380  7819  7819 W .cgbtiyd: Unsupported class loader
10-11 23:13:22.477  1688  1765 I ActivityTaskManager: Displayed .cgbtiyd/nfh.dN: +228ms
10-11 23:13:22.951  1102  1102 E Layer   : [Surface(name=AppWindowToken{b9846bd token=Token{d100e14 ActivityRecord{52d9067 u0 .cgbtiyd/nfh.dN t14725}}})/@0xb4d592d - animation-leash#0] No local sync point found
10-11 23:13:22.952  1102  1102 E Layer   : [Surface(name=AppWindowToken{b9846bd token=Token{d100e14 ActivityRecord{52d9067 u0 .cgbtiyd/nfh.dN t14725}}})/@0xb4d592d - animation-leash#0] No local sync point found
10-11 23:13:23.037  7819  7850 I .cgbtiyd: The ClassLoaderContext is a special shared library.
10-11 23:13:23.041  7819  7850 I chatty  : uid=10346(.cgbtiyd) DefaultDispatch identical 1 line
10-11 23:13:23.044  7819  7850 I .cgbtiyd: The ClassLoaderContext is a special shared library.
10-11 23:13:23.074  1688  4614 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=.cgbtiyd/u8.c bnds=[856,2042][1128,2486]} from uid 10346
10-11 23:13:23.118  7819  7819 D AppCompatDelegate: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{.cgbtiyd/a.b}
10-11 23:13:26.995  7819  7859 W .cgbtiyd: resources.arsc in APK '/data/app/com.instagram.android-D0gKUVmr_rY8k8IuxaiVyQ==/base.apk' is compressed.
10-11 23:13:27.158  7819  7819 I .cgbtiyd: System.exit called, status: 1
10-11 23:13:27.188  1688  2109 W InputDispatcher: channel '539d00c .cgbtiyd/u8.c (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
10-11 23:13:27.189  1688  2109 E InputDispatcher: channel '539d00c .cgbtiyd/u8.c (server)' ~ Channel is unrecoverably broken and will be disposed!
10-11 23:13:27.211  1688  9774 I ActivityManager: Process .cgbtiyd (pid 7819) has died: fore TOP 
10-11 23:13:27.212  1688  4614 I WindowManager: WIN DEATH: Window{539d00c u0 .cgbtiyd/u8.c}
10-11 23:13:27.212  1688  4614 W InputDispatcher: Attempted to unregister already unregistered input channel '539d00c .cgbtiyd/u8.c (server)'
10-11 23:13:27.217  1688  9774 W ActivityTaskManager: Force removing ActivityRecord{df42674 u0 .cgbtiyd/u8.c t14725}: app died, no saved state

Is there any way for me to go back to a repackaged 7.5.1 until this is fixed? I can install it, but it updates to 8.0.2 when repackaging.

zgfg commented 4 years ago

For repackaging Manager 7.5.1:

topjohnwu commented 4 years ago

@mb300sd there is literally no crash in your logs, are you sure you got everything in the logs?

mb300sd commented 4 years ago

Here's the unfiltered logcat. I tried to filter by the package name last time so it wouldn't be so big.

https://pastebin.com/hSyeWLiW

I think this may be the relevant portion.

10-12 15:50:09.078  5343  5385 W .dzauzr : resources.arsc in APK '/data/app/com.instagram.android-D0gKUVmr_rY8k8IuxaiVyQ==/base.apk' is compressed.
10-12 15:50:09.222  5343  5343 E App     : android.content.pm.PackageManager$NameNotFoundException: org.meowcat.edxposed.manager
10-12 15:50:09.222  5343  5343 E App     :  at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:190)
10-12 15:50:09.222  5343  5343 E App     :  at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:159)
10-12 15:50:09.222  5343  5343 E App     :  at com.topjohnwu.magisk.ktx.XAndroidKt.getPackageInfo(XAndroid.kt:76)
10-12 15:50:09.222  5343  5343 E App     :  at com.topjohnwu.magisk.ui.hide.HideViewModel.createTarget(HideViewModel.kt:78)
10-12 15:50:09.222  5343  5343 E App     :  at com.topjohnwu.magisk.ui.hide.HideViewModel.access$createTarget(HideViewModel.kt:24)
10-12 15:50:09.222  5343  5343 E App     :  at com.topjohnwu.magisk.ui.hide.HideViewModel$refresh$1$1$apps$3.invoke(HideViewModel.kt:62)
10-12 15:50:09.222  5343  5343 E App     :  at com.topjohnwu.magisk.ui.hide.HideViewModel$refresh$1$1$apps$3.invoke(HideViewModel.kt:24)
10-12 15:50:09.222  5343  5343 E App     :  at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
10-12 15:50:09.222  5343  5343 E App     :  at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170)
10-12 15:50:09.222  5343  5343 E App     :  at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
10-12 15:50:09.222  5343  5343 E App     :  at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214)
10-12 15:50:09.222  5343  5343 E App     :  at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:742)
10-12 15:50:09.222  5343  5343 E App     :  at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:772)
10-12 15:50:09.222  5343  5343 E App     :  at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:763)
10-12 15:50:09.222  5343  5343 E App     :  at com.topjohnwu.magisk.ui.hide.HideViewModel$refresh$1$1.invokeSuspend(HideViewModel.kt:65)
10-12 15:50:09.222  5343  5343 E App     :  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
10-12 15:50:09.222  5343  5343 E App     :  at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
10-12 15:50:09.222  5343  5343 E App     :  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
10-12 15:50:09.222  5343  5343 E App     :  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
10-12 15:50:09.222  5343  5343 E App     :  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
10-12 15:50:09.222  5343  5343 E App     :  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
10-12 15:50:09.223  5343  5343 I .dzauzr : System.exit called, status: 1
10-12 15:50:09.223  5343  5343 I AndroidRuntime: VM exiting with result code 1, cleanup skipped.
10-12 15:50:09.247  1688  2109 W InputDispatcher: channel '11dab7c .dzauzr/u8.c (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
10-12 15:50:09.247  1688  2109 E InputDispatcher: channel '11dab7c .dzauzr/u8.c (server)' ~ Channel is unrecoverably broken and will be disposed!
10-12 15:50:09.267  1688  2995 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=2239, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&FOREGROUND Uid: 10353] ], android.os.BinderProxy@3c00209)
10-12 15:50:09.268  1688  9774 I WindowManager: WIN DEATH: Window{11dab7c u0 .dzauzr/u8.c}
10-12 15:50:09.268  1688  9774 W InputDispatcher: Attempted to unregister already unregistered input channel '11dab7c .dzauzr/u8.c (server)'
10-12 15:50:09.268  1688  4610 I ActivityManager: Process .dzauzr (pid 5343) has died: fore TOP 
10-12 15:50:09.269   835   835 I Zygote  : Process 5343 exited cleanly (1)
Mr-trololol commented 4 years ago

For repackaging Manager 7.5.1:

* Install Manager 7.5.1

* Change Update Channel to Custom:
  https://raw.githubusercontent.com/topjohnwu/magisk_files/63555595ffa9b079f3a411dd2c00a80a3d985ccc/stable.json

* Verify does it show Magisk 20.4 and Manager 7.5.1 as 'latest'

* Do Hide Magisk Manager

not worka anymoar