yashsingh1/xdaforums huggingface dataset:
[Galaxy Ace S5830 General] ag4751:
You can open a CMD prompt direct from the apktool folder, its much easier than typing all these commands out.

What phone do you have and have you extracted all the framework apk's from it as a lot have more than one framework apk and do you have them all in the same directory as your aapt, apktool.bat and apktool.jar files
[Galaxy Ace S5830 General] supertanno:
I have a Huawei Ascend G700, and I didn't extract anything from it since I didn't see anything about extracting in the guide. I'm not sure if it's a good idea either, since I'm only changing some of the assets in Flappy Bird for a school project, and it's meant to be spread through the school on all Android phones downloading the edited version.
[Galaxy Ace S5830 General] ag4751:
That will be why the if framework command isn't working as you don't have the framework .apks from the phone.for the command to find
[Galaxy Ace S5830 General] vmancini3:
∆+1 Yup...everything needs to be in the same directory! apktool, aapt, any apk's you may be working with, and also, just go into the folder where your stuff is, hold shift and right mouse click and choose "Open command window/prompt here"!
[Galaxy Ace S5830 General] Wind07:
delete
[Galaxy Ace S5830 General] rush25:
16:24:38.818: [Error] - ApkTool.CompileApk: 'ApkTool: Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Program Files\Virtuous Ten Studio\External\ApkTool\aapt.exe, p, --min-sdk-version, 19, --target-sdk-version, 19, -F, C:\Users\Kothari\AppData\Local\Temp\APKTOOL7436560450170179613.tmp, -0, arsc, -I, C:\Users\Kothari\apktool\framework\1.apk, -S, C:\Users\Kothari\AppData\Local\Temp\90B0C8\res, -M, C:\Users\Kothari\AppData\Local\Temp\90B0C8\AndroidManifest.xml]'
16:24:38.824: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)'
16:24:38.827: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.androlib.Androlib.buildResources(Androlib.java:283)'
16:24:38.834: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.androlib.Androlib.build(Androlib.java:206)'
16:24:38.836: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.androlib.Androlib.build(Androlib.java:176)'
16:24:38.837: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.apktool.Main.cmdBuild(Main.java:228)'
16:24:38.839: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.apktool.Main.main(Main.java:79)'
16:24:38.842: [Error] - ApkTool.CompileApk: 'ApkTool: Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Program Files\Virtuous Ten Studio\External\ApkTool\aapt.exe, p, --min-sdk-version, 19, --target-sdk-version, 19, -F, C:\Users\Kothari\AppData\Local\Temp\APKTOOL7436560450170179613.tmp, -0, arsc, -I, C:\Users\Kothari\apktool\framework\1.apk, -S, C:\Users\Kothari\AppData\Local\Temp\90B0C8\res, -M, C:\Users\Kothari\AppData\Local\Temp\90B0C8\AndroidManifest.xml]'
16:24:38.844: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)'
16:24:38.852: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)'
16:24:38.859: [Error] - ApkTool.CompileApk: 'ApkTool:	... 5 more'
16:24:38.861: [Error] - ApkTool.CompileApk: 'ApkTool: Caused by: brut.common.BrutException: could not exec command: [C:\Program Files\Virtuous Ten Studio\External\ApkTool\aapt.exe, p, --min-sdk-version, 19, --target-sdk-version, 19, -F, C:\Users\Kothari\AppData\Local\Temp\APKTOOL7436560450170179613.tmp, -0, arsc, -I, C:\Users\Kothari\apktool\framework\1.apk, -S, C:\Users\Kothari\AppData\Local\Temp\90B0C8\res, -M, C:\Users\Kothari\AppData\Local\Temp\90B0C8\AndroidManifest.xml]'
16:24:38.868: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.util.OS.exec(OS.java:89)'
16:24:38.870: [Error] - ApkTool.CompileApk: 'ApkTool:	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)'
16:24:38.873: [Error] - ApkTool.CompileApk: 'ApkTool:	... 6 more'

