So you want to edit xml's or more... an ADB. APK Manager How-To (Basics)

Joined
Feb 10, 2011
Messages
110
Reaction score
0
Location
Las Vegas
Okay I get it for the most part but I just don't know if when you are typing in the variable value is it supposed to be "Program Files" or "ProgramFiles"?

Sent from my M860 using DroidForums App

I just copied and pasted the path, but it needs to be "Program Files". You are in Windows, right?

Oh that's much better than what I did, i don't know why I didn't think of just pasting.. Damn I'm an idiot haha. And yeah I'm on windows. I'm pretty sure I got it set up the right way now but for some reason my command prompt doesn't just say "C:\" it has some things after that. (I know that's not a problem involving android)

Sent from my M860 using DroidForums App
 

powder

Member
Joined
Dec 29, 2009
Messages
73
Reaction score
0
Location
the evergreen state
Question for anyone that can help. I'm trying to compile a new theme chooser theme. Literally all i did is change the name of Cyanbread.apk in cm7. It compiles fine and it runs, shows up in theme chooser, everything. However, the minute i try to add redirects to new icons and stuff, it gives me an error.

'mode' is not recognized as an internal or external command,
operable program or batch file.
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)
'adb' is not recognized as an internal or external command,
operable program or batch file.
I: Checking whether sources has changed...
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\MATTAN~1\AppData\Local\Temp\APKTOOL403800 3544011172934.tmp, -x, -I, C:\Users\Matt and Alex\apktool\framework\1.apk, -S, C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res, -M, C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\AndroidManif est.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Un known Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(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)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\MATTAN~1\AppData\Local\Temp\APKTOOL403800 3544011172934.tmp, -x, -I, C:\Users\Matt and Alex\apktool\framework\1.apk, -S, C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res, -M, C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\AndroidManif est.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more
C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res\values\p ublic.xml:172: error: Public symbol drawable/com_android_providers_calendar_appwidget_bg declared here is not defined.
C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res\values\p ublic.xml:178: error: Public symbol drawable/com_android_quicksearchbox_corpus_indicator_bg_nor mal declared here is not defined.
C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res\values\p ublic.xml:177: error: Public symbol drawable/com_android_quicksearchbox_google_icon declared here is not defined.
C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res\values\p ublic.xml:440: error: Public entry identifier 0xa0201b6 entry index is larger than available symbols (index 438, total symbols 438).
C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res\values\p ublic.xml:440: error: Public symbol drawable/frameworks_res_checkbox_on_background declared here is not defined.
C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res\values\p ublic.xml:441: error: Public entry identifier 0xa0201b7 entry index is larger than available symbols (index 439, total symbols 438).
C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res\values\p ublic.xml:441: error: Public symbol drawable/frameworks_res_rate_star_med_half declared here is not defined.
C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res\values\p ublic.xml:442: error: Public entry identifier 0xa0201b8 entry index is larger than available symbols (index 440, total symbols 438).
C:\All android\Android stuff\apk manager\other\..\projects\Skyblue.apk\res\values\p ublic.xml:442: error: Public symbol drawable/frameworks_res_rate_star_med_on declared here is not defined.

Anyone know what this is all about? Cannot execute aapt?
 

10tonhammr

New Member
Joined
Mar 2, 2011
Messages
1
Reaction score
0
framework-res.apk resources.arsc

I'm having a problem with the resources.arsc file I'm editing for the framework-res.apk for a theme I've been working on. I've never had any trouble editing xml files before, but this is driving me nuts. I'm trying to change system text color to red.

-The framework-res.apk decompiles correctly, no patch9 errors
- I make the changes to the styles.xml and colors.xml files in the values folder. All I'm doing is changing hex code color values, nothing else.
-I compile the framework-res.apk, again no errors.
-system apk? "y"
-copy over files you didnt modify? "y"
-delete the resources.arsc file from the Keep Folder
-Go back to the script and press enter
-Everything is OK

When I drop the apk into my theme.zip and flash, it bootloops. Everything else works perfectly fine. Its just when I try and make changes to the resources.arsc file.

When I look at the outputted framework-res.apk and compare it to the original, the AndroidManifest.xml and the Resources.arsc files are the same size, but the packed sized is drastically smaller for both files in the new edited framework-res.apk.

Original
AndroidManifest.xml size: 50,480 packed: 50,480
Resources.arsc size: 3,358,508 packed: 3,358,508

New
AndroidManifest.xml size: 50,480 packed: 7,797
Resources.arsc size: 3,358,508 packed: 804,358

Obviously its not repacking all of the files, but I have no idea why. Any advice would be greatly appreciated!
 
Last edited:

Prashanth

New Member
Joined
Mar 4, 2011
Messages
12
Reaction score
0
I am using apk_manager_4.9 I am getting the Xml files so that i can modify but i am unable to edit my src files..It is not there...instead it is there with .smali...

---I want to Know how to edit my source file using Java.
---What is Smali.
 
Last edited:

stetsonaw

Beta Team/Marty McFly
Premium Member
Theme Developer
Joined
Jun 16, 2010
Messages
2,317
Reaction score
0
Location
Bellevue, NE
Website
www.flickr.com
You talking about the resources.arsc? Those xmls make up the values folder under res. And smalis are what make up classes.dex. those rarely need changing for theming, except in the case of GMail, at least from what I've found.

Sent from 1885
 

Prashanth

New Member
Joined
Mar 4, 2011
Messages
12
Reaction score
0
You talking about the resources.arsc? Those xmls make up the values folder under res. And smalis are what make up classes.dex. those rarely need changing for theming, except in the case of GMail, at least from what I've found.

Sent from 1885
______________

I didnt get it as i am new to android i am unable to get what u are saying..

See actually I made a Project calculator using Eclipse (I used to have Src-Which would have java files,gen,res,Androidmanifest.xml) I made caly.apk

Now I want to change my code. how should i do it.Using Apk manger i can only change my Xml file but there is mistake in my code now i want to change my code how should i do it..

Any help Please..........
 

stetsonaw

Beta Team/Marty McFly
Premium Member
Theme Developer
Joined
Jun 16, 2010
Messages
2,317
Reaction score
0
Location
Bellevue, NE
Website
www.flickr.com
When you decompile your apk, the resources.arsc file becomes the res/values folder. Inside the values folder, you will find colors.xml. crack that guy open in notepad++ and change your color code. When you compile, do it as a system app, yes when it asks if you want to copy blah blah. When it prompts you to go to the 'keep' folder, open it and delete resources.arsc, and any other xml you may have edited. Go back to apk manager and press any key to continue. Once complete, sign it then go about whatever procedure you want to install it.

Sent from 1885
 

Prashanth

New Member
Joined
Mar 4, 2011
Messages
12
Reaction score
0
When you decompile your apk, the resources.arsc file becomes the res/values folder. Inside the values folder, you will find colors.xml. crack that guy open in notepad++ and change your color code. When you compile, do it as a system app, yes when it asks if you want to copy blah blah. When it prompts you to go to the 'keep' folder, open it and delete resources.arsc, and any other xml you may have edited. Go back to apk manager and press any key to continue. Once complete, sign it then go about whatever procedure you want to install it.

Sent from 1885

What you told i had done it.. but i can only change the XML files I want to change the SMALI code...How can i change it.For that i have to change smali to java code than i can modify it why Because i dont know smali language.

My question is how do i get Java Code from .SMALI
 

Prashanth

New Member
Joined
Mar 4, 2011
Messages
12
Reaction score
0
You're doing it w/ a raw compiled apk correct?

ITS Correct only i am getting this error not the above one

java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"
 
Top