[Guide][CM10.1 and CM10.2] Transparent status bar - Defy Themes and Apps

I realize that there are already a number of guides on this topic in other forums, but it took me a while to figure out how to get the transparent status bar working on my DEFY with the latest CM10.1 and CM10.2 builds by Quarx, so I decided to share my procedure in case anyone else is interested. If you just want a flashable zip, check out this thread by thekguy, who has already shared flashable zips for a transparent status bar on some of the recent CM10.1 and CM10.2 builds.
What you'll need:
smali and baksmali
apktool and apktool-install-windows
7-zip
Notepad++
1. Put all the smali, baksmali, and apktool files into the same folder on your PC. (The apktool files must be extracted first, using 7-zip.)
2. Open the CM10.1 or CM10.2 zip file using 7-zip. (Do not extract it, just open it.)
3. Browse to \system\framework, and drag the files “android.policy.jar” and “framework-res.apk” out to a separate folder.
4. Also browse to \system\app and drag out “SystemUI.apk”
5. Open “android.policy.jar” with 7-zip, and drag out the file “classes.dex”
6. Put “classes.dex,” “framework-res.apk,” and “SystemUI.apk” into the same folder used in step 1.
7. Open a CMD prompt and change to that directory (or hold the shift key then right click the mouse and select “Open command window here”).
8. Type the following commands, which install the resources needed by your apks for decompiling and recompiling:
apktool if framework-res.apk​
apktool if SystemUI.apk​
9. Type the following command, which decompiles classes.dex (replace 1.4.2 with whatever version you downloaded):
java -jar baksmali-1.4.2.jar -o classout/ classes.dex​
10. Back in the folder, go into the new classout directory that was created.
11. Browse to \com\android\internal\policy\impl, and open the file “PhoneWindowManager.smali” using notepad++
12. Search for this:
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
then scroll down to the corresponding “.end method”
13. The four lines above that ".end method" look like this:
Code:
:cond_26
const/4 v0, 0x0
goto :goto_1a
14. Replace those lines with this:
Code:
const/4 v0, 0x0
return v0
15. Immediately above the lines you just edited, you should see something like:
Code:
.line 3052
(The line number may differ depending on the build.) Leave that line and also leave a blank line above it, but delete everything else above it up to (but not including) the line that says:
Code:
iput v0, p1, Landroid/graphics/Rect;->bottom:I
16. Save the file and exit.
17. Go back to your CMD prompt and enter this command, which recompiles the classes.dex file with your changes:
java -jar smali-1.4.2.jar classout -o classes.dex​
18. Using 7-zip, drag classes.dex back to where you got it from in android.policy.jar, then drag android.policy.jar back where you got it from in the CM10.1 or CM10.2 zip file.
19. Go back to the CMD prompt again, and enter this command to decompile SystemUI.apk:
apktool d SystemUI.apk​
20. In the “SystemUI” folder that was just created, navigate to /res/layout/, and open “status_bar.xml” in notepad++
21. Search for:
Code:
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="fill_parent"
22. In that line, replace "@drawable/status_bar_background" with the hexadecimal code for the desired transparency, e.g. "#33000000" for a black-tinted status bar that is 20% opaque (i.e., 80% transparent).
Note: When defining the color of the status bar, the format is #AARRGGBB, where AA is the hex alpha value, RR is the red value, GG is the green value, and BB is the blue value. Hexadecimal uses numerals 0–9 to represent values zero to nine, and letters A-F to represent values 10-15. Thus, FF for the alpha value would be fully opaque, and 00 would be fully transparent. If you want your status bar transparency to match the lockscreen transparency, use "#70000000" (thanks to roofrider for mentioning that in this post.)​
23. Save the file and exit.
24. Optional step to disable the autodimming of notification icons, so that they are more visible on light backgrounds:
Navigate to res/values/, and open “dimens.xml” in notepad++
Search for
Code:
<item type="dimen" name="status_bar_icon_drawing_alpha">65.0%</item>
Change 65.0% to 100%
Save the file and exit.​25. Go back to the CMD prompt again, and enter this command to recompile:
apktool b SystemUI​
26. If you've edited the files correctly, it should compile with no errors and create a folder named “dist” in the decompiled folder. Open that “dist” folder, and you’ll find the recompiled “SystemUI.apk”
28. Using 7-zip, drag the new SystemUI.apk back to where it belongs in the CM10.1 or CM10.2 zip file.
29. Flash your modified CM file, and enjoy!
Credits:
- Quarx, Blechd0se, and everyone else in these forums who helps to keep the DEFY alive!
- Adi Aisiteru Reborn, for this guide, which I've adapted for Quarx's latest nightly
- thekguy, for mentioning in this thread that Adi Aisiteru Reborn's guide could be adapted for the DEFY
- XperienceD, for this awesome guide, upon which I relied heavily
- krd_medico, for providing a similar guide for CM7, from which I learned a lot

Just wanted to add that line numbers change in android.policy.jar whenever framework is changed by CyanogenMod commits, so the line numbers do not match for every build
Sent from my MB526 using Tapatalk 2

thekguy said:
Just wanted to add that line numbers change in android.policy.jar whenever framework is changed by cyanogenmod commits, so the line numbers do not match for every build
Click to expand...
Click to collapse
Thanks. I've edited the guide to avoid confusing anyone.

works on cm7.2?

cheuslacerda said:
works on cm7.2?
Click to expand...
Click to collapse
No, for CM7.2, follow krd_medico's guide: http://forum.xda-developers.com/showthread.php?t=1261065

Thanks
Thanks so much! xD also my first post

Would this work on LG Optimus Black's CM10.1?

