[Q] Customizing statusbar of Galaxy Ace with adb FAILED - General Questions and Answers

Hi guys. Phone is Samsung Galaxy Ace, rooted, Android 2.3.6
1. Pulled and decompiled the system app SystemUI.apk
2. Edited \res\layout\statusbar.xml by adding a line which is supposed to change the color of the status bar clock
3. Might have added a few line spaces after the line so that I can find it easily next time I want to change the color.
4. Recompiled and named the apk as SystemUI-new.apk
5. Opened SystemUI.apk & SystemUI-new.apk using 7zip. Copied the edited statusbar.xml from SystemUI-new.apk to SystemUI.apk
6. Pushed SystemUI.apk (which now has the edited statusbar.xml) back into the phone.
7. Whole status bar disappears!!!
What did I do wrong?
Thanks guys!

You should also copy the resources.arcs or something like that that's in the modded app.

Hey dxppxd, sorry to bother you again. I removed the sdk program from my laptop and uninstalled java because I wanted to start from scratch again.
I have re-installed java, these are now in my laptop:
Java SE Development Kit 7 Update 4 (64-bit)
Java(TM) 7 Update 4 (64-bit)
JavaFX 2.1.0 SDK (64-bit)
JavaFX 2.1.0 (64-bit)
I have also reinstalled android sdk and adb, and have managed to pull framework-res.apk from my galaxy ace.
My problem is when I type:
apktool if framework-res.apk
C:\android-sdk-windows\platform-tools>apktool if framework-res.apk
'java' is not recognized as an internal or external command,
operable program or batch file.
Can you help please? I was able to execute that command last time without error
Thank you.

I'm sorry I can't be of much help in this case. Seems there is a component missing from the Java runtime environment. Also, t ry reinstalling apktool directly by coping the .jar, .bat and other files to your windows folder.
Other than that Google is your best friend.

Related

[Q] question about (de)compile...