No matter whatever apk i compile i get this error :( also uninstalled java and then reinstalled it :(
[Galaxy Ace S5830 General] ziedje:
Error

When I type apktool if framework-res.apk

I got this error:

Exception in thread "main" brut.androlib.AndrolibException: Can't create directo
ry: C:\Users\Zied\apktool\framework
at brut.androlib.res.AndrolibResources.getFrameworkDir(AndrolibResources
.java:670)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:566)
at brut.androlib.Androlib.installFramework(Androlib.java:473)
at brut.apktool.Main.cmdInstallFramework(Main.java:250)
at brut.apktool.Main.main(Main.java:81)

I already reinstalled Java twice, deleted and downloaded apktool from the code.google site

I downloaded a framework-res apk and systemUI.apk and put those files in a folder.

I still got that error, so I go to decompileandroid.com and decompiled the apk and downloaded it,I put the files in a folder in the root of apktool named source. Now I want to recompile but when I type "apktool b source testbird.apk" I got this error

I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: Can't create directory: C:\Users\Zied\apktool\framework
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: Can't create directory: C:\Users\Zie
d\apktool\framework
at brut.androlib.res.AndrolibResources.getFrameworkDir(AndrolibResources
.java:670)
at brut.androlib.res.AndrolibResources.getFrameworkApk(AndrolibResources
.java:502)
at brut.androlib.Androlib.parseUsesFramework(Androlib.java:508)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more

I run Windows 8 Pro on an 64bit cpu.

If you need any more info ask and I will update.

PS: in the attachment you can see how my apktool folder is.
[Galaxy Ace S5830 General] biggeagle:
good!
[Galaxy Ace S5830 General] toinkz143:
only "smali" folder

can somebody help me? when i decompiled the apk only "smali" folder appeared. what did i do wrond? pls help me asap
[Galaxy Ace S5830 General] ad4x:
This is horribly vague. Somebody please explain what the hell this means. Why am I doing pasting the new files into the old container apk if I'm going to be installing the new container apk?
[Galaxy Ace S5830 General] vmancini3:
Because the AndroidManifest XML and the resources.arsc file, along with any *stuff* you actually modified in the "res" or any other folder will replace the ones located in the original apk,.....in essence turning the old apk into the new one by doing said copying... Hopefully this makes some sort of sense...

Also, one thing that I've noticed as well, that DOES make a difference, is how the files are compressed in the original apk...if you were to try to use a new apk, built by you with your modifications, then you will notice that things seem to be compressed differently....and a lot of times the system doesn't like that very much! Just make sure you're using 7zip and have both apk's open, side by side and you'll see the difference! Also, that's exactly how you'll do the copying....make your edits first, then build the apk, then have the old one and the new one open at the same time, drag and drop the modified files right *out of* the new apk and into the original, then you're still going to have to re-sign the original apk again! After that, it's not necessary, but I highly recommend zipaligning the apk as your very last step, as this makes it operate in the most efficient manner in the way Android uses it!
[Galaxy Ace S5830 General] coyttl:
May want to add this to your guide. You just mention that the framework has to be installed, but don't mention where the framework comes from.And then you say that running the 'if' command installs the framework. So it's a little misleading for folks that don't know what the 'framework' is. :D
[Galaxy Ace S5830 General] o-w-a:
Same here can't install the framework and cant recompile!! But I can decompile though
[Galaxy Ace S5830 General] TheTominator:
framework-res.apk not found

Hello,

I've been trying to modify an apk for months now. I am a noobie at this stuff. I'm having trouble with installing framework-res.apk using APK Tool. I have a Galaxy S4 with Android version 4.3. Attached is a screenshot of the error I'm getting. This is just one of the many problems I've faced. I would appreciate any help please!
[Galaxy Ace S5830 General] ag4751:
Samsung phones have 2 framework files you will need them both framework-res.apk and the twframework-res.apk from the phone. I am guessing you don't have the apk files in the same folder or you have not extracted them from your phone.

Make sure you have them both in the same folder as the aapt.exe, apktool.bat and apktool.jar files, then run the if command for each apk
[Galaxy Ace S5830 General] TheTominator:
Where to find/get these files?

Thank you for replying ag. Where do I find these files? How do I get them off of my phone? I've looked before and could not find framework-res.apk anywhere. I just need to know how to get these files off my phone or where to get them from.

Thanks again in advance,

TheTominator
[Galaxy Ace S5830 General] ag4751:
The apk’s are in the system / framework folder, there are a few ways to access them.

1.	Using ADB look at this thread

2.	Installing MyPhoneExplorer on your PC and the client from Play Store, connecting your phone via USB or WiFi then starting the application and clicking on application find the system / framework folder and simply click, drag and drop from the list of apk’s the framework and twframework apk’s to your PC.

3.	Using a root file manager like ES File Explorer, finding the apk’s in the device system / framework folder, copy them to your internal storage or external SD card in the phone, then connect your phone to your PC and drag them from that location to your PC.

Whichever you find the easiest way for you personally.

Your phone must be rooted and USB debugging enabled in the developer options.

If you don’t have developer options available then go to Settings > More > About Phone > Build Number. Tap build number 7 times to enable developer options, when you see the message saying "You are now a developer" press the back key and Developer Options will be between Date & Time and About Phone in the Settings > More list.

All further questions you have about this would be best asked or searched for in the S4 forum Q&A or General Sections they will be able to help you in more detail.
[Galaxy Ace S5830 General] decalman:
Watch "PULL DECOMPILE COMPILE PUSH SYSTEMUI" on YouTube - PULL DECOMPILE COMPILE PUSH SYSTEMUI: https://youtu.be/Bo-WY41xwS8

My Tapatalk Signature

http://youtu.be/53ovtKPdrPE

http://youtu.be/FBkGF1XfvZI
[Galaxy Ace S5830 General] TheTominator:
Rooting phone

I appreciate you trying, but I do not want to root my phone. I believe that voids the warranty. Oh well, I guess I'll give up unless there's another easy way/tool to decompile, edit, recompile, sign that you can tell me about.
[Galaxy Ace S5830 General] ag4751:
Check the ADB thread you don't need to root your phone to use ADB.
[Galaxy Ace S5830 General] faizauthar12:
where i can see my moded apk?

i don't see it apktool directory,or apktool save to another directory?
[Galaxy Ace S5830 General] dotzip.:
apkptool creates a dir with the decompliled app in it with the same name as the apk it will be in the root dir apktool

when recompiling it puts it in apkto root dir named according to what you named it when you called to recompile the app like

apktool b whatever whatever-moded.apk
[Galaxy Ace S5830 General] starbucks2010:
Hello,

I tried to decompile SecPhone.apk from an S4 (XXUFNBH) but all that I get are ~4500 files decompiled (res+smali folders) and this error. I did the "apktool if" for framework-res, twframework-res and SystemUI files. Can you give me a hint to fix it?

Thank you.

C:\apktool>apktool.bat d SecPhone_nbh.apk

I: Baksmaling...

testI: Loading resource table...

I: Loaded.

I: Loading resource table from file: C:\Users\xxxxxxxx\apktool\framework\1.apk

I: Loaded.

W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x7f09094a

I: Decoding file-resources...

I: Loading resource table from file: C:\Users\xxxxxxxx\apktool\framework\2.apk

I: Loaded.

I: Decoding values*/* XMLs...

I: Done.

Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:

0x7f09094a

at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)

at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:55)

at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:51)

at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:59)

at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:46)

at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResScalarValue.java:43)

at brut.androlib.res.decoder.ResAttrDecoder.decode(ResAttrDecoder.java:40)

at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(AXmlResourceParser.java:315)

at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(XmlPullParserDelegate.java:69)

at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)

at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)

at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:46)

at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamDecoderContainer.java:34)

at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:100)

at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:114)

at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)

at brut.apktool.Main.cmdDecode(Main.java:128)

at brut.apktool.Main.main(Main.java:65)

C:\apktool>
[Galaxy Ace S5830 General] oracle01642:
I did everything you said, but when I type in

cd 'apktoo'l/'directory' I get the message 'the system cannot find the path specified'. Any idea what is wrong?
[Galaxy Ace S5830 General] decalman:
Try this

Watch "PULL DECOMPILE COMPILE PUSH SYSTEMUI" on YouTube - PULL DECOMPILE COMPILE PUSH SYSTEMUI: https://youtu.be/Bo-WY41xwS8

My Tapatalk Signature

http://youtu.be/53ovtKPdrPE

http://youtu.be/FBkGF1XfvZI
[Galaxy Ace S5830 General] oracle01642:
Thanks my friend. I am wanting to learn how to theme apps etc, so I can theme my stock S4 system apps to look like stock S5 apps. Is your version of apktool compatible with kitkat?
[Galaxy Ace S5830 General] decalman:
I'm not sure but you can read more here https://code.google.com/p/android-apktool/

My Tapatalk Signature

http://youtu.be/53ovtKPdrPE

http://youtu.be/FBkGF1XfvZI
[Galaxy Ace S5830 General] erikalin:
If you have issues, download the latest beta for apktool. Follow link from post above mine. I don't have your phone, but for my 4.4 system apps I couldn't get the previous version of apktool to decompile but beta does, for me. YMMV.

Sent from my Verizon HTC One M8
[Galaxy Ace S5830 General] PulseDroid:
I had problems decompiling Kitkat apps, used the newest beta and that worked. - Will add it to the OP as soon as I get time.
[Galaxy Ace S5830 General] windylawyer.1712:
Sorry for posting Question here, but right now i dont know where to ask. So please, if u can, help me to correct.

I installed all needed thing, such as JDK and JRE, APK tool folder too.

i installed Framework-res.apk, installed Framework-htc-res.apk via apktool if command.

after that, i decomplied SystemUI.apk.

But i got error. I tried several times, but the same.

I dont know what is wrong so hope you guys can help me to fingure it out.

Thks in advanced

Regard!

PS: problem sovled.htc need com.htcresource.apk installed as framwork
[Galaxy Ace S5830 General] mahdy666:
Page saved for learning compile and decompile an apk..

:laugh:
[Galaxy Ace S5830 General] JrSmilez:
I apologize up front if I'm asking this in the wrong place... I've tried asking in the rom thread and I'm told no one knows to ask somewhere else and this is the only place I know to ask. I'm sure it's the rom because I've never had this much trouble when I'm theming. It's probable because I'm on a new unfamiliar phone. anyway, I keep getting "brut_util_Jar_1105468756754671436.tmp has stopped working" or "aapt.exe has stopped working" when I try to compile my lge-res.apk. framework-res.apk is the only thing I haven't had trouble out of yet. Systemui compiles fine but force closes on me as soon as I boot up.

If anyone has expreriance with the LG G2 or the Optimus DE 2.2 rom I could really use some help.

Just a P.S. I know it's not apktool... I've used it from day one of learning and it's the best built tool out there. Thank you for all your hard work guys....

Edit: I figured it out. I've never seen this before but it was a bad .9 causing the program to close.
[Galaxy Ace S5830 General] oracle01642:
Could someone please tell me how to install apktool on my laptop? I have installed java SDK and JRE, and android SDK. Downloaded numerous apktools, but they either don't work, or I cant install it because it doesn't recognise the command prompts???

It's driving me crazy. I have been trying to edit my SystemUI and SecSettings and I just can't get apktool to work.

PS; My phone is a galaxy S4 I9505 running 4.4.2. And my laptop is running windows 7.
[Galaxy Ace S5830 General] JrSmilez:
You have to put all of those including apktool in your environment variables path.
[Galaxy Ace S5830 General] oracle01642:
I followed your tutorial, but it wont recompile the app. I keep getting error messages.

---------- Post added at 03:25 PM ---------- Previous post was at 03:24 PM ----------

Where is that?
[Galaxy Ace S5830 General] JrSmilez:
sent you a pm
[Galaxy Ace S5830 General] oracle01642:
Thanks for the help mate, but it still wont work. It wont recompile the app. What do you do after installing both frameworks and decompiling the app and then editing it, do you go to command prompt after you have finished editing the app and type in 'apktool b SecSettings = compile' if you want to recompile the newly edited app? Because that is what I am doing and I keep getting errors???
[Galaxy Ace S5830 General] JrSmilez:
What are the errors
[Galaxy Ace S5830 General] oracle01642:
Here is the error log.
[Galaxy Ace S5830 General] JrSmilez:
It's still not finding Java. If you have 64bit do the same with program files x86 you did with the environment variables for program files.
[Galaxy Ace S5830 General] dotzip.:
should be apktool b secsettings secsettings-mod.apk to recompile command run from root dir of apktool
[Galaxy Ace S5830 General] oracle01642:
Root dir of apktool?
[Galaxy Ace S5830 General] ag4751:
Fist of make sure java is working, in the folder location where you have apktool open a cmd window and type javac then press return key, you should get a meanu list of java commands, if you do java is working fine, then type the below (in red) in your prompt to decompile

C:\Users\hp\Desktop\apktool>apktool d SecSettings.apk

then rename the decompiled folder something like SecSettings_1, then to compile afterwards type the red pat again

C:\Users\hp\Desktop\apktool>apktool b SecSettings_1 SecSettings_1.apk

I am assuming you are using apktool 1.5.2 then this will build the new apk called SecSettings_1.apk

If you are using apktool 2.0 versions just type apktool b SecSettings_1 this wil put a new folder in your decompied folder called dist and your new apk will be located in there

The renaming is only to prevent any overwriting of the original apk, you need to call it SecSettings.apk to flash to the phone
[Galaxy Ace S5830 General] oracle01642:
I opened a cmd in the folder where apktool is located, typed in javac, but it says 'javac' is not recognised as an internal or external command, operable program or bach file?? This whole java/apktool thing is literally driving me crazy. How hard can it be?!! The funny thing is, I have a couple of versions of apktool fully working in the past, but now I cant seem to get any to work. :(
[Galaxy Ace S5830 General] ag4751:
Which version of java are you using, the latest is version 8 which are here Java you need both JRE and JDK, you don't necessarily need to use version 8 but as its the latest maybe best to

Remove all other versions of Java if you install these version

In your environmental variables PATH remove any paths to previous versions of java make sure you have the path to both JDK and JRE set, you should have both these, the C being your PC main drive is a D on some computers then program files if that is where java is the main parts are the ones in red the other depends on your personal PC set up, make sure the locations are separated by a semi colon

C:\Program Files\Java\jre8\bin;

C:\Program Files\Java\jdk1.8.0_05\bin;

Then you should be able to open a cmd anywhere and type javac press return and get a full list of menu function example below

C:\Android_SDK>javac

Usage: javac <options> <source files>

where possible options include:

-g Generate all debugging info

-g:none Generate no debugging info

-g:{lines,vars,source} Generate only some debugging info

-nowarn Generate no warnings

-verbose Output messages about what the compiler is doing

-deprecation Output source locations where deprecated APIs are u

sed

-classpath <path> Specify where to find user class files and annotati

on processors

-cp <path> Specify where to find user class files and annotati

on processors
[Galaxy Ace S5830 General] oracle01642:
I have got the latest java SDK and JRE installed. What should the last bit of text look like in system variables> path? Mine looks like this; C:\apktool\apktool;C:\Program Files\Java\jre7\bin

Is that all in the right place? The semi colon etc?
[Galaxy Ace S5830 General] dotzip.:
just point it to C:\program files\java\jre you don't need a path for apktool
[Galaxy Ace S5830 General] :
Make sure to add the jdk bin location to the path variable too like this C:\apktool\apktool;C:\Program Files\Java\jdk1.7.0_45\jre\bin;C:\Program Files\Java\jdk1.7.0_45\bin That's how mine path variable looks like. It works great too. Hope I Helped :)
[Galaxy Ace S5830 General] Thecrazyskull:
For all people that face problems just use winrar... im not kidding you guys its really..winrar.

Open the apk file that you want in winrar, then drag and drop the files and tada you have succesfully decompiled apk.

For recompiling add all the files that you have get when decompiling to an (zip) archive and then change extension to .apk.

Sorry for bad english.
[Galaxy Ace S5830 General] ag4751:
That wont work mate, it wont decode xml file or .9.png files, they need to be decoded properly otherwise you wont be able to make any changes to them, xml's will still be coded and .9.png's need to be patched using SDK draw9patch process you can't just change a .9.png to a standard .png.
[Galaxy Ace S5830 General] buu1152:
i can't seem to get the cmd to install the frameworks and im not sure what to do. it says 'java' is not proper cmd or w.e when i type from 'C:\android\apktool>' (i noticed in your code, u had slashes '/' not back slashes '\' like mine, if that makes any difference) : 'apktool if framework-res.apk'

attached pic.
[Galaxy Ace S5830 General] :
Have you installed java? If yes, have you set the environment path variable to its location? Do post the result. Hope I Helped :)