Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,772,636 Members 53,270 Now Online
XDA Developers Android and Mobile Development Forum

Compiling Decompiling apk problem

Tip us?
 
George Jetson
Old
#1  
George Jetson's Avatar
Senior Member - OP
Thanks Meter 493
Posts: 745
Join Date: Feb 2011
Location: Ankara
Question Compiling Decompiling apk problem

Hi everyone
I have a problem compiling and decompiling apks.
Firstly im using zeus v2.1 rom and i take framework-res.apk and systemui.apk.
Then I put this apks to apk manager 5.0 file and decompile with apk manager.And I dont touch and dont modify any files and I open again apk manager and choose compile option.Than apk manager gives error.Why it giving error i dont touching or modifying any files.Also Im opening apk files with winrar and want to put any files to inside winrar gives error broken archive.But these same apk's when i put them in the phone it works normally.Where is the wrong?


Huawei G610
 
timvdhoorn
Old
#2  
timvdhoorn's Avatar
Senior Member
Thanks Meter 362
Posts: 875
Join Date: Dec 2011
Location: Gorinchem
Quote:
Originally Posted by George Jetson View Post
Hi everyone
I have a problem compiling and decompiling apks.
Firstly im using zeus v2.1 rom and i take framework-res.apk and systemui.apk.
Then I put this apks to apk manager 5.0 file and decompile with apk manager.And I dont touch and dont modify any files and I open again apk manager and choose compile option.Than apk manager gives error.Why it giving error i dont touching or modifying any files.Also Im opening apk files with winrar and want to put any files to inside winrar gives error broken archive.But these same apk's when i put them in the phone it works normally.Where is the wrong?
it is a little easyer if you post the LOG...

GOOGLE NEXUS 4 16GB
AOSPA 4.2 BETA3
FRANCO.KERNEL R204 SABERMOD
 
George Jetson
Old
(Last edited by George Jetson; 29th January 2012 at 07:58 PM.)
#3  
George Jetson's Avatar
Senior Member - OP
Thanks Meter 493
Posts: 745
Join Date: Feb 2011
Location: Ankara
here is the latest log

Code:
|29.01.2012 -- 21:57:25,15| 
-------------------------------------------------------------------------- 
--2012-01-29 21:57:25--  http://dl.dropbox.com/u/14513610/apkver.txt
Resolving dl.dropbox.com... 107.20.134.231, 107.20.132.92, 107.20.234.233, ...
Connecting to dl.dropbox.com|107.20.134.231|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31 [text/plain]
Saving to: `apkver.txt'

     0K                                                       100%  692K=0s

2012-01-29 21:57:25 (692 KB/s) - `apkver.txt' saved [31/31]

projects alt dizini ya da dosyas¨ halen var.
place-apk-here-for-modding alt dizini ya da dosyas¨ halen var.
place-ogg-here alt dizini ya da dosyas¨ halen var.
place-apk-here-to-batch-optimize alt dizini ya da dosyas¨ halen var.
place-apk-here-for-signing alt dizini ya da dosyas¨ halen var.
projects alt dizini ya da dosyas¨ halen var.
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)
'adb' i‡ ya da d¨Ÿ komut, ‡al¨Ÿt¨r¨labilir
program ya da toplu iŸ dosyas¨ olarak tan¨nm¨yor.
I: Checking whether sources has changed...
I: Smaling...
C:\Users\cd555obx\Desktop\Apk Manager\other\..\projects\SystemUI.apk\smali\com\android\systemui\statusbar\AnimatedImageView.smali[0,0] No enum constant org.jf.dexlib.AnnotationVisibility.RUNTİME
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: java.io.FileInputStream@de6570
	at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
	at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
	at brut.androlib.src.SmaliBuilder.buildFile(Unknown Source)
	at brut.androlib.src.SmaliBuilder.build(Unknown Source)
	at brut.androlib.src.SmaliBuilder.build(Unknown Source)
	at brut.androlib.Androlib.buildSourcesSmali(Unknown Source)
	at brut.androlib.Androlib.buildSources(Unknown Source)
	at brut.androlib.Androlib.build(Unknown Source)
	at brut.androlib.Androlib.build(Unknown Source)
	at brut.apktool.Main.cmdBuild(Unknown Source)
	at brut.apktool.Main.main(Unknown Source)


Huawei G610
 
