Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Failed with ReVanced Youtube App #493

Open
5 tasks done
iExitus opened this issue Feb 10, 2024 · 3 comments
Open
5 tasks done

Building Failed with ReVanced Youtube App #493

iExitus opened this issue Feb 10, 2024 · 3 comments
Labels
Apktool Error Apktool returned an error Updates Required Updates are required to fix this issue

Comments

@iExitus
Copy link

iExitus commented Feb 10, 2024

Payload Options

  • Activity-method bound payload
  • Boot-method bound payload

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

  • This issue is not a duplicate of an existing binding report.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
@Morsmalleo
Copy link
Owner

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

@Morsmalleo Morsmalleo added Apktool Error Apktool returned an error Updates Required Updates are required to fix this issue labels Feb 11, 2024
@iExitus
Copy link
Author

iExitus commented Feb 12, 2024

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
Copy link
Owner

Morsmalleo commented Feb 12, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apktool Error Apktool returned an error Updates Required Updates are required to fix this issue
Projects
None yet
Development

No branches or pull requests

2 participants