Tobi823 / ffupdater

FFUpdater: Updater for privacy friendly browser
https://f-droid.org/en/packages/de.marmaro.krt.ffupdater
GNU General Public License v3.0
655 stars 32 forks source link

Root installer started failing #462

Closed usr97629238 closed 12 months ago

usr97629238 commented 1 year ago

Describe the bug The root installer started failing some versions ago (haven't bothered noticing at what version exactly, thinking it was spurious). It's 50/50 either just spinning the loading circle forever or outputting the error below. Either background or foreground. The session installer works fine.

To Reproduce Steps to reproduce the behavior:

  1. Enable the root installer
  2. Try to install anything
  3. Get the error

Expected behavior Successful installation

Error message from FFUpdater Please copy and paste the error message with the stacktrace and error log here:

Stacktrace:
java.lang.RuntimeException: Failed to install TOR_BROWSER in the foreground.
    at de.marmaro.krt.ffupdater.DownloadActivity.installApp(DownloadActivity.kt:395)
    at de.marmaro.krt.ffupdater.DownloadActivity.access$installApp(DownloadActivity.kt:75)
    at de.marmaro.krt.ffupdater.DownloadActivity$installApp$1.invokeSuspend(DownloadActivity.kt:0)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6944)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: de.marmaro.krt.ffupdater.installer.exceptions.InstallationFailedException: Root command 'cat "/storage/emulated/0/Android/data/de.marmaro.krt.ffupdater/files/Download/org_torproject_torbrowser_12_5_2.apk" | pm install-write -S 85915653 1476358899 "org_torproject_torbrowser_12_5_2.apk"' failed. Result code: 1. Stdout: '[]'. Stderr: '[]'.
    at de.marmaro.krt.ffupdater.installer.impl.RootInstaller$execute$2.invokeSuspend(RootInstaller.kt:87)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Logs:
java.lang.RuntimeException: Failed to install TOR_BROWSER in the foreground.
    at de.marmaro.krt.ffupdater.DownloadActivity.installApp(DownloadActivity.kt:395)
    at de.marmaro.krt.ffupdater.DownloadActivity.access$installApp(DownloadActivity.kt:75)
    at de.marmaro.krt.ffupdater.DownloadActivity$installApp$1.invokeSuspend(DownloadActivity.kt:0)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6944)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: de.marmaro.krt.ffupdater.installer.exceptions.InstallationFailedException: Root command 'cat "/storage/emulated/0/Android/data/de.marmaro.krt.ffupdater/files/Download/org_torproject_torbrowser_12_5_2.apk" | pm install-write -S 85915653 1476358899 "org_torproject_torbrowser_12_5_2.apk"' failed. Result code: 1. Stdout: '[]'. Stderr: '[]'.
    at de.marmaro.krt.ffupdater.installer.impl.RootInstaller$execute$2.invokeSuspend(RootInstaller.kt:87)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Device information:
| Key | Value |
| --- | --- |
| FFUpdater version | 78.1.1 (150) release Github |
| Device | SM-A320F (a3y17ltexx, a3y17lte, universal7870) |
| Manufacturer | samsung (samsung) |
| Supported ABIs | armeabi-v7a, armeabi |
| Android version | 8.0.0 (SDK: 26) |
Tobi823 commented 1 year ago

This is strange

Tobi823 commented 1 year ago

I will need your help to fix this bug :)

Can you try if the root installer of Aurora Store works or works better?

(Big parts of the root installer in FFUpdater are taken from Aurora Store. If I introduce a bug, I should find it by comparing my version with the version of Aurora Store)

usr97629238 commented 1 year ago

Aurora 4.1.1.41 root installer works fine. Also MiXplorer 6.58.4

Daviteusz commented 1 year ago

In version 78.0.6, updating via root works.

Stacktrace

java.lang.RuntimeException: Failed to install KIWI in the foreground.
 at de.marmaro.krt.ffupdater.DownloadActivity.installApp(DownloadActivity.kt:395)
 at de.marmaro.krt.ffupdater.DownloadActivity.access$installApp(DownloadActivity.kt:75)
 at de.marmaro.krt.ffupdater.DownloadActivity$installApp$1.invokeSuspend(DownloadActivity.kt:0)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
 at android.os.Handler.handleCallback(Handler.java:942)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loopOnce(Looper.java:201)
 at android.os.Looper.loop(Looper.java:288)
 at android.app.ActivityThread.main(ActivityThread.java:7930)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:854)
Caused by: de.marmaro.krt.ffupdater.installer.exceptions.InstallationFailedException: Root command '"pm install-commit 2144848766' failed. Result code: -1. Stdout: '[]'. Stderr: '[]'.
 at de.marmaro.krt.ffupdater.installer.impl.RootInstaller$execute$2.invokeSuspend(RootInstaller.kt:87)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
 at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
 at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
 at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Device information: Key Value
FFUpdater version 78.1.2 (151) release Github
Device KB2003 (OnePlus8T, OnePlus8T, kona)
Manufacturer OnePlus (OnePlus)
Supported ABIs arm64-v8a, armeabi-v7a, armeabi
Android version 13 (SDK: 33)
OS android-build, nobody, release-keys, 1689270891000
Tobi823 commented 1 year ago

@usr97629238 @Daviteusz Thanks for the info

usr97629238 commented 1 year ago

I can confirm that 78.0.6 indeed works here too

Tobi823 commented 1 year ago

First time, that I used git bisect. If I done it correctly, the first bad commit (which introduce problems) is 025cbc03a6fca1be5212b7eb545c2a214f8721e5

Tobi823 commented 1 year ago

Nevermind, 025cbc03 is still a good commit. I guess I have to bisect again

Tobi823 commented 1 year ago

Seems that d44dd4fd8c8b6b75e8c1b572b8bcd81b39c973f8 causes the problem

Tobi823 commented 1 year ago

I found the bug. It was a simple typo

Tobi823 commented 12 months ago

Fix is now released