/dex-access-modifier

Primary LanguageRustApache License 2.0Apache-2.0

DexAccessModifier Hits

Lightweight & lightning fast native (rust) android lib for changing all access modifiers to public.
This was primarily written for Aliucord, to make making plugins easier & faster (no reflection).
Used in combination with my fork-of-a-fork of jadx to use for building plugins against the Discord apk.

NOTE:

This project is currently in WIP, however should work (excluding private instance methods).
Because of this check in the android src, we cannot change private instance methods -> public,
since it now belongs to the virtual methods table. Currently, I'm attempting to write a tool to noop that check.

Benchmarks

Run on a fully charged Pixel 2:

Discord apk classes:

Source Size Time Classes Methods Fields
classes.dex 11mb 78ms 11k 57k 65k
classes2.dex 10.7mb 65ms 11k 56k 26k
classes3.dex 7mb 45ms 8k 39k 45k

Building Prerequisites

  1. Install the rust toolchain
  2. rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
  3. cargo install --force cargo-ndk