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
707 stars 175 forks source link

Building Failed with ReVanced Youtube App #493

Open iExitus opened 4 months ago

iExitus commented 4 months ago

Payload Options

binding issue description

APK Name: YouTube ReVanced Origin: Patched by myself using the Revanced Manager and the stock apk from: https://www.apkmirror.com/apk/google-inc/youtube/youtube-19-04-37-release/youtube-19-04-37-android-apk-download/

Steps to reproduce the behavior:

  1. Click the APK Builder Tab
  2. Tick all Custom Permissions Boxes
  3. Choose the apk from above
  4. Click the bind button
  5. Fails at: 10.2.2024, 17:06:42 [★] Building Ahmyth.apk... 10.2.2024, 17:07:10 [x] Building Failed 10.2.2024, 17:07:11 [¡] Error written to "Building.log" on

Error logs

Error: Command failed: java -jar "C:\Users\yanni\AppData\Local\Programs\AhMyth\resources\app.asar.unpacked\app\Factory\apktool.jar" b "C:\Users\yanni\OneDrive\Desktop\amyth\YouTube ReVanced" -o "C:\Users\yanni\AhMyth\Output\Ahmyth.apk" --use-aapt2 ""
Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Laaak;-><init>(Lbt;Lzyd;Landroid/os/Handler;Lzss;Lczg;Lzhp;Landroid/content/SharedPreferences;Lzkr;Lxlc;Lawkm;Lausj;)V
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1058)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:354)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:309)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:58)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:437)
    at brut.androlib.Androlib.buildSources(Androlib.java:368)
    at brut.androlib.Androlib.build(Androlib.java:320)
    at brut.androlib.Androlib.build(Androlib.java:287)
    at brut.apktool.Main.cmdBuild(Main.java:263)
    at brut.apktool.Main.main(Main.java:82)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x7
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1331)
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1054)
    ... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65664
    at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
    at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:356)
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1291)
    ... 11 more

Error: Command failed: java -jar "C:\Users\yanni\AppData\Local\Programs\AhMyth\resources\app.asar.unpacked\app\Factory\apktool.jar" b "C:\Users\yanni\OneDrive\Desktop\amyth\YouTube ReVanced" -o "C:\Users\yanni\AhMyth\Output\Ahmyth.apk" --use-aapt2 ""
Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Laaak;-><init>(Lbt;Lzyd;Landroid/os/Handler;Lzss;Lczg;Lzhp;Landroid/content/SharedPreferences;Lzkr;Lxlc;Lawkm;Lausj;)V
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1058)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:354)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:309)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:58)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:437)
    at brut.androlib.Androlib.buildSources(Androlib.java:368)
    at brut.androlib.Androlib.build(Androlib.java:320)
    at brut.androlib.Androlib.build(Androlib.java:287)
    at brut.apktool.Main.cmdBuild(Main.java:263)
    at brut.apktool.Main.main(Main.java:82)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x7
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1331)
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1054)
    ... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65663
    at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
    at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:356)
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1291)
    ... 11 more

Error: Command failed: java -jar "C:\Users\yanni\AppData\Local\Programs\AhMyth\resources\app.asar.unpacked\app\Factory\apktool.jar" b "C:\Users\yanni\OneDrive\Desktop\amyth\youtube-revanced_v19.04.37-patches_v4.2.0" -o "C:\Users\yanni\AhMyth\Output\Ahmyth.apk" --use-aapt2 ""
Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method La;->bs(Latkw;)Ljava/lang/Object;
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1058)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:354)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:309)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:58)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:437)
    at brut.androlib.Androlib.buildSources(Androlib.java:368)
    at brut.androlib.Androlib.build(Androlib.java:320)
    at brut.androlib.Androlib.build(Androlib.java:287)
    at brut.apktool.Main.cmdBuild(Main.java:263)
    at brut.apktool.Main.main(Main.java:82)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x35
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1331)
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1054)
    ... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65536
    at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
    at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:356)
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1291)
    ... 11 more

Error: Command failed: java -jar "C:\Users\yanni\AppData\Local\Programs\AhMyth\resources\app.asar.unpacked\app\Factory\apktool.jar" b "C:\Users\yanni\OneDrive\Desktop\amyth\youtube-revanced_v19.04.37-patches_v4.2.0" -o "C:\Users\yanni\AhMyth\Output\Ahmyth.apk" --use-aapt2 ""
Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method La;->bs(Latkw;)Ljava/lang/Object;
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1058)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:354)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:309)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:58)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:437)
    at brut.androlib.Androlib.buildSources(Androlib.java:368)
    at brut.androlib.Androlib.build(Androlib.java:320)
    at brut.androlib.Androlib.build(Androlib.java:287)
    at brut.apktool.Main.cmdBuild(Main.java:263)
    at brut.apktool.Main.main(Main.java:82)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x35
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1331)
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1054)
    ... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65536
    at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
    at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:356)
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1291)
    ... 11 more

Solution

sadly no idea from my side :(

Additional context

i can provide the patched apk if needed

Acknowledgements

Morsmalleo commented 4 months ago

This is due to an unsigned short value out of range: 65536 error, the bound application has surpassed the 64k Dalvik Method by about 536, a smaller bare bones payload for binding should solve this which I'm working on as we speak

iExitus commented 4 months ago

Thanks for the clarification. I'm sorry for not recognizing the unsigned short value out of range error, as I read we should not submit this kind of error.

Have a great week and thank you for your work and time!

Morsmalleo commented 4 months ago

Oh no by all means, any apps that fail to be bound to, please open up a Binding Report about it, even if it's an Unsigned Short Value Out of Range error 😁

Thank you and have a great week also

On Tue, 13 Feb 2024, 5:00 am iExitus, @.***> wrote:

Thanks for the clarification. I'm sorry for not recognizing the unsigned short value out of range error, as I read we should not submit this kind of error.

Have a great week and thank you for your work and time!

— Reply to this email directly, view it on GitHub https://github.com/Morsmalleo/AhMyth/issues/493#issuecomment-1939568861, or unsubscribe https://github.com/notifications/unsubscribe-auth/APK5A2EMO3GQOBT3STKEUDTYTJ7IVAVCNFSM6AAAAABDC2KPBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZZGU3DQOBWGE . You are receiving this because you commented.Message ID: @.***>