I'm getting this issue:
I got Settings.apk and framework.apk from a rom, then i opened apktool and
1) imported fw: apktool if framework.apk
2) decompiled apk: apktool d Settings.apk
3)edited a string in a xml
4) rebuilt all: apktool b Settings Settings.apk
5)pushed it into system/app
6) fix permissions and reboot.
Settings now should work, but it doesnt. Can somebody tell me where i do a mistake?
Thank you
(I used win8, but i could use macos or ubuntu as well)
sign it first
ej8989 said:
sign it first
Click to expand...
Click to collapse
I did it. same result. maybe the application I used is not good (Auto-Sign v0.65). what application i've to use?
I didnt write it before, however the rom is on 4.2.1 (cyanogen 10.1)
put your re-complied apk to your phone's sd card and use zipsigner2 from playstore to sign it.
ej8989 said:
put your re-complied apk to your phone's sd card and use zipsigner2 from playstore to sign it.
Click to expand...
Click to collapse
Nothing. Maybe this is not good for 4.2.1? (I've used it lots of times with 4.1)
Well, apktool is using smali/baksmali to compile/decompile classes.dex/apk_name.odex file.
The problem can occur when you use different baksmali version when you decompile and also not the right version to compile (as the system expects it to be). You can also experience issues if the apk is not zipaligned properly (check down who to do that)
apktool has the smali/baksmali code inside it so you will need to get the newest version for it for JB for example.
You can check why the status bar is not there when you monitor the logcat and look for DEX related logs in the beginning.
You can also use smali/baksmali on your own: http://code.google.com/p/smali/wiki/DeodexInstructions
and just place the generated classes.dex in the apk
then zipalign -f 4 filein.apk fileout.apk (http://developer.android.com/tools/help/zipalign.html)
then push back fileout.apk (sytemui.apk in your case)
Sent from my Galaxy Nexus using xda premium

How to guide decompiling/compiling systemUI.apk

If you are not having problems compiling SystemUI.apk with no problems then this is not for you
WARNING:
You should not attempt to do this on a device that does not have a recovery, because if something goes wrong you may have to reinstall your rom (not very likely though). You should probably back up SystemUI.apk You should also have some experience modding and some experience using Apktool and Linux.
INTRO:
If your having problems modding SystemUI.apk on JB then this thread is just for you. I recently found out how to mod the Jelly Bean SystemUI. Jelly Bean has made it very difficult to mod. Yes it is still easy to replace images, but if you want to do some major changes to the UI such as a 100 percent battery mod or changing the status bar color then you will need to know exactly how to do it. For example, if you get the UI decompiled without errors and you recompile it without errors YOUR RECOMPILED SystemUI.apk WILL NOT WORK and your status bar will disappear etc... There is a special way to get everything working and I will show you how.
STEP 1:
LINUX>>
Before we start I recommend that you have File Roller: one of the most popular archive managers for Linux (Ubuntu comes with it). If your distribution uses a Debian package manager (most popular ones do) then all you have to do is go into the terminal and type:
Code:
sudo apt-get install file-roller
Now you will have File Roller. You also will need java installed. Check if you have java by typing:
Code:
java
in the terminal. If you dont have java and your using a Debian package manager then type:
Code:
sudo apt-get install openjdk-6-jre
or download from the java website and install it.
WINDOWS>>
Before we start, you will need 7zip and java. Just search and you will find the programs to install
STEP 2:
Now we will install APKTOOL. You may already have it installed BUT your version will probably not work. I have ran around the internet for a modified apktool that wont give you errors (If you follow my directions). I came across a great thread. check it out and download all the tools their (dont forget aapt) http://forum.xda-developers.com/show....php?t=1755243. If you are in Linux rename the jar file to apktool.jar and move the the jar plus aapt to /usr/local/bin. You will need root. If you are in Windows rename the jar to apktool.jar and move it and aapt to your WINDOWS directory. You also need zipalign http://powerpoint45.webs.com/android/zipalign(I think this one is only for linux so if ur on windows either test this one or get zipalign from android sdk)move it to your WINDOWS dir/bin dir. You need one more thing. It is from the apktool websitehttp://code.google.com/p/android-apktool/. According to your os download either apktool-install-linux-r04-brut1.tar.bz2 or apktool-install-windows-r04-brut1.tar.bz2. Extract the contents. You only need one file from the archive. In linux move apktool (not apktool.jar) to /usr/local/bin. In Windows move apktool.bat to your WINDOWS directory. Dont jump ahead and say "Now that I got apktool set up, I know what to do", because it gets a lot more difficult than you are used to using apktool.
STEP 3:
Now that you have apktool set up, you need to know how to mod SystemUI.apk. Get SystemUI.apk from /system/app within your device onto the computer. Now make a backup of SystemUI.apk on your computer because we will NEED it later. So you need two SystemUI.apk files on your computer. You could name one “backup” if you'd like. So now now we need to decompile the apk. Go into the terminal/cmd and cd/chdir into the directory you have SystemUI.apk. Now type
Code:
apktool if SystemUI.apk
It will then install frameworkneeded.Then type:
Code:
apktool d SystemUI.apk
It will decompile the apk. It will take a bit of time for it to fully decompile. The decompiled code will be in a folder in your current directory called SystemUI. If It had errors decompiling, (IT WILL FOR MOST NEXTUS 7 ROMS) you will need to install framework manually. Download framework here:http://db.tt/Rpc6zskQ and place the two APK files into apktool framework folder (replace the old framework files). In Linux it is located at /home/yourusername/apktool/framework and in windows it is something like C:\\Documents And Settings\yourusername\apktool\framework. After that delete the SystemUI folder that was made by the bad decompiling proccess and repeat the decompile command.
STEP 4:
This is the part where you start modding. You can make many customizations to the UI this way as you probably know. I will just show you how to make a 100 percent battery mod. You need to go into the decompile folder (SystemUI) using a file manager, Then from SystemUI, go delete res/drawable/stat_sys_battery.xml and replace it with http://powerpoint45.webs.com/android...ys_battery.xml (to download that file right click on link and click something like "save link as"). Now you need to move to a new directory: /res. In that folder you need to look through all the directories that start with the word drawable. For example drawable-mdpi. There is one directory that your device uses for images but you may not know which one. Your device might be MDPI but use drawable-sw600dp from the UI instead of drawable-mdpi. So if you dont know or you want to be safe then search through the drawable folders and if their are any battery icons then remember you will need to add 100 battery icons to each one of the folders with battery icons. The battery icons are the ones named something like stat_sys_battery_0.png. So if you need to add 100 icons they need to be named in numerical order from stat_sys_battery_0.png to stat_sys_battery_100.png. Dont worry though, you wont need to rename 100 icons. Their ar many battery mods online that you can get them from, but I have some images you can download: http://powerpoint45.webs.com/android...RY_BLUE.tar.gz. Download it, extract it and copy all the images into all the drawable folders that contain battery icons. Now your ready for compiling; The step that is different than how we have always done it before Jelly Bean existed. keep in mind that some images can not be changed or edited at all durring this step because it will result with many errors durring compiling. You would have to add images to the archive after its compiled
STEP 5:
Like I said at the end of step 4, this step will be different than you have seen before. This is also the step where you will be using File Roller/7zip. To build the apk make sure you are in the terminal in the directory where SystemUI exists and type:
Code:
apktool b SystemUI almostdone.apk
almostdone.apk is the output file. Once it is done building you need to open the backup apk you made at the beginning with File Roller /7zip. Also open almostdone.apk with File Roller/7zip. From inside the backup.apk drag meta-inf folder & androidmanifest.xml to allmostdone.apk. Now all you need to do is zipalign the apk. Lets say your backup apk is named backup.apk. Go into the terminal at the directory you are working
in and type
Code:
zipalign -v 4 allmostdone.apk done.apk
This will optimize the apk. The output is done.apk.
STEP6:
Now you install the apk. Their are many meathods of installing the apk, here are a couple. Transfer done.apk to your device and rename it to SystemUI.apk. Now use a root browser or terminal app to replace the other SystemUI.apk on your system at /system/app. And make sure you give it the same permissions as all the other apk's in the system/app directory. Then reboot. Or you could make a flashable zip to install it.

[HELP][DECOMPILING] I can't install/use the modded apk

Hi, okay guys, i wanna ask something. I was able to decompile, recompile, sign apk (using 7-zip) last year. Then, somethings happened to my laptop. I have to install a new windows 8.
All i have done is :
1) Installing JRE 7u45 64 bit and JDK 7u40 64 bit
2) Pulling SemcGenericUxpRes.apk, installing it by typing on the command "apktool if SemcGenericUxpRes.apk"
3) Pulling framework-res.apk, installing it by typing on the command "apktool if framework-res.apk"
4) Decompiling some app. After that, i typed on the command "apktool b XXX" where XXX refers to the decompiled folder
5) Drag and Drop the META-INF folder from the original to the new one
6) Pushing to my Xperia Miro. But the app doesnt show up on the launcher
7) When i recompile SystemUI.apk, signing it, then pushing it to system/app, setting the permissions, then using Restart SystemUI app, its worked. But after i restarted my phone, my SystemUI is gone
Does anybody here have the same problem with me?
Here is my Specification of my laptop :
Acer Aspire E1 -471G
Windows 8 64 bit version
JRE and JDK installed as ive told you above
Apktool, tried from version 1.5.1PR2 until 1.5.2 version
7-zip version 9.20 64 bit version
Winrar version 5.00 64 bit version
The last time i was able to recompile and use the modified apk was one year ago. The specification is same like above. Help me, please! :crying:
Did you sign your new apk?
PulseDroid said:
Did you sign your new apk?
Click to expand...
Click to collapse
Hi, thanks for your reply. Okay, in this post : http://forum.xda-developers.com/showthread.php?t=2011325 its showed me to copy the META-INF folder. And ive already copy that folder. Its failed to install in my phone. I tried using Adb Install xx.apk but shows me this :
"Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]"
And when i push it manually to /data/app/ or /system/app/ it doesnt showed up to my launcher.
Ive tried to zipalign it, but still error. So, what is wrong with my phone?
What certificate did you use in Zipalign?
Certificate from the original apk. Drag and Drop the META-INF folder using 7-zip
Skip the META-INF copy step.
Rather use this
Okay, ive downloaded the application.
So, ive just decompiled the SystemUI.apk. Which one should i select? Thanks for your help

