ThexXTURBOXx / dex2jar

Tools to work with android .dex and java .class files
Apache License 2.0
229 stars 57 forks source link

dex2jar only includes class files in the converted jar #31

Open AriaMoradi opened 1 year ago

AriaMoradi commented 1 year ago

I have this apk: tachiyomi-zh.copymanga-v1.3.48.zip

The contents are:

$ unzip tachiyomi-zh.copymanga-v1.3.48.apk 
Archive:  tachiyomi-zh.copymanga-v1.3.48.apk
  inflating: META-INF/com/android/build/gradle/app-metadata.properties  
  inflating: classes.dex             
  inflating: kotlin-tooling-metadata.json  
  inflating: simp.txt                
  inflating: simplified.txt          
  inflating: AndroidManifest.xml     
 extracting: res/CG.png              
 extracting: res/D2.png              
 extracting: res/SD.png              
 extracting: res/jy.png              
 extracting: res/u3.png              
 extracting: resources.arsc          
  inflating: META-INF/CERT.SF        
  inflating: META-INF/CERT.RSA       
  inflating: META-INF/MANIFEST.MF 

Part of the code inside the apk is using this library: https://github.com/luhuiguo/chinese-utils/blob/master/src/main/java/com/luhuiguo/chinese/Converter.java#L49 and the stacktrace is available at https://github.com/Suwayomi/Tachidesk-Server/issues/512#issue-1610060514

That library requires to load resource file /simp.txt or /simplified.txt but these are not included in the converted jar.

We are converting dex2jar via this function: https://github.com/Suwayomi/Tachidesk-Server/blob/master/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/util/PackageTools.kt#L53

Is there something we can do to make dex2jar include non-class files as well?

ThexXTURBOXx commented 1 year ago

I don't think, it's possible as of now. A short workaround would be to either use APKTool for that (if some of them are encoded, such as AndroidManifest.xml) or just unzipping them using Java APIs for that, such as ZipOutputStream