Apktool error while decompiling .apk

I got this error while I decompiled .apk by apktool. Although it does not appear for all apk files. I also installed these three structures:

framework-res.apk SystemUI.apk twframework-res.apk 

I tried two different versions of framework-res.apk but that didn't help. What should I do?

thanks

 I: Baksmaling... Error occured while disassembling class Ldxoptimizer.con; - skipping class java.io.IOException: The parameter is incorrect at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:883) at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:176) at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:49) at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:34) at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:74) at brut.androlib.ApkDecoder.decode(ApkDecoder.java:89) at brut.apktool.Main.cmdDecode(Main.java:146) at brut.apktool.Main.main(Main.java:77) I: Loading resource table... I: Loaded. I: Decoding AndroidManifest.xml with resources... I: Loading resource table from file: C:\Users\ShayanK\apktool\framework\1.apk I: Loaded. W: Could not decode attr value, using undecoded value instead: ns=android, name= hardwareAccelerated, value=0xffffffff W: Could not decode attr value, using undecoded value instead: ns=android, name= hardwareAccelerated, value=0xffffffff W: Could not decode attr value, using undecoded value instead: ns=android, name= hardwareAccelerated, value=0xffffffff I: Regular manifest package... I: Decoding file-resources... W: Could not decode attr value, using undecoded value instead: ns=android, name= exitFadeDuration, value=0x00000190 W: Could not decode attr value, using undecoded value instead: ns=android, name= alpha, value=0x3f333333 W: Could not decode attr value, using undecoded value instead: ns=android, name= previewImage, value=0x7f020001 W: Could not decode attr value, using undecoded value instead: ns=android, name= alpha, value=0x00000000 W: Could not decode attr value, using undecoded value instead: ns=android, name= alpha, value=0x3f000000 W: Could not decode attr value, using undecoded value instead: ns=android, name= alpha, value=0x3f000000 W: Could not decode attr value, using undecoded value instead: ns=android, name= alpha, value=0x3e99999a W: Could not decode attr value, using undecoded value instead: ns=android, name= previewImage, value=0x7f020002 W: Could not decode attr value, using undecoded value instead: ns=android, name= alpha, value=0x3f000000 W: Could not decode attr value, using undecoded value instead: ns=android, name= alpha, value=0x3f000000 W: Could not decode attr value, using undecoded value instead: ns=android, name= showAsAction, value=0x00000000 W: Could not decode attr value, using undecoded value instead: ns=android, name= alpha, value=0x00000000 W: Could not decode attr value, using undecoded value instead: ns=android, name= previewImage, value=0x7f020002 W: Could not decode attr value, using undecoded value instead: ns=android, name= previewImage, value=0x7f020001 I: Decoding values */* XMLs... Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x01030119 at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61) at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:58) at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:54) at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferen ceValue.java:62) at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResRefe renceValue.java:46) at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResSca larValue.java:44) at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(Re sStyleValue.java:48) at brut.androlib.res.data.value.ResBagValue.serializeToResValuesXml(ResB agValue.java:40) at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour ces.java:440) at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:243 ) at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115) at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114) at brut.apktool.Main.cmdDecode(Main.java:146) at brut.apktool.Main.main(Main.java:77) 
+6
source share
1 answer

Firstly, make sure you update apktool to the latest version, you can follow the instructions here to install it.

Then you need to update the framework file. When I tried to decompile some apk file, it will show an error like this

Exception in thread "main" brut.androlib.err.UndefinedResObject: resource specification: 0x01010462

This is because the framework file does not support the latest version of Android, I solved the problem:

  • delete the source framework file mine is in

I: Loading the resource table from the file: /Users/csc/Library/apktool/framework/1.apk

  1. Get the right framework apk

    Take my phone (nexus 5, android 5.1) for exmaple, you can find the apk framework in / system / framework / and it is called framework-res.apk. Using adb pull to copy it to your computer, rename it to 1.apk, copy it to the framework directory.

  2. Please try again and fix the problem.

    here is a detailed tutorial on getting started.

+7
source

Source: https://habr.com/ru/post/970476/


All Articles