feat: support down to Android 6
ReVanced Manager can and will work perfectly fine in SDK 21 (Android Lollipop - 5.0), we don't use native API calls that are limited to just Android 8 or newer, Android 6 sounds like a perfect place to start
People can still use custom patches & integration to patch their favourite applications in older versions.
hell, Android 5 or KitKat might work if you're desperate enough
If I remember correctly, patcher and patches don't work in an android 8> environment, due to them using a Files API or something similar
@kitadai31 has achieved compatibility with lower android versions though, it was something called desugaring which basically backports those APIs or something
@kitadai31 can you share if you've faced any problems caused by desugaring and any cons compared to upstream?
ReVanced Manager works on Android 5.0 completely. Desugaring has no disadvantages other than slightly increasing APK size. I don't know about Android 4.4, but it's worth a try.
Some patch is not works on Android 7 or below due to Java nio2 File API, though.
This applies to some resource patches of YouTube and Dynamic color patch of Twitter. These patches uses File API.
But both patches actually requires newer Android version (A8 for YouTube, A12 for Dynamic color), so this is not a big problem.
But this PR is not enough to make manager works on Android 6.
- apksig won't work on Android 6. You should switch to MuntashirAkon/apksig-android
- flutter_plugin_device_apps needs a fix (https://github.com/kitadai31/flutter_plugin_device_apps/commit/a8bff360982d7acb545b97c19c221560bc5ffa91)
- Use
com.android.tools:desugar_jdk_libs_nio:2.0.4for the desugaring library because nio is needed - multiDex is not needed if you set minSdk to 21+
This is an example implement. https://github.com/kitadai31/revanced-manager-android5-7/commit/41b3075cf5c069575103efa19401966b0ec61879
Or could you let me open new PR? I can do this.
As long as those issues with the File API are present, I don't believe we should ship ReVanced Manager to android versions where those patches would fail
Is there anyway to "desugar" the File API?
Is there anyway to "desugar" the File API?
I have no idea
But I don't think we should cancel this PR because of File API Because, patching tools should be independent of patches In fact, there are patch bundles that don't use the File API kitadai31/revanced-patches-android6-7 d4n3436/revanced-patches-android5
I think the patches' problem of not supporting old platform should be fixed on the patches side
@oSumAtrIX thoughts? does patcher use any APIs that'd be problematic like the Files API?
ReVanced Patcher targets a specific Java API. If the Android version supports that, it should work fine. Am I understanding the question correctly?
does patcher use any APIs that'd be problematic like the Files API
It's yes but patcher will be desugared correctly Because it is integrated in the Manager APK as a dependent library
The only problem is patches We can't desugar the supplied dex file coming from external