Excellent guide! Saved me a lot of trouble, got it working on my Galaxy Mini.
Btw Adi Aisiteru Reborn was wrong when he said "#88000000" will result in 80% transparency. It'll only give 46% transparency.
That is the only part that got me stalling for a bit as what you said was different from what he said, but you are correct here.
Now to centering the clock.
Btw, i'm using #6b #70 so it matches with the lockscreen transparency, it's not perfect but it's close enough perfect! Also need to figure out a way to control the lockscreen transparency so i can have a more transparent statusbar.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
It's 56% transparent.

work on cm10.2?

Hkifuos said:
work on cm10.2?
Click to expand...
Click to collapse
I haven't tried it yet. I hope the procedure is similar, and I plan to try it out sometime soon. You can give it a try; just make sure you have a backup in case something goes wrong.

Works
Sent from my MB526 using Tapatalk 2

:good:

didnt work on optimus G on cm10.2 nightly 24-10-2013.
after boot no status bar and than it auto restarts and go into bootloop

Great tutorial! Worked perfect on CM 10.1.3 on my Galaxy S2
THANKS!!!

Cant compile the classes.dex
$ java -jar smali.jar classout -o classes.dex
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalStateException: Cannot get the location of a label that hasn't been placed yet.
at org.jf.dexlib2.builder.Label.getLocation(Label.java:54)
at org.jf.dexlib2.builder.Label.getCodeAddress(Label.java:48)
at org.jf.dexlib2.builder.BuilderOffsetInstruction.internalGetCodeOffset(BuilderOffsetInstruction.java:60)
at org.jf.dexlib2.builder.BuilderOffsetInstruction.getCodeOffset(BuilderOffsetInstruction.java:50)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:189)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:944)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:759)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:214)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:192)
at org.jf.smali.main.main(main.java:229)

Related

[Q] White Border around .9.png

