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

FFUpdater crashes on Android 14 (InvalidForegroundServiceTypeException) #450

Closed Wojtaz0w closed 1 year ago

Wojtaz0w commented 1 year ago

Describe the bug A crash when starting foreground service. ONLY REPRODUCABLE ON SDK 34!

To Reproduce Steps to reproduce the behavior:

  1. Turn on FFUpdater on forexample Android Studio emulator with Android 14
  2. wait for updates to be checked

Expected behavior App checks for updates

Error message from FFUpdater Stacktrace:

android.app.InvalidForegroundServiceTypeException: Starting FGS with type none callerApp=ProcessRecord{3a01eb 3947:de.marmaro.krt.ffupdater/u0a184} targetSDK=34 has been prohibited
    at android.app.InvalidForegroundServiceTypeException$1.createFromParcel(InvalidForegroundServiceTypeException.java:53)
    at android.app.InvalidForegroundServiceTypeException$1.createFromParcel(InvalidForegroundServiceTypeException.java:49)
    at android.os.Parcel.readParcelableInternal(Parcel.java:4870)
    at android.os.Parcel.readParcelable(Parcel.java:4852)
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3052)
    at android.os.Parcel.createException(Parcel.java:3041)
    at android.os.Parcel.readException(Parcel.java:3024)
    at android.os.Parcel.readException(Parcel.java:2966)
    at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6761)
    at android.app.Service.startForeground(Service.java:862)
    at androidx.work.impl.foreground.SystemForegroundService$Api31Impl.startForeground(SystemForegroundService.java:194)
    at androidx.work.impl.foreground.SystemForegroundService$1.run(SystemForegroundService.java:130)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8176)
    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:971)

Logs:

android.app.InvalidForegroundServiceTypeException: Starting FGS with type none callerApp=ProcessRecord{3a01eb 3947:de.marmaro.krt.ffupdater/u0a184} targetSDK=34 has been prohibited
    at android.app.InvalidForegroundServiceTypeException$1.createFromParcel(InvalidForegroundServiceTypeException.java:53)
    at android.app.InvalidForegroundServiceTypeException$1.createFromParcel(InvalidForegroundServiceTypeException.java:49)
    at android.os.Parcel.readParcelableInternal(Parcel.java:4870)
    at android.os.Parcel.readParcelable(Parcel.java:4852)
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3052)
    at android.os.Parcel.createException(Parcel.java:3041)
    at android.os.Parcel.readException(Parcel.java:3024)
    at android.os.Parcel.readException(Parcel.java:2966)
    at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6761)
    at android.app.Service.startForeground(Service.java:862)
    at androidx.work.impl.foreground.SystemForegroundService$Api31Impl.startForeground(SystemForegroundService.java:194)
    at androidx.work.impl.foreground.SystemForegroundService$1.run(SystemForegroundService.java:130)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8176)
    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:971)
Device information: Key Value
FFUpdater version 78.0.6 (148) debug F-Droid/other
Device sdk_gphone64_x86_64 (sdk_gphone64_x86_64, emu64xa, goldfish_x86_64)
Manufacturer google (Google)
Supported ABIs x86_64, arm64-v8a
Android version 14 (SDK: 34)
OS abfarm-release-rbe-32-2004-00100, android-build, dev-keys, 1688607032000
Tobi823 commented 1 year ago

Fixed in https://github.com/Tobi823/ffupdater/commit/e200b3b14846aef24f991194e7a394340025c743