revanced-manager icon indicating copy to clipboard operation
revanced-manager copied to clipboard

fix: SecurityException when patching application

Open validcube opened this issue 3 months ago • 2 comments

Notice a problem with one of the banner? lemme know @ https://github.com/validcube/validcube/issues/new

😊 Issue

Multiple users told us about ReVanced Manager v1.19.4/v1.12.0-dev.X getting killed in Android 14 when attempting to patch. We've found the problem to be originating from one of the dependency that we happened to be using, flutter_background.

Starting In Android 14, all foreground services must list at least one foreground service type or else system will raise SecurityException.

  • https://developer.android.com/about/versions/14/changes/fgs-types-required

This issue happen on https://github.com/JulianAssmann/flutter_background/commit/65cf0ec93486b3a6c74339aadaeb384cf2c9a24b and newer, so a PR to fix this have been opened

  • https://github.com/JulianAssmann/flutter_background/pull/83

The relevant code was line 7 in Manifest and line 128 in IsolateHolderService

https://github.com/JulianAssmann/flutter_background/blob/65cf0ec93486b3a6c74339aadaeb384cf2c9a24b/android/src/main/AndroidManifest.xml#L6-L8

https://github.com/JulianAssmann/flutter_background/blob/65cf0ec93486b3a6c74339aadaeb384cf2c9a24b/android/src/main/kotlin/de/julianassmann/flutter_background/IsolateHolderService.kt#L128

🔧 Testing note

Testing was done in Firebase Device Streaming, which means everything happened remotely in Google's servers... alternatively a physical device farm.

📱 Device ⚙️ SDK 📝 Human Verdict
Samsung Galaxy Z Fold 5 Upside Down Cake (34) ✅ Passed

https://github.com/ReVanced/revanced-manager/assets/93124920/5518b5c9-815c-40e5-986e-002d586605d0

fix: #1854, #1841, #1839

validcube avatar Apr 05 '24 07:04 validcube

(fast check not totally sure) why are we missing the android permission for the foreground tho?

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

Which is required by the flutter_background package

Domenic-MZS avatar Apr 06 '24 23:04 Domenic-MZS

(fast check not totally sure) why are we missing the android permission for the foreground tho?

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

Which is required by the flutter_background package

That's a good question, I'm finding a reason to git blaming someone in team now :D - aside from that, yeah we should add it.

validcube avatar Apr 10 '24 06:04 validcube