I've done a heavy search on the problem and can't seem to find a solution so here goes. I created a file through Adobe Photoshop for the status_bar_close_on.9.png. Pictured below. I created it in the exact dimensions the file was which is 480 x 48. I then ran cmd for draw9patch. I dropped my .png file into draw9patch to make it a .9.png.(Also, made a border on the bottom and right side even though there's no words in the final .9.png.)
I then placed the file into SystemUI.apk>deleted META-INF> then resigned the apk. Placed the APK back into a flashable zip> Flashed.
My problem is a white border shows around my image now. From the recommendation of another forum member, I tried putting the apk into apkTools and ran unPack.bat and quickPack.bat which didn't work either.
What am I doing wrong?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
EDIT: I think I may have found my problem. I wasn't using Eclipse to compile the image.
Reference: http://www.nexus-nation.com/root-your-nexus-one/9pngs-figured-out
EDIT: This wasn't easy to figure out. I don't want anyone to go through what I went through so I've added what I've found and posted some nice pictures for you visual people.
*You first need to read the page I referenced above. After you have installed Eclipse, you'll need to install the google plugin shown below.
Possible errors you'll run into when starting an Eclipse Project
When you start a new project>File>New Project>Android>Android Project> and the build target is not listed you'll need to do the following on Eclipse. You'll know you have to do this if it says, "An SDK project must be specified."
If your screen looks like this, it means you haven't specified your SDK directory for Eclipse.
Step 1. Open Eclipse>Windows>Preferences
Step 2. Find the location of your SDK
Your Eclipse should then look like the following image, which now displays your build target.
Possible Error 2: While setting up a new project in Eclipse, you get the error: "
Package Name must have at least two identifiers
Click to expand...
Click to collapse
You need to enter the package name as: com.android.newproject and the project name must be one word only.
Reference:http://blog.gbinghan.com/2010/05/android-eclipse-package-name-must-have.html
Reference:http://www.nexus-nation.com/root-your-nexus-one/9pngs-figured-out
Quote:
When you open a .9.png you do not see the guides, that is because they are hidden. When you want to add the guides to an image, you have to drag it into the draw9patch tool. Now the tool has a hidden secret i figured out.(not really hidden, but not well described) If you open an image with the .9.png extension it just opens it. But if you open an image without the .9.png extension, it adds 2 pixels to its width and height. These 2 pixels are for the hidden guides. For example the btn_default_normal_disable.9.png in framework is 44x48. But if you remove the .9 from the file name and drag it into the draw9patch tool it changes to 46x50. Which you will notice after you save the image from the draw9patch tool. Also it will add the .9 to the file name.
Howto: draw9patch
The idea of the draw9patch tool is very simple, you drag an image into it you create the guides and you save the image. But the guides are very specific and if you do not do them properly your image will look strange. So follow these few rules about the tool.
Remove the .9 from image name before you drag it into the tool.
The top and left side guides set where the image can be stretched. Where ever you put a guide is where the image will stretch. Do not put more then 2 next to each other.
The bottom and right side guides set the content area(where the text will go). Now you can only put the guides in the outer border, once the image is compiled this border will be hidden. The tool will not let you put any guides anywhere but the outside border. Now usually you will put a 1x1 guide on the top and left sides, on the right and bottom you want to draw a full line. I have tried putting multiple guides on the top and left but the aapt tool seems to stress out and crash before compiling.
Once you save the image the draw9patch tool should of added the .9 to the name. That is all to adding the guides to the image.
So now your saying ok, i have the image and i still see the guides. To get rid of these lines we need to compile them with Eclipse. Basically we add them to a project in Eclipse and create an apk. During the compile the aapt tool from the sdk will set the image back to its original resolution and hide the guides.
(I am hoping to figure out some command lines for the aapt tool so we can skip this step. But until then editing these .9s are a big pain in the arse!)
Howto: Compiling in Eclipse.
I am assuming you followed the link above for setting up Eclipse and can create a new Android project.
Once Eclipse is open you want to go to "File\New\Android project". Select "Create project from existing source". It should default to the path of the samples in your SDK directory, but if it doesn't just browse to them. I have been using my own project but any sample should be fine. Choose "Finish" and on the left hand side under Project Explorer, you will see the name of the project you opened. Expand the project, then Res and you will see the Drawable folder. You will want to drag your edited .9s here. Once all of the images are in the drawable folder you want to right click the top level folder(Project name) for your project and choose "Android Tools"(second from botom) then "Export Unsigned Application Package..." Save the apk where ever you'd like, just remember where you put it. Cause you will want to open it and take the images out of the drawable folder. You will notice now that the guides are gone and the resolution is back to the normal size. Drag the images into your theme and you are done.
Click to expand...
Click to collapse
What's unPack.bat and quickPack.bat? As I told you on a PM, you have to compile that 9.png file. You can do that:
using apktool: decode apk using apktool, then add your 9.png and build apk back
creating new Android project: create it, add your 9.png, build, unpack, copy compiled 9.png - that method was described in a guide quoted by you.
or using aapt tool directly
Brut.all said:
What's unPack.bat and quickPack.bat? As I told you on a PM, you have to compile that 9.png file. You can do that:
using apktool: decode apk using apktool, then add your 9.png and build apk back
creating new Android project: create it, add your 9.png, build, unpack, copy compiled 9.png - that method was described in a guide quoted by you.
or using aapt tool directly
Click to expand...
Click to collapse
The aapt came with the unpack and quickpack.bat. Which were in the apktool kit. Unpack.bat. From what it said, decodes the apk file. It looks like it extracts it. Quickpack.bat puts the file back into an apk. Correct me if I'm wrong.
I ran the aapt.exe but it quickly ran cmd then exited before I was able to see what was done. There were no guides I could find on how to use it, which didn't help.
I'd really like to know how to use aapt. I'm sure that's much easier and faster than running Eclipse. Please advise.
**This link is the download page from which you sent me regarding the apktool. Inside it includes those bat files along with aapt.exe.
http://code.google.com/p/android-apktool/wiki/9PatchImages
http://code.google.com/p/android-apktool/downloads/list
raider3bravo said:
The aapt came with the unpack and quickpack.bat. Which were in the apktool kit.
Click to expand...
Click to collapse
Errr.. what? ;-D I'm an author of apktool and I'm pretty sure there are no such files ;-) For Windows there should be: apktool.jar, apktool.bat and aapt.exe .
raider3bravo said:
I ran the aapt.exe but it quickly ran cmd then exited before I was able to see what was done. There were no guides I could find on how to use it, which didn't help.
Click to expand...
Click to collapse
aapt is more advanced tool, but you could try it if you want. Do:
fake AndroidManifest.xml file - simplest manifest is: http://pastebin.com/ck2EPh6U , you can copy it.
create file structure:
Code:
AndroidManifest.xml
res/
drawable/
1.9.png
2.9.png
3.9.png
...
open terminal, cd to a directory with above files
run "aapt p -f -F out.apk -M AndroidManifest.xml -S res"
unpack out.apk and copy *.9.png files to your apk.
Thanks. I'll have to try this out and see if it's faster than Eclipse. You were right on the files not being in the link provided. I somehow got them mixed up. Here's where I downloaded that apktool that included the quickpack.bat and unpack.bat files.
http://forum.xda-developers.com/showthread.php?t=882742
Brut.all said:
Errr.. what? ;-D I'm an author of apktool and I'm pretty sure there are no such files ;-) For Windows there should be: apktool.jar, apktool.bat and aapt.exe .
aapt is more advanced tool, but you could try it if you want. Do:
fake AndroidManifest.xml file - simplest manifest is: http://pastebin.com/ck2EPh6U , you can copy it.
create file structure:
Code:
AndroidManifest.xml
res/
drawable/
1.9.png
2.9.png
3.9.png
...
open terminal, cd to a directory with above files
run "aapt p -f -F out.apk -M AndroidManifest.xml -S res"
unpack out.apk and copy *.9.png files to your apk.
Click to expand...
Click to collapse
I will definitely be putting this thread to use, I am just learning this stuff, so this will be very helpful. Thanks raider, you have been a wonderful help to me so far

[TUTORIAL]Guide to resizing apps to QVGA[STEP BY STEP]

