首页
社区
课程
招聘
[旧帖] [求助]apktool反编译apk后无法重新编译成功? 0.00雪花
发表于: 2012-12-16 23:13 3446

[旧帖] [求助]apktool反编译apk后无法重新编译成功? 0.00雪花

2012-12-16 23:13
3446
各位大侠求助啊!!!

1. apktool 反编译
apktool.bat d xinlangweibo_V3.2.0.apk xinlang
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Vincent\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...


2. 不做任何修改,rebuild 出错
apktool\apktool.bat b xinlang weibo.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, --min-sdk-version, 4, --target-sdk-vers
ion, 8, -F, C:\Users\Vincent\AppData\Local\Temp\APKTOOL5807298804617258109.tmp,
-I, C:\Users\Vincent\apktool\framework\1.apk, -S, D:\Useful Tools\Apktool\xinlan
g\res, -M, D:\Useful Tools\Apktool\xinlang\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:255)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
        at brut.androlib.Androlib.buildResources(Androlib.java:269)
        at brut.androlib.Androlib.build(Androlib.java:192)
        at brut.androlib.Androlib.build(Androlib.java:174)
        at brut.apktool.Main.cmdBuild(Main.java:188)
        at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 4, --target-sdk-version, 8, -F, C:\Users\Vincent\AppData\Local\Temp\A
PKTOOL5807298804617258109.tmp, -I, C:\Users\Vincent\apktool\framework\1.apk, -S,
 D:\Useful Tools\Apktool\xinlang\res, -M, D:\Useful Tools\Apktool\xinlang\Androi
dManifest.xml]
        at brut.util.OS.exec(OS.java:87)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:253)
        ... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2
, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at brut.util.OS.exec(OS.java:78)
        ... 7 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
e file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(Unknown Source)
        at java.lang.ProcessImpl.start(Unknown Source)
        ... 11 more

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 39
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
将 aapt 工具加入到path, 打包apk时会用到这个android SDK中包含的东西
例如, 在D:\Program Files\android-sdk-windows\platform-tools
2012-12-18 12:36
0
雪    币: 67
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
已经找到原因:最新的1.5.0版本的问题,更加具体的原因没有研究,可能需要参看source code。

1.5.0 编译如下:

D:\apktool1.5.0>apktool.bat b xinlangweibo_V3.2.0 xinlangweibo_V3.2.0.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\arrays.xml:77: error: Found tag reference-array where item is expected
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\public.xml:1659: error: Public symbol array/category_reming_arrsy declare
d here is not defined.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\public.xml:1660: error: Public symbol array/category_reming_arrsy_no_weib
o declared here is not defined.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\public.xml:1662: error: Public symbol array/email_addrs_list declared her
e is not defined.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\public.xml:1661: error: Public symbol array/read_mode_array declared here
 is not defined.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\public.xml:1658: error: Public symbol array/reason_dialog_list declared h
ere is not defined.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\public.xml:1663: error: Public symbol array/search_item_list declared her
e is not defined.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\public.xml:1657: error: Public symbol array/src_dialog_list declared here
 is not defined.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml error: Error retrieving parent for item: No resource found
that matches the given name '@*android:style/Widget.RatingBar'.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml:8: error: Error retrieving parent for item: No resource found
that matches the given name '@*android:style/Theme.Light'.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml:20: error: Error retrieving parent for item: No resource found
 that matches the given name '@*android:style/Widget.CompoundButton.CheckBox'.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml:23: error: Error retrieving parent for item: No resource found
 that matches the given name '@*android:style/Theme.Dialog'.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml:110: error: Error retrieving parent for item: No resource foun
d that matches the given name '@*android:style/Theme.Dialog'.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml:148: error: Error retrieving parent for item: No resource foun
d that matches the given name '@*android:style/Theme'.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml:295: error: Error retrieving parent for item: No resource foun
d that matches the given name '@*android:style/Theme.Dialog'.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml:305: error: Error retrieving parent for item: No resource foun
d that matches the given name '@*android:style/Theme.Dialog'.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml:368: error: Error retrieving parent for item: No resource foun
d that matches the given name '@*android:style/Theme.Dialog'.
D:\apktool1.5.0\xinlangweibo_V3.2.0\res\values\styles.xml:375: error: Error retrieving parent for item: No resource foun
d that matches the given name '@*android:style/Theme.Dialog'.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p,
 --min-sdk-version, 4, --target-sdk-version, 8, -F, C:\Users\Vincent\AppData\Local\Temp\APKTOOL5591788636827363025.tmp,
-I, C:\Users\Vincent\apktool\framework\1.apk, -S, D:\apktool1.5.0\xinlangweibo_V3.2.0\res, -M, D:\apktool1.5.0\xinlangwe
ibo_V3.2.0\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:255)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
        at brut.androlib.Androlib.buildResources(Androlib.java:269)
        at brut.androlib.Androlib.build(Androlib.java:192)
        at brut.androlib.Androlib.build(Androlib.java:174)
        at brut.apktool.Main.cmdBuild(Main.java:188)
        at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 4, --target-sdk-version, 8, -
F, C:\Users\Vincent\AppData\Local\Temp\APKTOOL5591788636827363025.tmp, -I, C:\Users\Vincent\apktool\framework\1.apk, -S,
 D:\apktool1.5.0\xinlangweibo_V3.2.0\res, -M, D:\apktool1.5.0\xinlangweibo_V3.2.0\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:83)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:253)
        ... 6 more


而1.4.10 版本,正常编译:
D:\>cd apktool1.4.10

D:\apktool1.4.10>apktool.bat d xinlangweibo_V3.2.0.apk xinlangweibo_V3.2.0
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Vincent\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

D:\apktool1.4.10>apktool.bat b xinlangweibo_V3.2.0 xinlangweibo_V3.2.0.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs...
I: Building apk file...
2012-12-19 01:07
0
游客
登录 | 注册 方可回帖
返回
//