This document describes the step-by-step process for extracting, modifying, and rebuilding the Atag One Android APK, including replacing specific classes (UdpReceive, UdpSwitcher, and GetSSID).
This guide documents the process of modifying and rebuilding the Atag One Android app to restore compatibility with modern Android versions. The official Atag One app no longer functions correctly on recent Android releases due to changes in network permissions and stricter background operation policies. Specifically, the app fails to properly receive UDP multicast packets — which are essential for device discovery and communication — because it does not acquire the necessary Wi-Fi multicast lock or release it properly when no longer needed.
To resolve this, we decompile the APK, modify several internal classes (UdpReceive, UdpSwitcher, and GetSSID), and reinsert them into the original app. The purpose of this project is not to rebuild or run the app from scratch, but rather to use a minimal Android project setup with Cordova as a compile environment to generate updated .class files. These are then converted to smali code and used to replace the original ones in the APK before repackaging and signing it for installation.
The workflow includes:
- Apktool for decompiling and rebuilding the APK.
- Jadx-GUI to inspect the original Java code.
- Android Studio / D8 / Baksmali to recompile modified classes to .dex and smali.
- ADB to extract, uninstall, and reinstall the app on a device.
- Apksigner to sign the modified APK for deployment.
This process provides a way to patch and restore functionality to legacy apps that are no longer maintained, without access to their original source code.
Before modifying the app, pull the currently installed version from your device using ADB. You may want to upgrade to the latest version from the Play Store first.
-
Find the package path:
adb shell pm path io.cordova.AtagUser
Example output:
package:/data/app/~~v8RqpqFv9gxt/io.cordova.AtagUser-7v3r7u7g7q7g==/base.apk -
Pull the APK to your PC:
adb pull /data/app/~~v8RqpqFv9gxt/io.cordova.AtagUser-7v3r7u7g7q7g==/base.apk atag-one.apk
You now have
atag-one.apklocally for decompiling.
Remove the currently installed version from your Android device:
adb uninstall io.cordova.AtagUserUse Apktool to extract resources, Smali code, and the manifest:
apktool d atag-one.apk -o atag-one-srcUse JADX-GUI to browse the original APK and locate the following Java classes:
io.cordova.AtagUser.UdpReceiveio.cordova.AtagUser.UdpSwitcherio.cordova.AtagUser.GetSSID
These are the classes you’ll modify and rebuild.
NOTE: included in current project
NOTE: This is the current repository. Not needed if you just do a check out. Adjusted classes are included inside this project.
-
Create a new Android application project.
-
Add Cordova as a transitive dependency using the
compileOnlydirective in yourbuild.gradle:dependencies { compileOnly "org.apache.cordova:framework:13.0.0" }
This ensures Cordova APIs are available for compilation but are not bundled into your final build (matching the structure of the original APK).
-
Add your three target classes (
UdpReceive,UdpSwitcher,GetSSID) to the project. -
Make your desired modifications.
Build the Android project and copy all generated .class files (including inner classes) to a working folder, e.g. test/.
The output .class files can be found in:
[projectdirectory]\app\build\intermediates\javac\debug\compileDebugJavaWithJavac\classes\io\cordova\AtagUser
Example structure:
test/
├── GetSSID.class
├── UdpReceive.class
├── UdpReceive$1.class
├── UdpReceive$2.class
├── UdpReceive$3.class
├── UdpSwitcher.class
├── UdpSwitcher$1.class
└── UdpSwitcher$2.class
Convert the compiled .class files to .dex format using d8, then disassemble the .dex file to Smali using baksmali:
d8 test/GetSSID.class test/UdpReceive$1.class test/UdpReceive.class test/UdpReceive$2.class test/UdpReceive$3.class test/UdpSwitcher.class test/UdpSwitcher$1.class test/UdpSwitcher$2.class --output test/
java -jar baksmali-3.0.9-fat-release.jar disassemble test/classes.dex -o smali_out/Copy the generated Smali files from:
smali_out/io/cordova/AtagUser/
into the corresponding folder inside your decompiled APK source:
atag-one-src/smali/io/cordova/AtagUser/
Overwrite the existing ones.
If your modified classes require new permissions (e.g. network or Wi-Fi access), add them under the <manifest> section in:
atag-one-src/AndroidManifest.xml
Example:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.INTERNET" />Recompile your project back into an installable APK:
apktool b atag-one-src -o atag-one-multicast.apkUse Android’s apksigner to sign your rebuilt APK (using the debug keystore in this example):
"apksigner sign --ks "%USERPROFILE%\.android\debug.keystore" ^
--ks-key-alias androiddebugkey ^
--ks-pass pass:android ^
--key-pass pass:android ^
--out atag-one-signed.apk ^
atag-one-multicast.apkDeploy it to your connected Android device:
adb install -r atag-one-signed.apk| Tool | Purpose | Download Link |
|---|---|---|
| Apktool | Decompile and rebuild APKs | https://github.com/iBotPeaches/Apktool/releases |
| JADX-GUI | View Java source and class hierarchy | https://github.com/skylot/jadx/releases |
| d8 | Converts .class files to .dex |
Part of Android SDK Build Tools (in build-tools/<version>/d8.bat) |
| baksmali | Disassembles .dex into Smali |
https://github.com/JesusFreke/smali/releases |
| apksigner | Signs APKs for installation | Part of Android SDK Build Tools |
| adb | Install/uninstall and debug on devices | https://developer.android.com/tools/releases/platform-tools |
- Always uninstall the existing app before reinstalling a modified APK to avoid signature conflicts.
- Backup your
atag-one-srcfolder before replacing any Smali files. compileOnlyensures dependencies like Cordova are available at compile-time but not packaged in the final APK.
🎉 Final Result:
You now have a rebuilt, signed, and installed atag-one-signed.apk with your modified Cordova plugin classes successfully integrated.
- Repackaging the APK currently causes some issues with the UI of the app. For example, the UI elements seem slightly larget than usual.