Skip to content

Releases: DexPatcher/dexpatcher-gradle

v2.1.3

23 Jun 09:49
Compare
Choose a tag to compare
v2.1.3 Pre-release
Pre-release

Supports:

  • Android Gradle plugin v4.0 and maybe later versions.
  • Gradle v6.1.1 through v6.2.2, and v6.5 and maybe later versions.

Limitations:

  • Android Gradle plugin v4.0 no longer supports local android library dependencies when building an android library. These means that patch libraries, which depend on local apk libraries, can no longer be built. See this bug report for more details.

  • Patching apps that have invalid resources is no longer possible, for the time being. See the v2.1.2 release notes for more details.

  • DexPatcher annotations v1.8.0-beta1 or later must be used to build patches. See the v2.1.1 release notes for more details.

Samples available here.

v2.1.2

22 Jun 14:03
Compare
Choose a tag to compare
v2.1.2 Pre-release
Pre-release

Supports:

  • Android Gradle plugin v3.6 though v3.6.3.
  • Gradle v5.6.4 and maybe later versions.

Limitations:

  • Apktool is running late on updates, and the AAPT2 binaries shipped with latest Apktool (v2.4.1) are not compatible with the Android Gradle plugin v3.6. Until the Apktool project updates their AAPT2 binaries, builds will fail if useAapt2BundledWithApktool is enabled and it will not be possible to patch apps having invalid resources.

    Note that incompatibilities mostly stem from new ProGuard options in AAPT2 which are emitted even if ProGuard processing is disabled. An adapter script that filters out these options could be used to make the newer plugins work with older versions of AAPT2. The script would be configured as the AAPT2 executable using the existing DexPatcher-gradle infrastructure for AAPT2 executable selection.

    Also note that Android seems to be moving towards a pure JVM build ecosystem, which would entail phasing out AAPT2. This can be seen in the code of the Android Gradle plugin v4.0. How this change will impact the processing of apps with invalid resources cannot be predicted at this time.

  • DexPatcher annotations v1.8.0-beta1 or later must be used to build patches. See the v2.1.1 release notes for more details.

Samples available here.

v2.1.1

21 Jun 00:19
Compare
Choose a tag to compare
v2.1.1 Pre-release
Pre-release

Supports:

  • Android Gradle plugin v3.5 though v3.5.2.
  • Gradle v5.4.1 through at least v5.6.4.

Limitations:

The new dexers of the Android ecosystem , r8 and d8, have an issue with annotation retention. Quoting the DexPatcher-tool v1.8.0-beta1 release notes:

Retention policy of DexPatcher annotations changed from CLASS to RUNTIME. This change is required for compatibility with the new r8/d8 dexers. Contrary to the old dx, these dexers remove annotations with CLASS retention, presumably because it is expected that all bytecode processing happens before dexing. Or, who knows, it could be a bug. Note that DexPatcher always strips its annotations during processing, so this change does not affect the bytecode produced by the tool.

The Android Gradle plugin v3.5 uses r8/d8 for dexing, which means that DexPatcher patches have to be compiled against DexPatcher annotations v1.8.0-beta1 or later (which happens automatically if you use the same version of the tool, but could also be specified independently of it). Note that prior versions of the annotations would be stripped from the patch during dexing, and the patch would later fail to apply.

Samples available here.

v2.1.0

21 Jun 00:15
Compare
Choose a tag to compare
v2.1.0 Pre-release
Pre-release

This is a cleanup release with no new functionality.

A specific version of DexPatcher-gradle used to support a somewhat wide range of Android Gradle plugin versions. And because each plugin version has different Gradle version requirements, DexPatcher-gradle also needed to support a wide range of versions of Gradle. Adaptation layers with dynamic behavior were needed for both the Android plugin and Gradle, implemented via a mixture of Groovy's @CompileDynamic, reflection, and straight catching of linkage errors. It was a maintenance and testing mess.

But no longer... From v2.1.0, DexPatcher-gradle only supports narrow, effectively compatible version ranges of the Android plugin and Gradle. It does not attempt to widen compatibility via dynamic code. This will reduce the effort needed to keep the software up-to-date, hopefully offsetting the negative impact of the new narrow range model.