gabwerkz
Old
(Last edited by gabwerkz; 1st February 2012 at 02:45 PM.)
#4  
gabwerkz's Avatar
Recognized Contributor
Thanks Meter 1545
Posts: 1,511
Join Date: Aug 2011
Location: Three Stars and a Sun
Quote:
Originally Posted by George Jetson View Post
here is the latest log

Code:
|29.01.2012 -- 21:57:25,15| 
-------------------------------------------------------------------------- 
--2012-01-29 21:57:25--  http://dl.dropbox.com/u/14513610/apkver.txt
Resolving dl.dropbox.com... 107.20.134.231, 107.20.132.92, 107.20.234.233, ...
Connecting to dl.dropbox.com|107.20.134.231|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31 [text/plain]
Saving to: `apkver.txt'

     0K                                                       100%  692K=0s

2012-01-29 21:57:25 (692 KB/s) - `apkver.txt' saved [31/31]

projects alt dizini ya da dosyas¨ halen var.
place-apk-here-for-modding alt dizini ya da dosyas¨ halen var.
place-ogg-here alt dizini ya da dosyas¨ halen var.
place-apk-here-to-batch-optimize alt dizini ya da dosyas¨ halen var.
place-apk-here-for-signing alt dizini ya da dosyas¨ halen var.
projects alt dizini ya da dosyas¨ halen var.
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)
'adb' i‡ ya da d¨Ÿ komut, ‡al¨Ÿt¨r¨labilir
program ya da toplu iŸ dosyas¨ olarak tan¨nm¨yor.
I: Checking whether sources has changed...
I: Smaling...
C:\Users\cd555obx\Desktop\Apk Manager\other\..\projects\SystemUI.apk\smali\com\android\systemui\statusbar\AnimatedImageView.smali[0,0] No enum constant org.jf.dexlib.AnnotationVisibility.RUNTİME
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: java.io.FileInputStream@de6570
	at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
	at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
	at brut.androlib.src.SmaliBuilder.buildFile(Unknown Source)
	at brut.androlib.src.SmaliBuilder.build(Unknown Source)
	at brut.androlib.src.SmaliBuilder.build(Unknown Source)
	at brut.androlib.Androlib.buildSourcesSmali(Unknown Source)
	at brut.androlib.Androlib.buildSources(Unknown Source)
	at brut.androlib.Androlib.build(Unknown Source)
	at brut.androlib.Androlib.build(Unknown Source)
	at brut.apktool.Main.cmdBuild(Unknown Source)
	at brut.apktool.Main.main(Unknown Source)

"projects\SystemUI.apk\smali\com\android\systemui\ statusbar\AnimatedImageView.smali"

and

"C:\Users\cd555obx\Desktop\Apk Manager\other"

Why in OTHER folder? I think I'ved used apk manager once and it wasn't far from what i use now. normaly, we put the apk in "place-apk-here-for-modding" folder.

Also this lines, why does it has dropbox in it?

Code:
|29.01.2012 -- 21:57:25,15| 
-------------------------------------------------------------------------- 
--2012-01-29 21:57:25--  http://dl.dropbox.com/u/14513610/apkver.txt
Resolving dl.dropbox.com... 107.20.134.231, 107.20.132.92, 107.20.234.233, ...
Connecting to dl.dropbox.com|107.20.134.231|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31 [text/plain]
Saving to: `apkver.txt'
Try the one/link I posted earlier, easy to use.

EDIT:
Saw your post in my thread. You touched the SMALI and wanted to remove time?
 
George Jetson
Old
#5  
George Jetson's Avatar
Senior Member - OP
Thanks Meter 493
Posts: 745
Join Date: Feb 2011
Location: Ankara
I deleted all apk manager files on my computer and install new apk manager than I clean my temp and users file.Now I try decompile framework apk its ok decompiled success.But I compile framework(do not touch or modify anything) that gives error here is new log.

Code:
-------------------------------------------------------------------------- 
|01.02.2012 -- 16:31:47,27| 
-------------------------------------------------------------------------- 
--2012-02-01 16:31:47--  http://update.apkmultitool.com/apkver.txt
Resolving update.apkmultitool.com (update.apkmultitool.com)... 199.59.62.20
Connecting to update.apkmultitool.com (update.apkmultitool.com)|199.59.62.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 152 [text/plain]
Saving to: `apkver.txt'

     0K                                                       100% 1,81M=0s