Ok so a lot of you guys have been requesting a resizing tutorial so you can all help out on the new fresh roms like thenextsense and senseonfire.
Everyone gets directed to http://forum.xda-developers.com/showthread.php?p=6739512#post6739512 and get all confused because it doesn't actually explain much so I decided to post one written by me (I resize things in my rom, senseonfire)
Note: I am using linux Operating System and resizing to my HTC wildfire.
First off you are going to want to download apktool and the dependences for your operating system. It runs on windows, linux and mac OSX so it won't matter what OS you are running, you will be able to use it.
Once you have got apktool installed you are going to open terminal (or command prompt on your windows)
You are then going to navigate to the directory you installed apktool into:
Code:
cd /install...dir../apktool
Once that is done you are going to look at the rom that contains the app you are about to resize. You are going to open the rom archive and navigate to the framework
Code:
/system/framework/
and extract any files ending in .apk to the apktool dir
You are going to go back to the open terminal and type in
Code:
./apktool install-framework extracted_framework_filename.apk
or if you are on a windows computer
Code:
apktool install-framework extracted_framework_filename.apk
This will install the framework file/s so apktool can decompile stock apps correctly.
Once it installs correctly you are then going to choose the app you are going to resize. For the sake of this tutorial I am going to resize HtcMusic.apk
Navigate to the app folder in the rom archive
Code:
/system/app
and extract HtcMusic.apk to apktool dir
Then you are going to decompile the app to start resizing
In the still open terminal you are going to type
Code:
./apktool d HtcMusic.apk
This will decompile the htcmusic to a folder in the apktool dir called HtcMusic
To make resizing easier you should grab your phone and open HtcMusic and see what needs resizing. Now this is where the trial and error comes in.
Navigate to the layout folder in HtcMusic
Code:
/res/layout
or
Code:
/res/layout-mdpi
and choose the .xml file you believe you are looking at on your phone screen. For example on the HtcMusic app if you are resizing the playback screen it would be audio_player.xml that you would have to edit.
Play with things that have sizes (y.y px) especially things that say layout_width=y.y px... change the y value to something smaller.
If there is something that has a value @dimen/... it means that the value is in the dimens.xml in the /res/values folder
If there is something that has a value @com.htc:dimen/... it means that the value is in the dimens.xml in the com.htc.resources.apk
Once you finish the changes you are going to have to recompile the app
Go back to the terminal app that you still should have open (if you don't you will have to open it and cd to the apktool dir)
type in this code (make sure you delete the HtcMusic.apk out of the apktool directory prior to doing this)
Code:
./apktool b HtcMusic HtcMusic.apk
if you get an error and you are on linux try this
Code:
sudo ./apktool b HtcMusic HtcMusic.apk
sudo chown [your username] HtcMusic.apk
Once you finish this you will have to sign your apk. The easiest way to do this is to use dsixda's kitchen's signing tool.
Once this is done you can either push the app to your phone using adb (this never works for me)
Code:
./adb push HtcMusic.apk /system/app
if that doesn't work
Code:
./adb remount rw
./adb push HtcMusic.apk /system/app
But if that causes HtcMusic to disappear like it did to mine you will have to use dsixda's kitchen to open the rom, add htcmusic, sign all apps, and cook the rom again, then flash it on your phone.(I will not type out how to do this, there are lots of threads on how to use the kitchen)
Actually you can do it a lot easier than flashing the whole ROM again. I will post how to do this soon [28/6/12]
Open the app and look what has changed (if any) and then try again till you get it right. Trust me it takes a long while to get it right so don't expect for it to be right on your first go
Oh and if this helped you hit thanks!
APK Manager
There is an app called APK Manager that will make this easier i think it is just for windows but i don't know there might be a linux version
if this is helpfull remember to THANK
linux too http://forum.xda-developers.com/showthread.php?t=695701
Nice ! (ADB works never for me to )
THanks for the tutorial Vigidroid
I am new to this followed your steps perfectly but couldn't find any file with extension xml
I am on windows 7 all files are .smali extension
Can you elaborate a little ...Thanks
Edit :weird but works now
hey guys i'm a complete noob
i did follow all of d above steps and i'm stuck on d "AndroidManifest.xml" ... i'm not able 2 open d xml !!!!! it gives me a phrasing error( in mozilla) and an "encoding error"(in jedit)
could some 1 pls help me out !!!
thankya in advance
You must be trying to open up a .xml file that hasn't been decompiled yet. Try using apktool again to decompile all the contents of the app and then you should be able to open all .xml files correctly.
Opening the android manifest that has been decompiled:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Opening the android manifest that hasn't been decompiled:
hi VigiDroid,
thanks for all the work you do for our wildfires. ive tried, unsuccessfully to use apktool a few times so i can learn how to resize apps. i cant even get to open apktool.
i downloaded the apktool1.4.3.tar.bz2 and apktool-install-wind...,tar.bz2 and unpacked them onto a folder on my desktop (windows xp). in the tut you say to install apktool, i assume you mean to open the tar files to a folder?
when i open a command and try and run apktool i keep getting a syntax error message. i have the apktool ms-dos batch file and executable jar file with the aapt file in a folder on my desktop called (not very originally ) "apktool" so i typed into the command box
cd/C:\Documents and Settings\KnK\Desktop\apktool/apktool
as instructed in your tut ie cd /install...dir../apktool. install directory being C:\Documents and Settings\KnK\Desktop\apktool.
any help would be appreciated. ive attached a screen shot of the command promt
Here's a couple of guides I followed in the beginning. First one is for setting up java, adb http://forum.xda-developers.com/showthread.php?t=879701
Second is for apk multi tool, it used to be apk manager, install this after setting up java and the Android-sdk, its basically apktool but with a gui. Great tool for beginners.http://forum.xda-developers.com/showthread.php?t=1310151
There is another one I used for just setting up apktool but I can't find it so have a crack with the multi tool.
Sent from my HTC Wildfire using xda premium
Nice 1 Scratch, as always there with a helping hand for our little wildfire community. Thanx m8
Sent from my Wildfire using xda premium
... on the learning progress , my dream is to be a chef and share my work here ... thx for the tutorial it really help me a lot ..
Sent from my Wildfire using Tapatalk 2
Does anyone know why do I always get errors on compiling with apktool ? I have java installed for sure, I installed the framework , got no problems with the decompiling and then it just wouldn't build up :X
P.S. I was trying to edit one layout xml in this apk ,but no success. Would be really grateful if someone can compile it for me :S

[GUIDE][GB] How to use UxpNxtLockscreen.apk on GB ? - with lockscreen music control

Hey guys, finally I started successfully using Xperia Sola apks on my Xperia arc stock 42 rooted phone..
Tested on Xperia arc(Sola apks), LWW(Sola,Go apks both) and must work on other devices too.
UPDATED GUIDE:
Note: When u did all steps if you still dont have a working lockscreen just try going for Xperia Go apks and android.policy.jar of Xperia Go!
I dont share a flashable zip file because I use Xperia arc, you use Neo, LWW etc.. This is a guide for you to make yourselves.
- First download the FILES.rar which includes all necessarily files,on the link.
http://www.mediafire.com/?obrb493z1x4ayza
- On the phone, go to system/framework and copy android.policy.jar to your desktop.
In pack, I added baksmali-smali folder/files for you to edit your classes.dex file of android.policy.jar
1- Open your android.policy.jar file with 7zip (right click-7zip-open archive) and then drag&drop classes.dex file to BAKSMALI-SMALI folder.
2- Run CMD in that folder and write this code and enter >> java -jar baksmali-1.3.3.jar -o classout/ classes.dex
Classout folder must be generated. Go to BAKSMALI-SMALI\classout\com\android\internal\policy\impl
3- Copy ExternalLockScreen.smali and LockPatternKeyguardView.smali files which are in MY FILES.RAR pack , inside ../impl folder. (LockPatternKeyguardView will overwrite)
4- Delete classes.dex file in BAKSMALI-SMALI folder and run CMD again and write this code and enter again>> java -jar smali-1.3.3.jar classout -o classes.dex
5- Now your new classes.dex file is ready. just open archive your android.policy.jar file with 7zip again and drag&drop new classes.dex in it..
-Second you will find Xperia_Sola_app_files folder in FILES.RAR pack. It includes Xperia Sola Settngs.apk and UxpNxtLockScreen.apk files.
Normally just copy these files to system if you use root explorer, set permissions & move system/app folder and android.policy.jar to framework folder. reboot and All done! Alternative way is Android Commander PC programme.
>> But I dont suggest you to use Settings.apk of Xperia Sola. It has bug on brightness. best way is decompiling your own Settings.apk with apk manager/tool (best working Wanam's apk manager ICS on GB) and adding lines from Xperia Sola Settings.apk display settings to your own apk. Sorry I don't have much time to explain editing XML on apk manager /compiling/ decompiling it..
If all is ok here is the picture ;
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If it doesn't work; u must edit your framework-res.apk (/system/framework/framework-res.apk)
These are quoted from Sudanminipro's topic which is here >> http://forum.xda-developers.com/showthread.php?t=1837501
a)DECOMPILE your framework-res.apk
b)Add this line to the AndroidManifest.xml >> <permission android:label="@string/permlab_external_lockscreen" android:name="com.sonyericsson.permission.EXTERNAL_LOCKSCREEN" androidrotectionLevel="signatureOrSystem" android:description="@string/permdesc_external_lockscreen" />
c)Add these lines to the end of the strings.xml (/res/values/strings.xml) >>
<string name="permlab_external_lockscreen">You May Write Anything Here</string>
<string name="permdesc_external_lockscreen"> You May Write Anything Here </string>
d)Add these to the end of string names in public.xml (/res/values/public.xml) >> <public type="string" name="permlab_external_lockscreen" id="0xXXXXXXXX" />
<public type="string" name="permdesc_external_lockscreen" id="0xXXXXXXXX" />
the important thing is XXXXXXXX hex codes should be written in a way as a continuation of the codes that was above..
0x0104051b,0x0104051c for example..
e)RECOMPILE. Thats it.
Click to expand...
Click to collapse
Bugs:
- Settings.apk Lockscreen menu allows you to change your lockscreen wallpaper but it has low quality.
Bugfix: go into Settings.apk display settings and Lockscreen control, select a new wallpaper, then on computer find a wallpaper which u want to use and set pixels and save it as named wallpaper.PNG . On the phone go into data/data/com/sonyericsson.uxplockscreen folder and copy wallpaper.png inside it.. finally just try a few time screenoff&on.. Must be ok.
- Facebook notifications don't work!
- Don't work on landscape mode!
- You tell me more..
I'm not a developer, just modding my Xperia arc.. If any developers can help for these bugs, that will be great..
Cheers! If this is helpful for you please use thanks button.
Special thanx to Orochixxx for .smali file names and Sola system folder..
then all must be ok. Thanks & Regards AeonWorld for his tutorial and Sudanminipro for their work..
Good job :good:
one question , will it work on cm9 ??
Sent from my Arc S using Tapatalk 2
XnightX said:
one question , will it work on cm9 ??
Sent from my Arc S using Tapatalk 2
Click to expand...
Click to collapse
No mate, is CM9 a GB rom??
Nope
Sent from my Xperia Neo V with Supercharged ICS 4.0.4
can you make please a flashable zip arhive ?
Did all the steps, but Lockscreen didn't change! It's same as before. Using Zohaib's Xperia S GB ROM.
soumya_digi said:
Did all the steps, but Lockscreen didn't change! It's same as before. Using Zohaib's Xperia S GB ROM.
Click to expand...
Click to collapse
Same here Using stock .62 fw.
soumya_digi said:
Did all the steps, but Lockscreen didn't change! It's same as before. Using Zohaib's Xperia S GB ROM.
Click to expand...
Click to collapse
Same here. Using stock .42, Xperia Play.
i confuse on your steps , like " copy classes.dex file to folder, run CMD and enter code: java -jar baksmali-1.3.3.jar -o classout/ classes.dex
"To where I must copy classes.dex file ( what folder ) ?, And I cannot run java -jar baksmali-1.3.3.jar -o classout/ classes.dex ( it said unable to..............)
I will try this today, thought I never decompiled anything...we need a developer to make flashable .zip for this :/ ... at least I'll learn something new xD.
Using back smali and smali is a complicated method, instead of that you guys can use x10modtool here http://forum.xda-developers.com/showthread.php?t=842060 to decompile and recompile android.policy.jar
Sent from my SK17i using xda premium
No classes.dex in my android.policy.jar??? Can anyone post a screenshot of their decompiled android.policy.jar folder?
I only see bunch of .smali files in that .jar ... Edit: works with winrar, that x10modtool won't work with classes.dex, but thx anyway
EDIT: Dude... no way... where to put that externallockscreen.smali and other file... in classes.dex? in baksmali-1.3.3.jar? How? Please update the tutorial, I want this lockscreen.
And me too...
topic updated..
Can we port the ics lockscreen with shortcuts on lockscreen....?????can we do it in gb with shortcuts on lockscreen..????
If I could post my framework-res.apk here, coukd any of you decompile it, add those lines p is a p), recompile and post it back here. I'm having a problem recompiling the framework-res.apk with the x10modtool posted earlier.
Thanks
HussainQ said:
If I could post my framework-res.apk here, coukd any of you decompile it, add those lines P is a p), recompile and post it back here. I'm having a problem recompiling the framework-res.apk with the x10modtool posted earlier.
Thanks
Click to expand...
Click to collapse
Me too, if I click recompile it makes a new folder in "rec" folder but it is empty...
Erhany, please, do me a favour....
I'm giving you my classes.dex from android.policy.jar, and 2 smali files from your pack (to make it easier for you ).
Why?
Because classout folder doesn't show up after the first command and I can't edit classes.dex ... I guess this is an easy step to you because it is working for you. So please edit it for me and reupload here, this mod is killing me :crying:
Other steps are easier, but if it comes to recompiling framework-res, I quit .
This mod never work
Maybe there is one more needed file that is missing
framework-res.apk,
android.policy.jar,
UxpNxtLockScreen.apk,
Settings.apk,
framework.jar (tryed it but nothing)
But the old lock screen is still there?
maybe we need a lib file?
XMP 2.3.4.....58
Guys Im so sorry for cant helping you. I work 12hours in a day and being so tired and dont have time for modding..
I use this files in my Xperia Arc and if u do not use any special mod, jus try loading Xperia Arc Big Pack v3.. I have it now and didnt add any lines for framework-res or etc..
Just backup your whole phone and try this arc big pack v3 mod.. After that use my files.. It will work %100..
When I have time, I will try to recompile your files..
Sorry and good moddings..