Incomplete SystemUI.apk?

UPDATE:
I was able to get apktool running on my Windows partition. After decompiling SystemUI.apk, I was able to find the strings.xml under res/values. But there's now a new problem, which is the fact that all of the quick settings labels here are in the correct cases whereas on the device they display in allcaps. What could be causing this?
Original post:
Currently I'm using an HDC G900F phone (Galaxy S5 clone) running rooted Android 4.2.2, and trying to change some text in the notifications panel quick settings. In the attached image, you can see that all of the toggle labels are in ALLCAPS and some of them have English spelling mistakes. What I want to do is change the text to correct upper/lower cases and correct the spelling errors (also rearrange them, if possible).
As I understand it, I need to modify some files under res/values in SystemUI.apk but the problem is that when I extract SystemUI.apk and decompress it (with Stuffit or any online APK decompiler), there is no "values" folder under res/ and none of the files from any of the SystemUI.apk modding guides I read seem to exist in my apk. What I want to ask is why these files don't seem to exist and what I can do to achieve the above objectives of correcting the toggle labels?
PS. Installing and using apktools on my Mac is not an option. When I run the installer from the Home Directory, it behaves as if apktools is already installed and takes me directly to the main menu but whenever I select any of the menu options, it says that the relevant command is not found, indicating that apktools is not installed. Clearly something has gone horribly wrong somehow here.
UPDATE:
Never mind. I give up.
So far something has gone wrong every step of the way and it's just too much of a hassle. Mac installation failed and won't let me reinstall, Windows installation failed to detect Java, Java reinstallation failed to be recognised by the system, apktool failed to install the framework, apktool failed to decompile the apt, apktool then fails to build the modded apt. Every step I've had to manually fix things and it's simply too much trouble for just changing a few strings of text on my device.
With a track record for having problems absolutely everywhere, I just uninstalled and deleted everything in case the next step blew up my computer or something.
I know the feeling....
Them feels...tho!

