This is just a simple tutorial about enabling screen rotation to apps that do not rotate automatically when you turn your device. It is really a TUT on how to open an apk and edit the androidmanifest.xml file. Pretty simple.
Easy:
1. Decompile the Application.apk with apktool
2. Edit the androidmanifest with Notepad++
3. Build the Application.apk with apktool
4. Sign the apk with autosign.
Click to expand...
Click to collapse
Detailed:
You will need some tools:
************************************************************
Android SDK: http://developer.android.com/sdk/index.html
APK Tool: http://code.google.com/p/android-apktool/
Notepad++: http://notepad-plus-plus.org/
A signing tool: Google "auto-sign apk"
An archiving tool: Plenty of them out there cable of .zip files
After you get this figured out, move on to step 1.
************************************************************
I do this from my desktop, so this is written as such.
Step 1. Decompile the Application.apk with apktool
___________________________________________________________
A. Open cmd.exe
B. Type apktool d C:/users/desktop/Netflix1.4.apk
(this refers to your desktop, so type the correct address for YOURS. However, I do not type, I drag and drop the Netflix.apk from my destop onto the cmd window)
C. Add a space then add destination directory "C:/users/destop/Netflixmod"
Again, your address of wherever you are working, and whetever you want to call the destination folder. For this I also drag and drop the same file, and just remove the .apk text.
D. Hit enter
Code:
apktool d C:\users\desktop\Netflix1.4.apk "C:\users\desktop\Netflixmod"
Your desktop address will be different than what I have typed, your Netflix app or whatever app you are decompiling will be different and your destination address and directory name will be different. DO NOT COPY PASTE THIS CODE INTO YOUR CMD LINE.
Click to expand...
Click to collapse
Step 2. Edit the androidmanifest with Notepad++
___________________________________________________________
This is for Netflix 1.4
In the folder that you just created on your desktop (or wherever you are working) There is a file called androidmanifest.xml
Open this file with Notepad++ and edit the following lines:
Change line 5: android:screenOrientation="portrait" to android:screenOrientation="sensor"
Change line 29: android:screenOrientation="landscape" to android:screenOrientation="sensor"
Save the file.
Click to expand...
Click to collapse
Step 3. Build the Application.apk with apktool
___________________________________________________________
Similar to decompiling:
A.
Code:
apktool b C:\users\desktop\Netflixmod
This will build the application in the same folder that you are working in (i.e. "Netflixmod" folder) You can specify a new directory if you want, but I do not.
There will now be a folder named "Build" within the "Netflixmod" folder.
B. Copy the "Assets" folder into the "build" folder. (apktool leaves this out, but it is important).
C. Zip the contents of the build folder into a .zip file called apk.zip. (do not zip the Build folder, just everything inside of it INCLUDING THE ASSETS FOLDER!)
D. Rename the apk.zip file to apk.apk file.
Click to expand...
Click to collapse
Step 4. Sign the apk with autosign.
___________________________________________________________
Well, sign the app with some signing tool that you are comfortable with.
Just google auto-sign apk, there are plenty of options. Cant find the link towhat I use. Please feel free to post an easy signing tool here if you want it added.
Click to expand...
Click to collapse
**************************************************
Here is all of the code that I changed in the Netflix1.4 app to enable rotation and fix graphic bugs.
You can copy paste this into a text editor like Notepad++ and save as /.xml files. Then replace the files in your decompiled app with these. Or you can download the text file attached and create separate files out of each section of code.
New Netflix 1.4 Updated 9/09/2011
BELOW ARE THE FILES THAT NEED TO BE EDITED TO ENABLE ROTATION AND AVOID GRAPHICS BUGS.
TO CHANGE COLOR, EDIT THE "#ffb9090b" TO ANOTHER HEX COLOR. IN ALL FILES EXCEPT FOR THE ANDROID MANIFEST.
───────────────────────────────────
Android Manifest.xml:
───────────────────────────────────
Change line 5: android:screenOrientation="portrait" to android:screenOrientation="sensor"
Change line 29: android:screenOrientation="landscape" to android:screenOrientation="sensor"
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="259" android:versionName="1.4.0 build 259" android:installLocation="auto" package="com.netflix.mediaclient"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:theme="@android:style/Theme.NoTitleBar" android:label="@string/app_name" android:icon="@drawable/icon" android:name=".NetflixApplication" android:debuggable="false">
<activity android:label="@string/app_name" android:name=".UIWebViewActivity" android:enabled="@bool/phone" android:finishOnTaskLaunch="false" android:clearTaskOnLaunch="true" android:launchMode="singleTop" android:screenOrientation="sensor" android:configChanges="keyboardHidden|orientation" android:alwaysRetainTaskState="true" android:allowTaskReparenting="true" android:windowSoftInputMode="stateVisible|adjustResize" android:noHistory="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="nflx" android:host="www.netflix.com" />
</intent-filter>
</activity>
<activity android:label="@string/app_name" android:name=".UIWebViewTabletActivity" android:enabled="@bool/tablet" android:finishOnTaskLaunch="false" android:clearTaskOnLaunch="true" android:launchMode="singleTop" android:configChanges="keyboardHidden|orientation" android:alwaysRetainTaskState="true" android:allowTaskReparenting="true" android:windowSoftInputMode="stateVisible|adjustResize" android:noHistory="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="nflx" android:host="www.netflix.com" />
</intent-filter>
</activity>
<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:label="@string/app_name" android:name=".PlayerActivity" android:screenOrientation="sensor" android:configChanges="orientation" android:noHistory="false" />
</application>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.wifi" android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11" />
</manifest
\res\layout folder
playout_splash.xml
───────────────────────────────────
<!--
Edited Line 4: android:layout_gravity="bottom|center" to android:layout_gravity="center"
removed android:layout_marginBottom="150.0dip"
Edited Line 5: android:layout_marginBottom="100.0dip" to android:layout_marginBottom="90.0dip"
Dblfstr
-->
Code:
<?xml version="1.0" encoding="UTF-8"?>
<FrameLayout android:orientation="vertical" android:id="@id/top_panel" android:background="#ffb9090b" android:visibility="visible" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:layout_gravity="center" android:id="@id/logo" android:visibility="visible" android:layout_width="202.0dip" android:layout_height="62.0dip" android:src="@drawable/logo_splash" />
<ProgressBar android:layout_gravity="bottom|center" android:id="@id/pb_loading" android:visibility="visible" android:layout_width="30.0dip" android:layout_height="30.0dip" android:layout_marginBottom="90.0dip" android:indeterminate="true" android:indeterminateOnly="true" android:soundEffectsEnabled="false" style="?android:progressBarStyleSmallInverse" />
<TextView android:textSize="14.0dip" android:textColor="#ffffffff" android:layout_gravity="bottom|center" android:id="@id/label_loading" android:visibility="visible" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="50.0dip" android:text="@string/label_ps_loading" />
<!--
Edited Line 4: android:layout_gravity="bottom|center" to android:layout_gravity="center"
removed android:layout_marginBottom="150.0dip"
Edited Line 5: android:layout_marginBottom="100.0dip" to android:layout_marginBottom="90.0dip"
Dblfstr
-->
</FrameLayout>
\res\layout folder
ui_splash.xml
───────────────────────────────────
<!--
Edited Line 4: android:layout_gravity="bottom|center" to android:layout_gravity="center"
removed android:layout_marginBottom="150.0dip"
Edited Line 5: android:layout_width="wrap_content" android:layout_height="wrap_content" to android:layout_width="30.0dip" android:layout_height="30.0dip" and "android:layout_marginTop="80.0dip"
Dblfstr
-->
Code:
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout android:id="@id/FrameLayout" android:background="#ffb9090b" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:layout_gravity="center" android:id="@id/logo" android:visibility="visible" android:layout_width="202.0dip" android:layout_height="62.0dip" android:src="@drawable/logo_splash" android:layout_centerInParent="true" />
<ProgressBar android:id="@id/ui_load" android:visibility="visible" android:layout_width="30.0dip" android:layout_height="30.0dip" android:layout_marginTop="80.0dip" android:indeterminate="true" android:indeterminateOnly="true" android:layout_below="@id/logo" android:layout_centerInParent="true" android:soundEffectsEnabled="false" />
<!--
Edited Line 4: android:layout_gravity="bottom|center" to android:layout_gravity="center"
removed android:layout_marginBottom="150.0dip"
Edited Line 5: android:layout_width="wrap_content" android:layout_height="wrap_content" to android:layout_width="30.0dip" android:layout_height="30.0dip" and "android:layout_marginTop="80.0dip"
Dblfstr
-->
</RelativeLayout>
\res\layout folder
webview.xml
───────────────────────────────────
<!--
Edited line 2; android:background hex values
-->
Code:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:orientation="vertical" android:id="@id/address" android:background="#ffb9090b" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="vertical" android:id="@id/go_button" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<WebView android:id="@id/ui" android:background="@drawable/splash" android:visibility="visible" android:scrollbars="none" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</LinearLayout>
<!--
Edited line 2; android:background hex values
-->
</LinearLayout>
all of this code is found in the attached .txt file. Remember to save each bit of code as a separate file and replace in your Netflix.apk.
and i need this
should take this
for us NON programmers, anyway you (or someone else) can actually post a modified apk?
OK, so I tried to modify these .xml files... so far, I haven't been able to open them up successfully. So my noob-ish question is, "what editor do I use to open these up?" Standard XML editors found in Windows/Office doesn't show them right.
Or can I just replace the files altogether by copying and pasting the stuff in the post? ... I will try that first, I guess...
Update1:
So I extracted the files for editing, and then replaced all the lines in those files (which by the way, opened up to show some weird encoding) using Notepad++ ... I was able to replace all the stuff anyways, and I saved it. Re-packed the apk... Nothing changed. What am I missing??
Update 2:
I think my problem now is finding out how I can recompile the file and be able to either keep the signature or make a valid signature. I say this because now all I get when I try to install the modifed apk it says "error parsing file" or "... not signed correctly"
I give up! I tried and took a few shots at it, but I guess I am missing something. Oh well...
http://forum.xda-developers.com/showthread.php?p=17446113#post17446113
All Credit goes to Dblfstr!
Sent from A Van Down By The River!
Worked like a charm dblfstr. Thanks.
Whew, exactly what I needed. Thanks again. I guess I'LLC leave all the Modding stuff to the seasoned folks.
Simple tutorial added.
Suggestions welcome
Thanks
bklizard said:
OK, so I tried to modify these .xml files... so far, I haven't been able to open them up successfully. So my noob-ish question is, "what editor do I use to open these up?" Standard XML editors found in Windows/Office doesn't show them right.
Or can I just replace the files altogether by copying and pasting the stuff in the post? ... I will try that first, I guess...
Update1:
So I extracted the files for editing, and then replaced all the lines in those files (which by the way, opened up to show some weird encoding) using Notepad++ ... I was able to replace all the stuff anyways, and I saved it. Re-packed the apk... Nothing changed. What am I missing??
Update 2:
I think my problem now is finding out how I can recompile the file and be able to either keep the signature or make a valid signature. I say this because now all I get when I try to install the modifed apk it says "error parsing file" or "... not signed correctly"
I give up! I tried and took a few shots at it, but I guess I am missing something. Oh well...
Click to expand...
Click to collapse
Simple tutorial added that may assist you.
Yes, the app has to be decompiled before you can edit the .xml files.
You will need to build the app after you made your changes.
Then zip the app
then sign the app.
[APP][UPDATE][Netflix V1.4] Netflix Rotation Enabled Apps w/ Colored Loading Screens updated to Netflix 1.4 for those who do not want to attempt to add the rotation on your own.
Thanks
I saw this on the front page Congrats! I'm wondering if this was disable because there are several instances of tabbed views leaking activities when the orientation is changed. A good test would be to link up ddms to the app and repeatedly change the orientation and see if the memory gets eattin up.
Am I SOL if the screenOrientation="1" is in all the lines?
is it possible to to this with the touchwiz30 .apk?
WOW, made it to the portal. That is awesome. Hopefully someone can benefit from this thread.
Pacifik said:
Am I SOL if the screenOrientation="1" is in all the lines?
Click to expand...
Click to collapse
Not necessarily. To what app are you referring?
ChadBFlores said:
is it possible to to this with the touchwiz30 .apk?
Click to expand...
Click to collapse
Probably a little more difficult. Nothing is impossible, however.
Screen Orientation + High Resolution Support
Is it possible to do any of those steps directly on the device itself ? For those who don't have access to computers on a regular basis...
Also, would you know which property(ies) I would have to change to get an app to fill the whole screen instead of a small part surrounded by black bars ?
I'm referring to the Canadian Sirius Radio app... It used to render correctly on my Droid1/Milestone, but now with my Droid3/XT860, the screen resolution as changed and it doesn't seem to be "programmed" to support larger screen resolution (qHD).
If I can implement both fixes, yours and mine, I'll be a happy man !
Looks ok, but as a developer I can tell you that most apps will break because of faulty design. Setting stick orientation is a workaround for their lesser API knowledge used by many beginning developers. I did it myself, stopped doing that when I learned more. Most of hacked apps will experience memory leaks, some of them FCs.
Anyway idea is great
[TOOL GB/ICS/JB/KK] Decompile/Recompile apk & jar | Sign | Zipalign | Basic editing
hello everyone... I want to share the tool for editing apk, and making a slightly guide for decompile/recompile apk and basic editing xml/smali... and this guide and tool for Windows user...
REQUIREMENTS :
Download and Install on your computer
1. JDK here
2. 7zip here or Winrar (recommended) here
3. Notepad++ here
4. Android SDK for patch 9.png until Zipalign the apk here
5. Apktool & baksmali/smali + Signer for all GB/ICS/JB ROM here
6. Apktool & baksmali/smali + Signer for all GB/ICS/JB ROM v2 here
7. Apktool & baksmali/smali + Signer for all GB/ICS/JB/KK ROM v3 (4.4 Kitkat support/optimized) here
Save or extract apktool to folder directory :
Windows XP : C:\Document and Settings\folder your computer name\here
Windows 7 : C:\User\folder your computer name\here
CREDITS & BIG THANKS TO :
- Brut.all for apktool
- Team Reject for Quick baksmali/smali file
- Yorzua for Sign apk file
- Rizal Lovins for support me
- pantrif13
1. How to Decompile and Recompile *.jar file or classes.dex
- Copy *.jar file to apktool folder (make sure is the same folder). for example : android.policy.jar
- Open android.policy.jar using Winrar or 7zip and extract classes.dex file
- Drag & drop classes.dex to Quick-Baksmali.cmd (decompile process)
Screenshot example for Baksmaling/decompile classes.dex using drag & drop method :
{
"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"
}
- wait and you will see a folder with the name "classout"
- now you can start editing smali file on classout folder (use Notepad++ for editing it)
- After editing is complete, Drag & drop classout folder to Quick-Smali.cmd (recompile process)
Screenshot example for Smaling/recompile classout folder using drag & drop method :
- After recompile is complete, there will be a file with a name "new-classes.dex"
- Open android.policy.jar using Winrar or 7zip
- Rename new-classes.dex to classes.dex, and Drag & drop to android.policy.jar with normal compression
- finally, push back android.policy.jar into the system your device. push manual using root explorer/similar application or make a flashable zip.
2. How to Decompile and Recompile *.apk file
a. Copy framework-res.apk to apktool folder (make sure is the same folder).
(Attention : to edit other default apk on system/app like Contacts.apk, Phone.apk. MusicPlayer.apk etc.. needed framework 2. for example : twframework-res.apk)
b. Copy other *.apk you want to edit to apktool folder. for example : GreenRockers.apk
c. Open Command Prompt.bat
d. Decompile and install framework
Code:
apktool if framework-res.apk
apktool d GreenRockers.apk
Screenshot example for installing framework and decompiling apk :
if your apk is Contacs.apk, Phone.apk, Camera.apk etc.. follow this guide :
Code:
apktool if framework-res.apk
apktool if twframework-res.apk
apktool d Settings.apk
Screenshot example for installing framework 2 and decompiling apk :
e. wait and you will see a folder with the name "GreenRockers or Settings"
f. now you can start editing png, xml, even smali file
g. After editing is complete, Now Recompile
Code:
apktool b -f -d GreenRockers
or
Code:
apktool b -f -d Settings
Screenshot example for decompiling dan recompiling apk :
h. After recompile is complete, go to GreenRockers or Settings folder, Open dist folder and open GreenRockers.apk or Settings.apk using Winrar/7zip
i. Open Original GreenRockers.apk or Settings.apk Using Winrar/7zip
j. Drag & drop META-INF folder and android.manifest.xml (if you not edit android.manifest.xml), also lib folder if there in Original GreenRockers.apk to Modified GreenRockers.apk or Modified Settings.apk on dist folder.
Screenshot example for Drag & drop META-INF folder etc :
k. Now Sign apk, example :
Code:
java -jar SignApk.jar testkey.x509.pem testkey.pk8 GreenRockers.apk GreenRockers_signed.apk
(Attention : Sign apk is only for 3rd Party apps, you can sign apk from system/app. but not all apk on system/app support)
l. Rename GreenRockers_signed.apk to GreenRockers.apk
m. Zipalign the apk
Code:
zipalign -fv 4 GreenRockers.apk GreenRockers-new.apk
n. Rename GreenRockers-new.apk to GreenRockers.apk
o. finally, push back xxxxxx.apk into the system your device. push manual using root explorer/similar application or make a flashable zip.
3. How to Zipalign the *.apk
1. Download and Install Android SDK (if you've downloaded, do not need to download again)
2. Go to C:\Program Files\Android\android-sdk\tools
3. Search + copy zipalign.exe and draw9patch.bat then paste in the c:\windows\here
4. Open cmd and typing this code (For example : Zipalign SystemUI.apk) :
Code:
zipalign -fv 4 SystemUI.apk SystemUI-new.apk
GUIDE FOR GINGERBREAD
1. How to change text color on flipfont chooser/option at dark pop up for Samsung Stock Gingerbread ROM
Screenshot :
Before :
After :
a. Decompile Settings.apk (use apktool) or classes.dex in settings.apk (use baksmali)
b. Go to com/android/settings/flipfont and open the fontlistadapter.smali with notepad ++
c. search this line :
const/high16 v6, -0x100
d. change/replace const/high16 v6, -0x100 to const/high16 v6, -0x1
e. recompile.
2. How to change text color on dark pop up (Font size) at accessibility settings for gingerbread ROM
Screenshot :
a. Decompile Settings.apk (use apktool) or classes.dex in settings.apk (use baksmali)
b. Go to smali\com\android\settings and open the FontSizeListAdapter.smali with notepad ++
c. Search this line :
const v7, -0x1
d. change/replace const v7, -0x1 to const/high16 v7, -0x1
e. Go to res\xml and open accessibility_settings.xml
f. Search this line :
Code:
<com.android.settings.FontSizeListPreference android:title="@string/font_size_title" android:key="font_size" android:summary="@string/font_size_title" />
Change or add color (Red text)
Code:
<com.android.settings.FontSizeListPreference android:title="@string/font_size_title" [COLOR="Red"]android:textColor="#FFFFFF"[/COLOR] android:key="font_size" android:summary="@string/font_size_title" />
g. Recompile
3. How to BIG Photo when calling on Samsung stock gingerbread ROM
Screenshot :
Before :
After :
a. Decompile Phone.apk
b Go to phone\res\layout and open call_card_person_info.xml using notepad ++
c. Change all this lines (maybe some device is different) :
Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/callCardPersonInfo" android:layout_width="fill_parent" android:layout_height="wrap_content">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="123.0dip">
<FrameLayout android:layout_width="123.0dip" android:layout_height="123.0dip" android:layout_centerHorizontal="true">
<ImageView android:id="@id/photo" android:layout_width="123.0dip" android:layout_height="123.0dip" />
<LinearLayout android:layout_gravity="bottom" android:orientation="horizontal" android:id="@id/birthPanel" android:background="#77000000" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="33.0dip">
<ImageView android:layout_gravity="center_vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/call_birthday_icon2" />
<TextView android:textSize="20.0sp" android:textColor="@color/twcolor001" android:layout_gravity="center_vertical" android:id="@id/birthdayRemainedDays" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4.0dip" android:text="@string/BirthDay_remainedDays0" android:singleLine="true" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
<LinearLayout android:layout_gravity="center_horizontal" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="43.0dip" android:layout_marginTop="12.0dip">
<ImageView android:layout_gravity="center_vertical" android:id="@id/birthIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/call_birthday_icon" />
<TextView android:textSize="31.0sp" android:textColor="@color/twcolor001" android:gravity="center_vertical" android:id="@id/name" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="43.0dip" android:singleLine="true" />
</LinearLayout>
<TextView android:textSize="21.0sp" android:textColor="@color/phone_number" android:gravity="center_vertical" android:id="@id/phoneNumber" android:layout_width="wrap_content" android:layout_height="29.0dip" android:singleLine="true" />
<TextView android:textSize="20.0sp" android:textColor="@color/twcolor003" android:gravity="center_vertical" android:id="@id/cdnipNumber" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5.0dip" android:text="@string/unknown" android:singleLine="true" />
</LinearLayout>
</FrameLayout>
To :
Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/callCardPersonInfo" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerHorizontal="true">
<ImageView android:orientation="vertical" android:id="@id/photo" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="0.0dip" />
<LinearLayout android:layout_gravity="bottom" android:orientation="horizontal" android:id="@id/birthPanel" android:background="#77000000" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="33.0dip">
<ImageView android:layout_gravity="center_vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/call_birthday_icon2" />
<TextView android:textSize="20.0sp" android:textColor="@color/twcolor001" android:layout_gravity="center_vertical" android:id="@id/birthdayRemainedDays" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4.0dip" android:text="@string/BirthDay_remainedDays0" android:singleLine="true" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
<LinearLayout android:layout_gravity="center_horizontal" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="43.0dip" android:layout_marginTop="12.0dip">
<ImageView android:layout_gravity="center_vertical" android:id="@id/birthIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/call_birthday_icon" />
</LinearLayout>
</LinearLayout>
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView android:textSize="16.0sp" android:textColor="@color/twcolor001" android:gravity="center_horizontal" android:id="@id/name" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="48.0dip" android:layout_marginTop="88.0dip" android:lines="2" android:singleLine="false" android:shadowColor="#ff000000" android:shadowDx="2.0" android:shadowDy="2.0" android:shadowRadius="2.0" android:layout_centerHorizontal="true" />
<TextView android:textSize="16.0sp" android:textColor="@color/phone_number" android:gravity="center_horizontal" android:id="@id/phoneNumber" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="29.0dip" android:layout_marginTop="126.0dip" android:singleLine="false" android:shadowColor="#ff000000" android:shadowDx="2.0" android:shadowDy="2.0" android:shadowRadius="2.0" android:layout_centerHorizontal="true" />
<TextView android:textSize="16.0sp" android:textColor="@color/twcolor003" android:gravity="center_horizontal" android:id="@id/cdnipNumber" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/unknown" android:singleLine="true" />
</RelativeLayout>
</FrameLayout>
d. Go to phone\res\drawable-hdpi or xxx-dpi and search *.png file with name :
- call_ani_00
- call_ani_in_01
- call_ani_in_02
- call_ani_in_03
- call_ani_in_04
- call_ani_in_05
- call_ani_in_06
- call_ani_in_07
- call_ani_out_01
- call_ani_out_02
- call_ani_out_03
- call_ani_out_04
- call_ani_out_05
- call_ani_out_06
- call_ani_out_07
e. Replace with your favorite image (Minimal resolution is 480x460 or Higher for HDPI device), download source image for example on attachment.
f. Recompile.
4. How to make transparancy on Gingerbread (Following wallpaper)
Click here to guide "How to make transparancy on Gingerbread"
More guide will come
GUIDE FOR ICS AND JELLY BEAN ROM
1. How to edit activity tltle bar on ICS and JB (CM9/CM10/CM10.1)
Screenshot :
Before :
After :
a. Decompile framework-res.apk
b. Go to framework-res folder/res/drawable-hdpi (or mdpi/xhdpi). and search *.png file with name :
- ab_bottom_solid_dark_holo.9.png
- ab_solid_dark_holo.9.png
- ab_stacked_transparent_light_holo.9.png
- ab_transparent_dark_holo.9.png
- ab_transparent_light_holo.9.png
c. replace all *.9.png file with your favorit *.9.png (Recommended resolution is 720x100 for XHDPI, or download source png for example from my theme Green Rocker CM10 on attachment)
d, Recompile
e. if you want to change too setting icon on title bar, just decompile settings.apk and go to settings/res/drawable-***dpi and change ic_launcher_settings.png and recompile.
2. How to change quick settings background on CM10.1
Screenshot :
Before :
After :
a. Decompile SystemUI.apk
b. Go to SystemUI\res\drawable and open qs_tile_background.xml using notepad ++
Change this line :
Code:
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<color android:color="#ff212121" />
</item>
<item>
<color android:color="#ff161616" />
</item>
</selector>
To :
Code:
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" [COLOR="Red"]android:drawable="@drawable/qs_tile_background_pressed" />
<item android:drawable="@drawable/qs_tile_background_normal" />[/COLOR]
</selector>
c. Add source 2 *.png file to drawable-xxxxdpi folder with name (you are free to choose any image including transparent) :
- qs_tile_background_pressed
- qs_tile_background_normal
d. Recompile
3. How to change text color and underline color at Popup on CM9/CM10/CM10.1
Screenshot :
Before :
After :
a. Decompile framework-res.apk
b. Go to framework-res\res\values and open colors.xml using notepad ++
c. Change this line (for example : change blue color to green color) :
Code:
<color name="holo_blue_light">#ff33b5e5</color>
To :
Code:
<color name="holo_blue_light">[COLOR="Red"]#ff9cc912[/COLOR]</color>
Note : but this is quite global, there is some text that will be replaced. to more specifically, you can edit it in this line :
- Go to framework-res\res\values and open style.xml using notepad ++
- Search this line :
Code:
<style name="TextAppearance.Holo.DialogWindowTitle" parent="@*android:style/TextAppearance.Holo">
<item name="android:textSize">22.0sp</item>
<item name="android:textColor">[COLOR="Red"]@color/holo_blue_light[/COLOR]</item>
</style>
and :
Code:
<style name="TextAppearance.Holo.Light.DialogWindowTitle" parent="@*android:style/TextAppearance.Holo.Light">
<item name="android:textSize">22.0sp</item>
<item name="android:textColor">[COLOR="Red"]@color/holo_blue_light[/COLOR]</item>
</style>
Change/Replace to :
Code:
<style name="TextAppearance.Holo.DialogWindowTitle" parent="@*android:style/TextAppearance.Holo">
<item name="android:textSize">22.0sp</item>
<item name="android:textColor">[COLOR="Red"]#ff9cc912[/COLOR]</item>
</style>
And
Code:
<style name="TextAppearance.Holo.Light.DialogWindowTitle" parent="@*android:style/TextAppearance.Holo.Light">
<item name="android:textSize">22.0sp</item>
<item name="android:textColor">[COLOR="Red"]#ff9cc912[/COLOR]</item>
</style>
d. Recompile
More guide will come
ABOUT ME
WHO IS MASTER RIZAL LOVINS ???
JUST FOLLOW ME OR ADD ME AS YOUR FRIEND ON SOCIAL NETWORKS
A little tips/guide/info to port apps from the platform, this is doesn't mean all the applications of the platform can be ported!!!
This is just example
Ok Let's start!!!
Requirement :
1. Knowledge in decompile/recompile/sign/zipalign apk file (apps) (In the first post )
2. Knowledge to find library file (*.so file) and framework file (*.jar) whats needed from apps
3. Knowledge to use LogCat
- if you don't know how to do this, visit this thread http://forum.xda-developers.com/showthread.php?t=2274119
How can I know what's library is needed? :
1. Knowledge is in need if the library doesn't exist in apk file, locate the name of the library file (*.so file) that may be related to the application (the file name may be a bit the same with the application) you can search in system>lib
2. If library file already exist in apk file /folder lib>armeabi/armeabi-v7 (You just need to extract it from apk file and take the file *.so)
3. To see what's apps required library framework file :
- Decompile apps with using file framework-res.apk from that ROM apps (Also maybe need framework 2 like SemcGenericUxpRes.apk or twframework-res.apk etc)
- Open AndroidManifest.xml using Text Editor (Like NotePad++) and see like this line
Leave file has been decompiled and Take it file name (In list androidmanifest) from the ROM file that you want to ported from system>framework also take permission framework file (*.xml) from system>etc>permission
What should i do know? :
1. First times you need download Full ROM is there already deodexed so you can take some file you need to ported
2. If you already understand what i said above, lets start to final section
3. If you already take all file what you need to port, collect all the files, and prepare cwm zip updater, add the file to zip with right folder
*.Apk file must be in system>app
*.So file must be in system>lib
*.jar file must be in system>framework
*.xml file permissions framework must be in system>etc>permissions
This section is not modified the apps, first you can try flash it with CWM and see its working or not, if not working (FC) you need to see whats wrong in logcat (FATAL ERROR)
Or the problem apps parsing error because your Android Version is lower (e.g apps JB to ICS)
Now you need to decompile that apps
Go to smali folder and search what's wrong in logcat, if you already fix it
Then open AndroidManifest.xml try to change minimal sdk version from Android_manifest or in apktool.yml
Code:
minSdkVersion: '[COLOR="Red"]16[/COLOR]'
targetSdkVersion: '17'
Change to this number
Code:
minSdkVersion: '[COLOR="Red"]14[/COLOR]'
targetSdkVersion: '17'
save all changes
then recompile, sign and zipalign
NOTE :
1. You should right with signing the apps, Use Auto TESKEYS
2. Not All apps can be ported to lower Android Version by changed minimal sdk
hay sir.. yu'r awesome..
nice guide :thumbup:
Sent from my GT-I8150 using xda premium
RizaLeon said:
hay sir.. yu'r awesome..
nice guide :thumbup:
Sent from my GT-I8150 using xda premium
Click to expand...
Click to collapse
Thanks mate... More guide will come...
or you want to adding some tutorial? Hehe..
It's awesome thread. I got new knowledge.. thank you
Sent from my GT-I8150
ibanez7 said:
Thanks mate... More guide will come...
or you want to adding some tutorial? Hehe..
Click to expand...
Click to collapse
I'm waiting for it..
ohh mate.. I don't have a tutorial I just nubie
Sent from my GT-I8150 using xda premium
WOW... awesome.. :fingers-crossed:
thanks for ur guide :highfive:
RizaLeon said:
I'm waiting for it..
ohh mate.. I don't have a tutorial I just nubie
Sent from my GT-I8150 using xda premium
Click to expand...
Click to collapse
Not a newbie... You will be a master...
Linq'z QIrls'z Chinese said:
WOW... awesome.. :fingers-crossed:
thanks for ur guide :highfive:
Click to expand...
Click to collapse
Thanks sist linq, I hope this is helpful
Thanks for the tutorial sir :good:
Update May 8, 2013
Some guide/tutorial and screenshot is added, more guide will come...
ibanez7 said:
Some guide/tutorial and screenshot is added, more guide will come...
Click to expand...
Click to collapse
Awesome
Learned Decompiling and Recompiling of apks from ur thread
Thnx
when i compile SemcGenericUxpRes.apk, aapt.exe stop working, why?
teztaz--v3 said:
Thanks for the tutorial sir :good:
Click to expand...
Click to collapse
Fang Leone said:
Awesome
Learned Decompiling and Recompiling of apks from ur thread
Thnx
Click to expand...
Click to collapse
You are welcome guys.....
rizone27 said:
when i compile SemcGenericUxpRes.apk, aapt.exe stop working, why?
Click to expand...
Click to collapse
Visit this thread, maybe can help you :
http://forum.xda-developers.com/showthread.php?t=2190716
Visit this thread, maybe can help you :
http://forum.xda-developers.com/showthread.php?t=2190716[/QUOTE]
Yeah very help me and success :fingers-crossed:
Thanks for tutorial
Is zipaligning not important anymore? The amount of guides I read that don't even mention it is quite shocking.
For example, if less number of applications with an unaligned home application, you’d see slower application launch times. This is the best case scenario. For a worst case scenario, having a number of unaligned applications will result in the system repeatedly starting and killing processes, struggling with lags and huge battery drain.
Click to expand...
Click to collapse
- What Is Zipalign In Android And How To Make Apps Zipaligned [Complete Guide]
thanks for the guide . its very useful. and because of posts like this gives us opportunity to do some modifications. and i know little bit of
compile and recompile stuff and have managed to do some small changes
i want to know some info about following.
im using CM10 ROm . and it has FM radio app. but we cant change station/ volume or stop radio playing with headset button. whenever headset button pressed it plays from Music player. could u tell me where can we modify and enable headphone button to FM radio ? maybe this need some serious modding . but im so curious and i know you guys know the workaround about it .
XperienceD said:
Is zipaligning not important anymore? The amount of guides I read that don't even mention it is quite shocking.
- What Is Zipalign In Android And How To Make Apps Zipaligned [Complete Guide]
Click to expand...
Click to collapse
yes, Zipalign is indeed very important, but I did not include it here because here it has a lot to share about how the way to Zipalign apk. for example :
1. Download and Install Android SDK
2. Go to C:\Program Files\Android\android-sdk\tools
3. Search + copy zipalign.exe and draw9patch.bat and paste in the c:\windows\here
4. Open cmd and typing this code (for fxample Zipalign SystemUI.apk) :
Code:
zipalign -fv 4 SystemUI.apk SystemUI-new.apk
but thanks for your suggestion.. I will add it to the first page
Dilesh Perera said:
thanks for the guide . its very useful. and because of posts like this gives us opportunity to do some modifications. and i know little bit of
compile and recompile stuff and have managed to do some small changes
i want to know some info about following.
im using CM10 ROm . and it has FM radio app. but we cant change station/ volume or stop radio playing with headset button. whenever headset button pressed it plays from Music player. could u tell me where can we modify and enable headphone button to FM radio ? maybe this need some serious modding . but im so curious and i know you guys know the workaround about it .
Click to expand...
Click to collapse
okay, your welcome mate, and thanks for good question...
I think the headset for music player created by default, but for third-party applications may be different configuration with the default application in terms compatibility of the headset. so might have to edit the application itself. and it could be the effect of CM ROMs, because by default does not have FM radio.
you can try to edit it, looking at the layout or smali files, but I have not tried it
Nice Guide My Brother!!
Many THANKS for this awesomeness :good:
Hi! I have a tab gt-p6800 with a stock room KIES_HOME_P6800DXMD3_P6800OLBMD3_1157844_REV00_user_low_ship.tar. It's working fine. The only problem as you all may know, is that it has limited language options. Then I unpacked the tar file and found the cache.img file. Then I unpacked this file with the program easy tools allwinner and ext4 unpacker option. Then I could see the root that has a folder called recovery and inside it there are two files called commands and sec_csc.zip. Then I extracted the file sec-csc.zip. Then I found two folders, META-INF and system. Looking around the folder system I found out the language config options in the csc folder. What I have done was insert a folder to the language I wanted to (ZTO folder) from another 4.1.2 JB N8000UBCML2_N8000ZTOCML3_ZTO config. Then updated the language.xml file to include that option "pt BR" as follows:
<SamsungMobileLanguage>
<Country>Brazil</Country>
<CountryISO>BR</CountryISO>
<SalesCode>ZTO</SalesCode>
<LanguageSet>
<Display>
en_GB;en_US;en_PH;pt_BR;zh_CN;vi_VN;th_TH;in_ID;ms_MY;ko_KR;
</Display>
<Input>
<SupportList>
en_GB;en_US;vi;th;id;pt;ms;ko;zh_CN;
</SupportList>
<EnableList>
pt;</EnableList>
</Input>
</LanguageSet>
After this I also updated the SW_Configuration.xml file to include the ZTO folder as follows:
<?xml version="1.0" encoding="UTF-8" ?>
<SW-Configuration>
<MobileData>
<PublicName>GT-P6800</PublicName>
</MobileData>
<CustomerDataSet>
<CSCName>P6800OLB</CSCName>
<CSCVersion>MD3</CSCVersion>
<NbCustomer>14</NbCustomer>
<CustomerData src="/Customer/ZTO/customer.xml" />
<CustomerData src="/Customer/GLB/customer.xml" />
<CustomerData src="/Customer/MM1/customer.xml" />
<CustomerData src="/Customer/SIN/customer.xml" />
<CustomerData src="/Customer/SMA/customer.xml" />
<CustomerData src="/Customer/STH/customer.xml" />
<CustomerData src="/Customer/THL/customer.xml" />
<CustomerData src="/Customer/XEV/customer.xml" />
<CustomerData src="/Customer/XME/customer.xml" />
<CustomerData src="/Customer/XSE/customer.xml" />
<CustomerData src="/Customer/XSP/customer.xml" />
<CustomerData src="/Customer/XTC/customer.xml" />
<CustomerData src="/Customer/XTE/customer.xml" />
<CustomerData src="/Customer/XXV/customer.xml" />
</CustomerDataSet>
</SW-Configuration>
And on the ZTO folder I had included, I put all the config files needed. Then saved all the changed files, ziped it again with winrar in zip mode, get back sec_csc.zip file with all this changes. Now I have to repack this zip file into the cache.img file and then put all files back into the tar file and flash it with Odin to see if it's going to work and change the optional language inserted. The question is: How to repack the zip file into the cache.img file?
I know that after inserting this new zip file back into the cache file I have to exclude the old one in there. Any ideas please? Tks.