[LEARN] modding apks the easy way!

Hi friends of XDA,
today, i present you a easy method (more like a idea) on how to learn about what is actually modified in a apk and help you to
get an idea about creating your own mod by understandig other mods.
first is first!
#include
/*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because of you following this guide.
* do some research if you have any concerns.
* YOU are choosing to make these modifications.
* you cannot point the finger at me for messing up your device.
* yes, i copied this disclaimer from FXP coz itz cool and i am lazy!
*/
okay now let´s get started,
things you need,
1. apktool
2. WinMerge (WinMerge is Open Source software under the GNU General Public License)
3. a modded apk and it's original untouched unmodded apk for your device.
4. A LOT OF PATIENCE (learning modding apks is not so easy).
step by step,
1) apktool part,
1.1) install framework-res.apk, SystemUI.apk, SemcGenericUxpRes.apk in apktool
.
NOTE: below, any apk can be used, i'm using SystemUI.apk as a example.
1.2) decompile and compile both the original SystemUI.apk pulled from your device and the SystemUI.apk from the mod
which you are going to learn what has been changed.
NOTE: step 1.2 is done to make sure that the apktool you are using is comaptible with your apks if it throws errors
while compiling and/or decompiling unmodified system apks then use a different version of apktool which works with your
device and version of android you are going to use (google it).
1.3) after succesfully installing required apks and testing the apktool, clean the apktool folder (remove decompiled apk folders and
remove unwanted apks from the folder).
1.4) copy the pulled original SystemUI.apk from device (or pull it again) to apktool folder and rename it to make you remember that it
is the original apk (i named it as SystemUI_ori.apk).
1.5) copy the modded SystemUI.apk from the mod and rename it to make you remember that it is the modded apk
(i named it as SystemUI_mod.apk).
1.6) decompile SystemUI_ori.apk and SystemUI_mod.apk.
2) winmerge part,
2.1) open winmerge
click open
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2.2) you'll get the following window (select files and folders)
2.3) in the left and right path box type in your path to the decompiled original and modded apks directory.
as shown below and click ok (ok button will be only visible if you choose two valid directories)
2.4) now the two directories you selected will be opened and their similarities in files and
directories will be displayed in the comparison result column as shown below,
2.5) the comparision result column will display what type of file it is and whether they are different or identical as shown below,
2.5) if the file or directory is only present in one directory of the two selected directories (see 2.3) then the comparision result column
will show as highlited in the below image.
2.6) from 2.4 and 2.6 you can easily determine what files have been edited and/or added by the modder to achieve the corresponding
changes in the mod.
2.7) Now when you double click the file which is present in both the left and right directories, those files will be opened and their
differences will be highlighted.
for example let us open a text file (normally all files are text type in a decompiled apk except images) whose comparison result
show that they are different,
the text file in both left and right opens side by side and the lines which contains the differences will get highlighted in yellow,
the part of the line which is actually different from one another will be highlighted in light yellow as shown below.
NOTE: since the apk is decoded by apktool, the files will be always in human readable source form so just by looking at the differences in the
text we can get a clear picture on what is changed in the file and how does it impact in the final modded apk. If you yourself have a good
knowledge of xml and java it'll be a breeze for you to understand it!
you can also copy the whole changes of one file to another or just copy the changes line by line, to learn more about this see the further
reading part below.
3) PLEASE do not ask me about apktool errors or what to edit in a apk to get this etc., type of questions
i'm still in the nascent phase of learning about modifying apks and theming, i am using this method to learn so i am recommending this
to interested friends.
4) if you have doubts and/or errors in using apktool post here.
FURTHER READING:
5) I HAVE COVERED ONLY THE VERY BASICS OF LEARNING MODDING USING WinMerge.
to learn more about the shortcuts and functionalities of winmerge read winmerge quick guide and complete guide..
CREDITS:
authors of winmerge
authors of apktool
HAPPY LEARNING MODDING!
PLEASE PRESS THANKS IF THIS THREAD IS USEFUL!
fix urls
mv_style said:
fix urls
Click to expand...
Click to collapse
DONE man!
Damn awesome tut bro!!
Was manually comparing both files inside apk to find which file has been modified..
U made it easier for me..
Cheers:fingers-crossed:
ssanjay19 said:
Damn awesome tut bro!!
Was manually comparing both files inside apk to find which file has been modified..
U made it easier for me..
Cheers:fingers-crossed:
Click to expand...
Click to collapse
thanks sanjay
Apktool doesnt open on my pc. It just shows up for a sec and then disappears!
thejkamath said:
Apktool doesnt open on my pc. It just shows up for a sec and then disappears!
Click to expand...
Click to collapse
Install java first,
In win7 open the directory where you placed the apktool.jar , hold shift and right click inside the folder, in the menu click "open command window here" and in the command window type,
java -jar apktool.jar
Click to expand...
Click to collapse
In xp
Open command prompt change directory to the apktool.jar directory and type the above quoted.
Hit thanks if I helped you.
Sent from my ST15i using xda app-developers app
Sir I can't see the pictures u have posted... fix their links please
Thanks

[Tutorial] Decompile/Recompile Apk with Apk Multitool + Decompile/Recompile Jar Files

" This thread will cover various useful guides starting from how to Decompile/Recompile Apk & Jar files. Me & my friend Aneel will provide new guides/tutorial day by day so that you guys can get many handy guidance in one place. Please Suggest us If you need any guide & we will try to post it If we actually can. Also If you find our guides useful then support us my giving feedback, hitting thanks & adding in credits section "
1st Let's start with [How to decompile & recompile with Apk Multitool]:
*Requirements*
Latest Java
Latest JDK+JRE (get everything from http://www.oracle.com/technetwork/java/javase/downloads/index.html)
Apk Multi Tool (Download from attachment)
Steps
1. Unzip Apk Multi Tool into a folder
2. Now run Setup.bat. It will look like this
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
3. Now choose 3. Setup Directories & press enter
4. This will create the folders needed. It will look like this
5. Now place the apk you want to decompile in place-apk-here-for-modding
6. Place a framework-res.apk, SemcGenericUxpRes.apk & SystemUI.apk in other folder. Preferebly it should be from the same package of apk/same apks of a Rom which you placed in the place-apk-here-for-modding folder. If there is no corresponding apks then you can try with other framework & systemUI apks also.
7. Now again run Setup.bat & press enter & choose 2. Installing Framework-Res. It will look like this
8. Now choose option 1 & enter to install framework & again option 4 & enter to install SystemUI
9. Now run Script.bat & press enter to activate various menu. Choose option 9 to decompile the apk. Then press enter. It will look like this
10. Once decompile is complete close the script & go to projects folder
11. Do the necessary changes you want to
12. When editing is done again run Script.bat
13. Choose option 11 to recompile & press enter. It will prompt a message after sometimes, Aside from the signatures....of errors (y/n)
14. Input y & press enter
15. Now after sometimes, it will again ask you to delete everything you have modified from keep folder & also delete resources.arsc if you have modified any xml. Minimize the script, delete the xml(s) you have modified (other than from values folder, it won't appear in keep folder) & also resources.arsc. If you have modified any png (not added) then delete it too. Then press enter when you are ready.
16. Now your new apk is ready. You can find it in place-apk-here-for-modding folder. Note that, your original apk will also be in the same folder with original name. Your modified apk will have System_ attached in the name.
17. Copy it to some other place & rename to original apk name & enjoy.
18. When you want to work on the next project then delete everything from place-apk-here-for-modding & projects folder. Now follow the same steps again from Number 5 of this guide.
[How to decompile & recompile Jar Files]:
*Requirements*
Winrar/7zip
Deodexed Jar files
smali.jar
baksmali.jar (both are in the attachment)
Command Prompt/Terminal
0. Take the classes.dex from jar file by opening it with 7zip/Winrar.
1. Open a new folder in Desktop named suppose "Jar"
2. Place smali.jar & baksmali.jar in the folder
2. Open Command Prompt. On windows type cmd in Run
3. cd to your directory where you have opened the new folder. In my case it is
Code:
C:\Documents and Settings\USER\Desktop\Jar
4. Write
Code:
cd C:\Documents and Settings\USER\Desktop\Jar
& press enter. Note that, on your case the directory will be different from mines. So get the correct directory by going into that directory from C:
5. Now type this to Decompile. Note that, there is a "space" before "classes.dex"
Code:
java -jar baksmali.jar -o classout\ classes.dex
& press enter
6. When Decompiling is done there will a folder named "classout" be placed in Jar folder. Minimize the cmd.
7. Now make the necessary changes inside the classout folder
8. When done,type this to recompile & press enter. Remember, there is a "space" before "new-classes.dex"
Code:
java -Xmx512M -jar smali.jar classout\ -o new-classes.dex
9. When recompiling is done there will be a new file in the folder named "new-classes.dex"
10. Now rename new-classes.dex to classes.dex & put it in the jar file with 7zip/Winrar
..............That's All. Thank You.................
​
Credits:
@raziel23x for Apk Multitool
@iONEx for teaching me about Apk Multitool when I was a noob
@Hero for Decomping jar files concept
Nice share... BTW, can mod MiuisystemUI.apk with this tool? I've heard Miui uses different aapt.
Aciong.Aksaya said:
Nice share... BTW, can mod MiuisystemUI.apk with this tool? I've heard Miui uses different aapt.
Click to expand...
Click to collapse
yes you can just follow this cause miui has more than one framework-res.apk & you don't need twframework in this case http://forum.xda-developers.com/showthread.php?t=2306397
saqib nazm said:
yes you can just follow this cause miui has more than one framework-res.apk & you don't need twframework in this case http://forum.xda-developers.com/showthread.php?t=2306397
Click to expand...
Click to collapse
The tool is great but I can't seem to do what should I do the centered clock for MiuisystemUI.apk I can't seem to find decent tutorial.
Aciong.Aksaya said:
The tool is great but I can't seem to do what should I do the centered clock for MiuisystemUI.apk I can't seem to find decent tutorial.
Click to expand...
Click to collapse
here is the guide http://en.miui.com/thread-4353-1-1.html
Hell there is an error in your compiling code of your smali/jar
it should be "-o new-classes.dex"
Razor! said:
Hell there is an error in your compiling code of your smali/jar
it should be "-o new-classes.dex"
Click to expand...
Click to collapse
Right! Thanks Razor,now it's correct :good:
saqib nazm said:
Right! Thanks Razor,now it's correct :good:
Click to expand...
Click to collapse
Welcome
Press thanks if you like my work/advice
@saqib nazm, it would be good if you add tut on how to recompile apks after making changes in androidmanifest.xml.. Because I have observed it gives bootloops.. As signing of apps just puts meta inf and doesn't do anything to androidmanifest.. Just a suggestion..
Sent from my MT11i using xda premium
sandy7 said:
here is the guide http://en.miui.com/thread-4353-1-1.html
Click to expand...
Click to collapse
Ive been into that place if you knew david guetta face in the thread thats me. Thanks for your kindness to redirect me. The OP is not just very much accommodating geez...
Aciong.Aksaya said:
Ive been into that place if you knew david guetta face in the thread thats me. Thanks for your kindness to redirect me. The OP is not just very much accommodating geez...
Click to expand...
Click to collapse
I suggested you to install the proper framework files to decompile miui stuffs properly, though this thread is for compiling & decompiling with apk multi tool,not how to center clock on miui I beg your pardon? & I didn't say anything else because sandy already directed you to a guide, that's probably I would also gonna do If I were in the 1st place like sandy replied. You cannot say words which can hurt other people. Cause If I would know how to "Center clock on miui" I would open a thread with that guide,isn't it?
First of all,Thank you for work but I have a lot of problems.Can you help me about thats? I did everything step by step.No problems with 1 to 6 steps.I placed the apk place-apk-here-for-modding and I placed a framework-res.apk, SemcGenericUxpRes.apk & SystemUI.apk in other folder.
After that,in step 7&8,when I choose option 1 & enter to install framework & again option 4 & enter to install SystemUI,I get this screens
So,in step 9,Run Script.bat & press enter to activate various menü choose option 9 to decompile the apk. Then press enter,I get errors like this
And so,projects folder is empty.What is the problem and what can I do?
Mazellat said:
First of all,Thank you for work but I have a lot of problems.Can you help me about thats? I did everything step by step.No problems with 1 to 6 steps.I placed the apk place-apk-here-for-modding and I placed a framework-res.apk, SemcGenericUxpRes.apk & SystemUI.apk in other folder.
Click to expand...
Click to collapse
that could be a problem with that apk, you cannot decompile it. If you have done all the steps properly as you said can you try with any other apk? so to be sure if that's the problem with that apk
Aciong.Aksaya said:
Ive been into that place if you knew david guetta face in the thread thats me. Thanks for your kindness to redirect me. The OP is not just very much accommodating geez...
Click to expand...
Click to collapse
saqib nazm said:
I suggested you to install the proper framework files to decompile miui stuffs properly, though this thread is for compiling & decompiling with apk multi tool,not how to center clock on miui I beg your pardon? & I didn't say anything else because sandy already directed you to a guide, that's probably I would also gonna do If I were in the 1st place like sandy replied. You cannot say words which can hurt other people. Cause If I would know how to "Center clock on miui" I would open a thread with that guide,isn't it?
Click to expand...
Click to collapse
Hi Saqib Nazm, Yes it it but this is a full misunderstanding. The OP I am referring to is the OP on the link that Sandy gave.
Mea Culpa...
Aciong.Aksaya said:
Hi Saqib Nazm, Yes it it but this is a full misunderstanding. The OP I am referring to is the OP on the link that Sandy gave.
Mea Culpa...
Click to expand...
Click to collapse
Oh ok I am extremely sorry then. Have a nice day
Hi saqib i want to ask again. If I make own fragment in settings_header.xml. How?
Sent from my LT25i using xda premium
danisariandi said:
Hi saqib i want to ask again. If I make own fragment in settings_header.xml. How?
Sent from my LT25i using xda premium
Click to expand...
Click to collapse
bro I have told you how to do it that day in the original thread, which part you didn't understand? You asked about smali files, you don't need any smali files man.
Kjkkkkkkkkk
poria1999 said:
Hi all members
I have some problem in recompiling apk files...
When i compile apk and delete resources.arsc+xmls that i have modified them,anything didnt change in apk ...
i am working on framework-res.apk ...
please helpe me...
Click to expand...
Click to collapse
what were you trying to change? & what you did?
Yyyyyyyyyyyyyyyyyyyyyy

Categories

Resources