[Q] Decompile/Recompile APKs using APKTool

I'm trying to get into modding apps. I first wanted to decompile/recompile an unmodded app just to make sure it would work in the end.
I downloaded apktool (2.0RC4) with the JAR and BAT wrapper (on Windows 7) and got it working properly.
I pulled the /system/framework framework-res.apk from my device
I ran the following commands without any sign of error
Code:
//install framework
apktool if framework-res.apk
//decompile to \app folder
apktool d app.apk
//recompile \app folder
apktool b app
Now I went in and took the app.apk in dist folder and ran on my phone. It errored that the APK wasn't structured correctly, or something.
So I opened up both my original APK and my new APK in WinRar and copies over resources.arsc, the META-INF folder and AndroidManifest.xml.
Side question: This is supposedly supposed to re-sign the apk. I understand how this MIGHT work here since it's unmodified, but generally speaking it makes no sense if you could copy the signature to something else and say it's signed. I imagine the internal validation would fail? Should I be re-signing it myself? As long as it runs on the phone I don't care who people think it came from.
Anyway, after I copy the new APK to my phone and run it, it installs for a while then throws up "App Not Installed" with the DONE button.
I tried using APKSigner to put a bogus signature on there to see if that helped, and it did. I managed to install the APK but when it boots up it becomes unresponsive almost immediately.
How can I decompile/recompile an apk and then run it without any modifications?
Thanks in advance!
Debug Mode
After checking catlog I noticed the app tried to re-orient and broke shortly after, so after rebooting my APK it ran. I just had some bad luck.
However now that I can re-compile the application, I am trying to re-compile it in debug mode so I can step through it and find where I want to be. I have done this tutorial:
<Was unable to post link, it is entitled HowTo: Debug Android APKs with Eclipse and DDMS on blog.dornes.nu>
The steps are:
//this decompiles in debug mode
apktool d -d app.apk -o source
I then manually edited the AndroidManifest.xml and added android:debuggable='true' to the 'application' tag
//rebuild in debug
apktool b -d source app.debug.apk
Then I signed the APK using ZipSigner
Installed APK successfully
Went to developer options and used select debug app
(The Wait for Debug to Start option does keep the app from running, but when I turn it off the app boots and crashes)
So now that it is recompiled in debug, it crashes, and I've tried it many times.
I will see if I can complete the rest of the tutorial next time I'm in front of a PC, maybe with it connected to the debugger I can step through. Any reason why an app decompiled and recompiled into debug would crash?
Thanks!

Categories

Resources