Skip to content

[fix] fix Could not decode arsc file build error (#450)#516

Open
linsir6 wants to merge 1 commit intoshwenzhang:masterfrom
linsir6:master
Open

[fix] fix Could not decode arsc file build error (#450)#516
linsir6 wants to merge 1 commit intoshwenzhang:masterfrom
linsir6:master

Conversation

@linsir6
Copy link
Copy Markdown

@linsir6 linsir6 commented Nov 12, 2022

fix build error, when app open aapt custom packageId(--package-id) feature

open custom packageId:

aaptOptions {
        additionalParameters '--allow-reserved-package-id','--package-id','0x15'
}

stacktrace:

com.tencent.mm.androlib.AndrolibException: Could not decode arsc file
  at com.tencent.mm.androlib.res.decoder.ARSCDecoder.write(ARSCDecoder.java:131)
  at com.tencent.mm.androlib.ApkDecoder.decode(ApkDecoder.java:197)
  at com.tencent.mm.resourceproguard.Main.decodeResource(Main.java:114)
  at com.tencent.mm.resourceproguard.Main.resourceProguard(Main.java:98)
  at com.tencent.mm.resourceproguard.Main.resourceProguard(Main.java:84)
  at com.tencent.mm.resourceproguard.cli.CliMain.run(CliMain.java:243)
  at com.tencent.mm.resourceproguard.cli.CliMain.main(CliMain.java:38)
Caused by: java.io.EOFException
  at java.base/java.io.DataInputStream.readFully(DataInputStream.java:202)
  at com.mindprod.ledatastream.LEDataInputStream.readFully(LEDataInputStream.java:180)

cause:
when app open custom packageId, aapt generates more content when generating arsc file than not open custom packageId, so we need read it , and write it to new arsc file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant