Morsmalleo / AhMyth

Cross-Platform Android Remote Administration Tool | Official maintained repository for the AhMyth R.A.T Project | A dedicated revival of the original repository at https://GitHub.com/AhMyth/AhMyth-Android-RAT
GNU General Public License v3.0
714 stars 177 forks source link

Standalone Payload APK | Building Failed - Windows 10 #182

Closed rzg0ld3n closed 1 year ago

rzg0ld3n commented 1 year ago

This is an issue with the

Describe the bug

Standalone APK Payloads fail to build.

To Reproduce

Steps to reproduce the behavior:

  1. launch AhMyth
  2. Navigate to the APK Builder tab
  3. Input the Server IP and Port number
  4. Click the Red ⚑ | Build button
  5. See the Building Failed error!

Expected behavior

Standalone Payloads should build without any problems whatsoever.

Logs

Error: Command failed: java -jar "D:\AhMyth-master\AhMyth-server\app\app\Factory\apktool.jar" b "D:\AhMyth-master\AhMyth-server\app\app\Factory\Ahmyth" -o "C:\Users\Usuario\AhMyth\Output\Ahmyth.apk"
W: D:\AhMyth-master\AhMyth-server\app\app\Factory\Ahmyth\AndroidManifest.xml:1: error: No resource identifier found for attribute 'compileSdkVersion' in package 'android'
W: 
W: D:\AhMyth-master\AhMyth-server\app\app\Factory\Ahmyth\AndroidManifest.xml:1: error: No resource identifier found for attribute 'compileSdkVersionCodename' in package 'android'
W: 
W: D:\AhMyth-master\AhMyth-server\app\app\Factory\Ahmyth\AndroidManifest.xml:3: error: No resource identifier found for attribute 'appComponentFactory' in package 'android'
W: 
W: D:\AhMyth-master\AhMyth-server\app\app\Factory\Ahmyth\AndroidManifest.xml:3: error: No resource identifier found for attribute 'requestLegacyExternalStorage' in package 'android'
W: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Usuario\AppData\Local\Temp\brut_util_Jar_87413819326590425484757727410613639632.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 22, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, C:\Users\Usuario\AppData\Local\Temp\APKTOOL11673515462252475372.tmp, -e, C:\Users\Usuario\AppData\Local\Temp\APKTOOL10365649841591437502.tmp, -0, arsc, -I, C:\Users\Usuario\AppData\Local\apktool\framework\1.apk, -S, D:\AhMyth-master\AhMyth-server\app\app\Factory\Ahmyth\res, -M, D:\AhMyth-master\AhMyth-server\app\app\Factory\Ahmyth\AndroidManifest.xml]

OS Information

please complete the following information:

Checklist

Morsmalleo commented 1 year ago

Let's try the first fix.

Open up your command prompt or PowerShell and CD into the the AhMyth directory stated below

cd AhMyth\AhMyth-Server\app\app\Factory

Once you've entered this directory let me know πŸ™‚

rzg0ld3n commented 1 year ago

Alright, I'm in the directory, what now? :P

Morsmalleo commented 1 year ago

Ok so the first fix we're gonna try is Emptying the Apktool framework directory which is done easily with a simple little command.

java -jar apktool.jar empty-framework-dir

Run this command and let me know once you're done

Morsmalleo commented 1 year ago

Just as a precaution you'll want to run this command as well, it's the same command as above, but with the --force flag added just incase it missed anything with the first command

java -jar apktool.jar empty-framework-dir --force
rzg0ld3n commented 1 year ago

Done:

PS D:\AhMyth\AhMyth-Server\app\app\Factory> java -jar apktool.jar empty-framework-dir
I: Removing 1.apk framework file...
PS D:\AhMyth\AhMyth-Server\app\app\Factory> java -jar apktool.jar empty-framework-dir --force
W: Can't empty framework directory, no file found at: C:\Users\Usuario\AppData\Local\apktool\framework\1.apk
Morsmalleo commented 1 year ago

Awesome the second command output lets me know that the first command ran successfully, ok launch AhMyth and try and build a standalone APK once again

rzg0ld3n commented 1 year ago

It worked now, thank you so much! πŸ˜„ https://ibb.co/Q9bFhbn

Morsmalleo commented 1 year ago

It worked now, thank you so much! πŸ˜„ https://ibb.co/Q9bFhbn

You are most welcome 😁😁

Morsmalleo commented 1 year ago

I will be building an integration for AhMyth so that before we start building any Payload APK, the Apktool framework directory will automatically be emptied before any building occurs, this will reduce building failed errors on windows quite a lot, will write here once it's done