Full rewrite of DexPatcher-gradle for Android Gradle plugin v3.
IMPORTANT:
DexPatcher-gradle v2 no longer requires a local clone of the DexPatcher-gradle-tools repo (which has been deprecated) and no longer requires entries in 'local.properties'.
Instead, it downloads the required tools on the fly as specified in ad-hoc configurations (with caching provided by Gradle). Builds are now fully self-contained and no longer depend on external factors such as the local versions of tools.
All the required tools are available on the new DexPatcher Maven repo, which mirrors artifacts released via the GitHub release mechanism.
INVALID RESOURCES:
DexPatcher-gradle can now patch apps that contain invalid resources.
This involves disabling resource validation in the build pipeline and using a modified AAPT2 binary that allows building slightly out-of-spec apps. The custom AAPT2 binaries are produced by the Apktool project and are bundled with their releases.
A sample project is available here. The configuration for handling invalid resources is shown here. Alternatively, instead of enabling useAapt2BundledWithApktool
, a specific AAPT2 binary can be chosen here. Note that all custom AAPT2 binaries produced by the Apktool project are available standalone in the DexPatcher repo.
Supports:
- Android Gradle plugin v3.2 though v3.4.2.
- AAPT versions 1 and 2 (
android.enableAapt2=false
andtrue
).
Note: Support for AAPT version 1 was removed from Android Gradle plugin since v3.3. android.enableDexingArtifactTransform=false
andtrue
.- Gradle v4.9 through at least v5.6.4.
Note: Android Gradle plugin imposes further Gradle version limitations.
Limitations:
- Dex2jar has not been updated to support Android 9 or 10 apps. Usage of Dex2jar can be disabled by setting
importSymbols=false
here. - Smali's dexlib2 does not yet support certain bytecode features that can only be found in Android 10 framework/system apps. The DexPatcher tool uses dexlib2 and can thus run into trouble when handling these features.
- If you are running Android Studio v3.4 or earlier, you must disable 'Instant Run'.
Samples available here.
The official video track for DexPatcher-gradle v2.0.0 is Rüfüs Du Sol's Innerbloom.