Changes:

  • Increased robustness, maintainability, and testability:
    • All dynamic code for widening version range compatibility has been eliminated.
    • The remaining reflective code has been reworked to fully link and fail early.
  • Changes to the build system:
    • Reproducible builds.
    • About info moved to META-INF/about.
    • New build diagnostics.
    • Build code sharing with other DexPatcher projects.
    • Publish artifacts to local and remote repositories.
    • Compatible with Sonatype and JitPack.
    • Added Travis CI setup.

Supports:

  • Android Gradle plugin v3.4 though v3.4.2.
  • AAPT2 only (no support for AAPT version 1).
  • Gradle v5.1.1 through at least v5.6.4.

Samples available here.

The official video track for DexPatcher-gradle v2.1.0 is Rone's Gravity.

v2.0.0

01 Nov 06:59
Compare
Choose a tag to compare

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 and true).
    Note: Support for AAPT version 1 was removed from Android Gradle plugin since v3.3.
  • android.enableDexingArtifactTransform=false and true.
  • 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.

image

v2.0.0-beta2

03 Jul 09:42
Compare
Choose a tag to compare
v2.0.0-beta2 Pre-release
Pre-release

This release fixes a regression in v2.0.0-beta1 involving Gradle v5.2 and later versions.

Supports:

  • Gradle v4.9 through v5.5.

Please see v2.0.0-beta1 release notes for more info.

Samples available here.

v2.0.0-beta1

02 Jul 09:22
Compare
Choose a tag to compare
v2.0.0-beta1 Pre-release
Pre-release

Full rewrite of DexPatcher-gradle for Android Gradle plugin v3.

IMPORTANT:
Staring with v2.0.0-beta1, DexPatcher-gradle no longer requires a local clone of the DexPatcher-gradle-tools repo (which is being deprecated as of this moment) 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.

Supports:

  • Android Gradle plugin v3.2 though v3.4.1.
  • AAPT versions 1 and 2 (android.enableAapt2=false and true).
    Note: Support for AAPT version 1 was removed from Android Gradle plugin since v3.3.
  • android.enableDexingArtifactTransform=false and true.
  • Gradle v4.9 through v5.1.1.
    Note: Android Gradle plugin imposes further Gradle version limitations.

Known issues:

  • A regression makes this version of DexPatcher-gradle incompatible with Gradle v5.2 and later versions.

Samples available here.

v2.0.0-alpha4

27 Apr 16:22
Compare
Choose a tag to compare
v2.0.0-alpha4 Pre-release
Pre-release

Full rewrite of DexPatcher-gradle for Android Gradle plugin v3.

Supports:

  • Android Gradle plugin v3.2 though v3.4.
  • AAPT versions 1 and 2 (android.enableAapt2=false and true).
    Note: Support for AAPT version 1 was removed from Android Gradle plugin since v3.3.
  • android.enableDexingArtifactTransform=false and true.
  • Gradle v4.9 through v5.4.
    Note: Android Gradle plugin imposes further Gradle version limitations.

Samples available here.

v2.0.0-alpha3

23 Apr 23:32
Compare
Choose a tag to compare
v2.0.0-alpha3 Pre-release
Pre-release

Full rewrite of DexPatcher-gradle for Android Gradle plugin v3.

Supports:

  • Android Gradle plugin v3.2.x and v3.3.x.
  • AAPT versions 1 and 2 (android.enableAapt2=false and true).
    Note: Support for AAPT version 1 was removed from Android Gradle plugin v3.3.x.
  • android.enableDexingArtifactTransform=false and true.
  • Gradle v4.9 through v4.10.3.
    Note: Android Gradle plugin v3.3.x requires v4.10.1+.

Samples available here.

Note: This release fixes a regression in v2.0.0-alpha2 involving 'patchDex' tasks that are up-to-date or cached. Release v2.0.0-alpha2 has been retired.

v2.0.0-alpha1

14 Apr 10:51
Compare
Choose a tag to compare
v2.0.0-alpha1 Pre-release
Pre-release

Full rewrite of DexPatcher-gradle for Android Gradle plugin v3.

Supports:

  • Android Gradle plugin v3.3.0 through v3.3.2.
  • AAPT version 2.
  • Gradle v4.9 through v4.10.3.
    Note: Android Gradle plugin v3.3.x requires v4.10.1+.

Samples available here.

Please test and report. Thanks!