Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Question Compiling Decompiling apk problem

OP George Jetson

29th January 2012, 07:07 PM   |  #1  
George Jetson's Avatar
OP Senior Member
Flag Ankara
Thanks Meter: 495
 
756 posts
Join Date:Joined: Feb 2011
More
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?
29th January 2012, 07:58 PM   |  #2  
timvdhoorn's Avatar
Senior Member
Flag Gorinchem
Thanks Meter: 367
 
912 posts
Join Date:Joined: Dec 2011
Quote:
Originally Posted by George Jetson

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...
29th January 2012, 08:56 PM   |  #3  
George Jetson's Avatar
OP Senior Member
Flag Ankara
Thanks Meter: 495
 
756 posts
Join Date:Joined: Feb 2011
More
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)
Last edited by George Jetson; 29th January 2012 at 08:58 PM.
1st February 2012, 03:30 PM   |  #4  
gabwerkz's Avatar
Recognized Contributor
Flag Three Stars and a Sun
Thanks Meter: 1,545
 
1,511 posts
Join Date:Joined: Aug 2011
More
Quote:
Originally Posted by George Jetson

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?
Last edited by gabwerkz; 1st February 2012 at 03:45 PM.
1st February 2012, 04:34 PM   |  #5  
George Jetson's Avatar
OP Senior Member
Flag Ankara
Thanks Meter: 495
 
756 posts
Join Date:Joined: Feb 2011
More
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
1st February 2012, 04:57 PM   |  #6  
gabwerkz's Avatar
Recognized Contributor
Flag Three Stars and a Sun
Thanks Meter: 1,545
 
1,511 posts
Join Date:Joined: Aug 2011
More
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, 335 views)
File Type: apk framework-res.apk - [Click for QR Code] (3.85 MB, 162 views)
Last edited by gabwerkz; 1st February 2012 at 05:12 PM.
The Following 2 Users Say Thank You to gabwerkz For This Useful Post: [ View ]
1st February 2012, 05:27 PM   |  #7  
George Jetson's Avatar
OP Senior Member
Flag Ankara
Thanks Meter: 495
 
756 posts
Join Date:Joined: Feb 2011
More
it works now dude thank you.
1st February 2012, 05:28 PM   |  #8  
gabwerkz's Avatar
Recognized Contributor
Flag Three Stars and a Sun
Thanks Meter: 1,545
 
1,511 posts
Join Date:Joined: Aug 2011
More
Good... happy tweaking bro.
1st February 2012, 05:30 PM   |  #9  
timvdhoorn's Avatar
Senior Member
Flag Gorinchem
Thanks Meter: 367
 
912 posts
Join Date:Joined: Dec 2011
Quote:
Originally Posted by gabwerkz

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
1st February 2012, 05:34 PM   |  #10  
spykedsystem's Avatar
Member
Thanks Meter: 8
 
79 posts
Join Date:Joined: 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

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes