wting / android-apktool

Automatically exported from code.google.com/p/android-apktool
8 stars 8 forks source link

java.lang.ClassCastException #329

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" java.lang.ClassCastException: 
brut.androlib.res.data.value.ResFileValue cannot be cast to 
brut.androlib.res.data.value.ResScalarValue
    at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.java:209)
    at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:177)
    at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165)
    at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:105)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
    at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:315)
    at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:50)
    at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
    at brut.androlib.Androlib.getResTable(Androlib.java:44)
    at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
    at brut.apktool.Main.cmdDecode(Main.java:128)
    at brut.apktool.Main.main(Main.java:65)

What version of the product are you using? On what operating system?
apktool v1.43 on win7

Original issue reported on code.google.com by kk4...@gmail.com on 19 May 2012 at 2:31

Attachments:

GoogleCodeExporter commented 9 years ago
I had the same problem.

Java : build 1.6.0_33-b03
Operating system : Windows XP 32bit
Apktool : 1.4.3

I: Baksmaling...
I: Loading resource table...
Exception in thread "main" java.lang.ClassCastException: 
brut.androlib.res.data.value.ResFileValue cannot be cast to 
brut.androlib.res.data.value.ResScalarValue

        at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.java:209)
        at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:177)

        at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165)
        at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
        at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
5)
        at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
        at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:315)
        at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:50)
        at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
        at brut.androlib.Androlib.getResTable(Androlib.java:44)
        at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
        at brut.apktool.Main.cmdDecode(Main.java:128)
        at brut.apktool.Main.main(Main.java:65)

Original comment by ckrose0...@gmail.com on 11 Jul 2012 at 1:48

GoogleCodeExporter commented 9 years ago
Can you attach the APK & associated frameworks?

Original comment by connor.tumbleson on 16 Nov 2012 at 1:02

GoogleCodeExporter commented 9 years ago
Issue 289 has been merged into this issue.

Original comment by connor.tumbleson on 17 Nov 2012 at 6:29

GoogleCodeExporter commented 9 years ago
I have ocuured the same problme,detail:
java.lang.ClassCastException: brut.androlib.res.data.value.ResFileValue cannot 
be cast to brut.androlib.res.data.value.ResScalarValue
    at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.java:210)
    at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:178)
    at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:166)
    at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:131)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:106)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:40)
    at com.justsy.eas.util.AndroidArsc.updateResPackage(AndroidArsc.java:48)
    at com.justsy.eas.util.AndroidArsc.<init>(AndroidArsc.java:33)
    at com.justsy.util.FileUploadUtil.apkUnZip1(FileUploadUtil.java:545)
    at com.justsy.middleclass.ApkDo.uploadApk(ApkDo.java:158)
    at com.justsy.middleclass.ApkDo.FileUpload(ApkDo.java:32)
    at com.justsy.fileupload.servlet.Upload.doPost(Upload.java:65)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.justsy.eas.filter.EncodingFilter.doFilter(EncodingFilter.java:37)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
    at java.lang.Thread.run(Thread.java:662)

Original comment by akwolfJ...@gmail.com on 6 Dec 2012 at 2:42

Attachments:

GoogleCodeExporter commented 9 years ago
I can duplicate.

Original comment by connor.tumbleson on 4 May 2013 at 7:49

GoogleCodeExporter commented 9 years ago
any fix method please?thanks very much!

Original comment by moto2...@gmail.com on 5 May 2013 at 6:13

GoogleCodeExporter commented 9 years ago
Do you have solution to this issue?

Original comment by duan2...@gmail.com on 28 Oct 2013 at 3:01

GoogleCodeExporter commented 9 years ago
I also  have this problem!   
root@c7:~/sogou# java -jar ./apktool.jar d -f -s --keep-broken-res 
SogouInput_37050_tg_ff_datang1_20131008.apk   tmp/
I: Copying raw classes.dex file...
I: Loading resource table...
Exception in thread "main" java.lang.ClassCastException: 
brut.androlib.res.data.value.ResFileValue cannot be cast to 
brut.androlib.res.data.value.ResScalarValue
    at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.java:214)
    at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:182)
    at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:170)
    at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:135)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:110)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
    at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)
    at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
    at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
    at brut.androlib.Androlib.getResTable(Androlib.java:50)
    at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
    at brut.apktool.Main.cmdDecode(Main.java:146)
    at brut.apktool.Main.main(Main.java:77)
root@c7:~/sogou# uname  -a
Linux ubuntu 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux  

apktool 1.5.2  

Does  someone have solution to this issue?  thanks!

Original comment by xiaso...@gmail.com on 4 Nov 2013 at 8:09

GoogleCodeExporter commented 9 years ago
I have same problem,too!

I: Baksmaling...
I: Loading resource table...
Exception in thread "main" java.lang.ClassCastException: 
brut.androlib.res.data.value.ResFileValue cannot be cast to 
brut.androlib.res.data.value.ResScalarValue
    at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.java:214)
    at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:182)
    at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:170)
    at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:135)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:110)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
    at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)
    at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
    at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
    at brut.androlib.Androlib.getResTable(Androlib.java:50)
    at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
    at brut.apktool.Main.cmdDecode(Main.java:146)
    at brut.apktool.Main.main(Main.java:77)

Original comment by dpwn...@gmail.com on 23 Jul 2014 at 6:21

GoogleCodeExporter commented 9 years ago
Issue 667 has been merged into this issue.

Original comment by connor.tumbleson on 12 Aug 2014 at 12:14

GoogleCodeExporter commented 9 years ago

Original comment by connor.tumbleson on 2 Oct 2014 at 7:16

GoogleCodeExporter commented 9 years ago
https://github.com/iBotPeaches/Apktool/commit/4882396163f978884256e008fc7fae9201
f156b4

Original comment by connor.tumbleson on 26 Dec 2014 at 2:09