2012-02-01 16:31:47 (1,81 MB/s) - `apkver.txt' saved [152/152]

projects alt dizini ya da dosyas¨ halen var.
place-apk-here-for-modding alt dizini ya da dosyas¨ halen var.
place-ogg-here alt dizini ya da dosyas¨ halen var.
place-apk-here-to-batch-optimize alt dizini ya da dosyas¨ halen var.
place-apk-here-for-signing alt dizini ya da dosyas¨ halen var.
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
Sistem belirtilen yolu bulam¨yor.
Sistem belirtilen yolu bulam¨yor.
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\cd555obx\AppData\Local\Temp\APKTOOL3621473068753514816.tmp, -x, -S, C:\apkman\projects\framework-res.apk\res, -M, C:\apkman\projects\framework-res.apk\AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
	at brut.androlib.Androlib.buildResources(Androlib.java:248)
	at brut.androlib.Androlib.build(Androlib.java:171)
	at brut.androlib.Androlib.build(Androlib.java:154)
	at brut.apktool.Main.cmdBuild(Main.java:182)
	at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\cd555obx\AppData\Local\Temp\APKTOOL3621473068753514816.tmp, -x, -S, C:\apkman\projects\framework-res.apk\res, -M, C:\apkman\projects\framework-res.apk\AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:87)
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
	... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2, Sistem belirtilen dosyay? bulam?yor
	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, Sistem belirtilen dosyay? bulam?yor
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	... 11 more


Huawei G610
 
gabwerkz
Old
(Last edited by gabwerkz; 1st February 2012 at 04:12 PM.)
#6  
gabwerkz's Avatar
Recognized Contributor
Thanks Meter 1545
Posts: 1,511
Join Date: Aug 2011
Location: Three Stars and a Sun
I never had errors like that. Only if I made a mistake editing xml's, and it logs clearly where i've gone wrong. it must be the tool you use to decompile. What version is it? And is the APk you are trying to decompile deodexed?

I have Android SDK and Java installed. I will upload the one i use to decompile, try it.

I will attach as well a compiled but untouched framework-res from Zeus v2.1. See if you can compile/decompile it as I do. If not, you're missing something. The tool itself, java, or ASDK.
Attached Files
File Type: zip Apk_Multi-Tool_Alpha_02.zip - [Click for QR Code] (6.06 MB, 331 views)
File Type: apk framework-res.apk - [Click for QR Code] (3.85 MB, 160 views)
The Following 2 Users Say Thank You to gabwerkz For This Useful Post: [ Click to Expand ]
 
George Jetson
Old
#7  
George Jetson's Avatar
Senior Member - OP
Thanks Meter 493
Posts: 745
Join Date: Feb 2011
Location: Ankara
it works now dude thank you.


Huawei G610
 
gabwerkz
Old
#8  
gabwerkz's Avatar
Recognized Contributor
Thanks Meter 1545
Posts: 1,511
Join Date: Aug 2011
Location: Three Stars and a Sun
Good... happy tweaking bro.
 
timvdhoorn
Old
#9  
timvdhoorn's Avatar
Senior Member
Thanks Meter 362
Posts: 875
Join Date: Dec 2011
Location: Gorinchem
Quote:
Originally Posted by gabwerkz View Post
I never had errors like that. Only if I made a mistake editing xml's, and it logs clearly where i've gone wrong. it must be the tool you use to decompile. What version is it? And is the APk you are trying to decompile deodexed?

I have Android SDK and Java installed. I will upload the one i use to decompile, try it.

I will attach as well a compiled but untouched framework-res from Zeus v2.1. See if you can compile/decompile it as I do. If not, you're missing something. The tool itself, java, or ASDK.
how do i install that android sdk? i think thats the problem why its not compiling

GOOGLE NEXUS 4 16GB
AOSPA 4.2 BETA3
FRANCO.KERNEL R204 SABERMOD
 
spykedsystem
Old
#10  
spykedsystem's Avatar
Member
Thanks Meter 8
Posts: 79
Join Date: Nov 2011
I had those errors even when I had everything installed.However I noticed it doesn't happen with untouched APKs...so if you try to decompile and compile the framework-res.apk from Redy's v20N package it will work but if you try to do that with the Zeus framework it will give those errors even if you don't modify it,just my 2 cents on what I experienced

EDIT: Also tried the manual version using CMD with apktool..same errors

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes