Skip to content

SimonBaars/android-mac-changer

Repository files navigation

Android Mac Changer

A root MAC-address changer for Android with the full GNU macchanger feature set, plus an LSPosed hook so a custom MAC actually sticks on modern Android (12+), where the Wi-Fi framework otherwise re-randomizes it.

Current Android MAC changers are closed source or don't work on newer devices. This app aims to fix that.

Features (macchanger parity)

macchanger App action Notes
-s show "Show" + live MAC card current MAC, vendor, permanent MAC, LA/universal
-r random "Random" fully random MAC
-e ending "Keep vendor" keep the 3 vendor (OUI) bytes, randomize the rest
-a another "Wi-Fi vendor" random real OUI from the bundled wireless.list
-A any "Any vendor" random real OUI from the bundled OUI.list
-m mac "Set specific" type or generate a MAC and apply it
-p permanent "Permanent" restore the factory MAC (ethtool -P)
-b bia "Burned-in address" switch clear the locally-administered bit
-l list "Browse known vendors" searchable IEEE OUI database

The vendor data is GNU macchanger's own OUI.list and wireless.list, bundled verbatim as assets, so vendor behaviour matches the desktop tool.

How it works

Two complementary backends:

  1. Netdev (root)ip link set <iface> address … with ifconfig hw ether fallbacks. This is the classic macchanger mechanism and works directly on many chipsets, older Android versions, and non-Wi-Fi interfaces.

  2. Xposed hook (LSPosed / Vector) — on Android 12+ the Wi-Fi framework programs the MAC via WifiNative.setStaMacAddress() in system_server on every connect/rotation, reverting any ip link change. The bundled Xposed module hooks that method and substitutes your chosen MAC, so it survives reconnects. The chosen MAC is shared with the hook through libxposed remote preferences.

    The module is built against the libxposed API 100 contract bundled by the installed framework (LSPosed and the maintained Vector fork). Because the Maven Central io.github.libxposed:api releases (101/102) ship an incompatible contract (no-arg constructor + interceptor chain), the matching API source is vendored as a compileOnly stub module in :xposed-api; it is provided by the framework at runtime and never packaged into the APK.

When you apply a MAC to a Wi-Fi interface, the app stores it for the hook, sets it at the netdev level, then cycles Wi-Fi so the framework re-programs it through the hook.

Requirements

  • Root (Magisk / KernelSU / APatch).
  • For Wi-Fi on Android 12+: an Xposed framework — LSPosed or the maintained Vector (Zygisk) fork. Without it, Wi-Fi changes are reverted by the framework; other interfaces still work via root alone.

Note on Android 16: older LSPosed builds crash on Android 16 with NoSuchMethodError: IUserManager.getUsers(ZZZ) and can't reliably manage module scopes. Use Vector v2.0+, which targets Android 8.1–16.

Setup

  1. Install the APK.
  2. Launch it and grant the superuser prompt.
  3. Open your Xposed manager (LSPosed/Vector → Modules → MAC Changer), enable it, set scope to System Framework (android), then reboot. The hook is only installed when system_server (re)starts, so the reboot is required.
  4. Pick an interface, choose an action, done. The "Spoofing active" card shows the MAC the hook is currently enforcing; "Disable spoofing" returns control to the framework.

Building

./gradlew :app:assembleDebug      # APK in app/build/outputs/apk/debug/
adb install -r app/build/outputs/apk/debug/app-debug.apk

./gradlew :app:assembleRelease    # APK in app/build/outputs/apk/release/

Requires the Android SDK (platform 36, build-tools 36) and JDK 21.

Prebuilt APKs / CI

Every push to master runs .github/workflows/release.yml, which builds a release APK and publishes it as a GitHub Release (tagged v1.0.<run>). By default the APK is debug-key signed (sideload-installable). To sign with your own key, add the KEYSTORE_BASE64, KEYSTORE_PASSWORD, KEY_ALIAS, and KEY_PASSWORD repository secrets.

Notes

  • Randomized/locally-administered MACs are recommended; spoofing a real OUI you don't own may violate network policy.
  • Changing your MAC can break MAC-filtered network access.

About

Current Android Mac Changers are closed source or do not work on newer devices. This app aims to fix that.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors