Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,785,371 Members 39,040 Now Online
XDA Developers Android and Mobile Development Forum

[Guide] How to port Stock 2.3.6 apps to cm7

Tip us?
 
mohamedrashad
Old
(Last edited by mohamedrashad; 2nd May 2014 at 03:50 PM.)
#1  
mohamedrashad's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 936
Join Date: Nov 2012
Location: ismailia
Default [Guide] How to port Stock 2.3.6 apps to cm7

Quote:
Warning:

This guide isn't orginally by me, I found it on internet and posting (with some edits) here to help people

The original post : http://epiccm.blogspot.com/2012/01/p...s-for-cm7.html


Quote:
Many stock Samsung apps are awesome and beautifully looking, also cyanogen mod is fast and high customizable, you dont need to sacrfice CM& for good looking apps anymore

STEPS:


1- get your desired App from System/app + twframework.jar and twframework-res.apk from System/framework

2- Decompile all of them Using APK Manager OR Apktool OR Virtous Ten Studio or any other apps

Quote:
Guide for decompile,compile : HERE
3- Remove the library dependence from the AndroidManifest.xml
The line looks like this:

and remove any lines contain ‘com.device.samsung’

Quote:
This to make it install on non samsung roms

4- Copy the twframework code into the app source.

‘twframework.jar.out/smali/’

Quote:
The app now contains both its own code, and all the needed TouchWiz code. There’s a small chance it might work if you recompile it now, but it probably also needs resources
.

5-Update the resources

a. Add the needed files/parts
search for any ‘@touchwiz:’ parts in any xml file under res/.
Next, you will need to merge everything under /res/ from the twframework-res.apk.
Copy over anything that doesn’t already exist. Files under /res/values/ (Except public.xml) will need to be merged, meaning insert all the values from the framework into the app, before the closing tag (Keep the XML valid). If your missing any resources, re-compiling the APK will fail

b. Remove the touchwiz references

Replace every ‘@touchwiz:’ with just an ‘@’

Example :
Code:
@touchwiz:color/

to 

@color/

Quote:
Copied directly from OP :
There are some calls to IDs in the 0x20 range, this is an issue because as far as I know, the 0x20 range can only be provided by the system somehow. For the Calendar app, I had to remove setIcon calls in a few activities to prevent ResourceNotFound exceptions.
If you remove them, then some things like images might not work. I also found that just removing them can cause random NullPointer errors.

Note: While working on the Task Manager, it became more complex. I had to update the old 0x20 references to the references within the new package.
After the resources are added, decompile it again, so the added resources show up in the /res/values/public.xml
Search for the old 0x20 value, and update it to the new value. If you include the /smali/touchwiz/ directory, then you can just search for the hex value and you will get the name of it from the TW R.smali files, and you can find the updated hex value in the /res/value/public.xml file

6. Re-compile

7. Sign the apk using platform key or testkey from HERE

Quote:
Most apps uses testkey but if you had any permission error, use platform key or search google for the error

8. Install

adb push /system/app/

OR

using system app installer

OR

using any root explorer


Quote:
Credits :
-Original poster
-Me, for simplifing it
Pi Locker is updated to V3.1 with amazing additions and upgrading go and try it >>> Google play || XDA

The Following 8 Users Say Thank You to mohamedrashad For This Useful Post: [ Click to Expand ]
 
aniket.lamba
Old
#2  
aniket.lamba's Avatar
Senior Member
Thanks Meter 1,313
Posts: 2,269
Join Date: Jul 2012
Location: New Delhi

 
DONATE TO ME
Well this is useful!
Press Thanks If helped!
The Following User Says Thank You to aniket.lamba For This Useful Post: [ Click to Expand ]
 
mohamedrashad
Old
#3  
mohamedrashad's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 936
Join Date: Nov 2012
Location: ismailia
I Will release some apps, after my exams finish

Sent from my GT-S5360 using Tapatalk 2
Pi Locker is updated to V3.1 with amazing additions and upgrading go and try it >>> Google play || XDA

 
bluestarfish
Old
#4  
Junior Member
Thanks Meter 0
Posts: 11
Join Date: Apr 2012
Location: Salatiga
Is it possible to port stock fm radio to cm7?
 
mohamedrashad
Old
#5  
mohamedrashad's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 936
Join Date: Nov 2012
Location: ismailia
Quote:
Originally Posted by bluestarfish View Post
Is it possible to port stock fm radio to cm7?
you can try it, but it will not work anyway. there is a radio fm bug in cm7
Pi Locker is updated to V3.1 with amazing additions and upgrading go and try it >>> Google play || XDA

 
Minions_Army
Old
#6  
Minions_Army's Avatar
Senior Member
Thanks Meter 154
Posts: 431
Join Date: Nov 2012
Location: 【Gru Laboratories】
yeah finaly i got this
many thanks sir
The Following User Says Thank You to Minions_Army For This Useful Post: [ Click to Expand ]
 
Nachiket.Namjoshi
Old
#7  
Nachiket.Namjoshi's Avatar
Recognized Contributor
Thanks Meter 1,514
Posts: 486
Join Date: Aug 2012
Location: ◄♪♫██ ♪♫►

 
DONATE TO ME
Well, I had it in my mind everytime :P but never tried doing it... #laziness

Anyways, this IS usefull


Forum Rules ||| Getting started on XDA
My Works are here ||| My Github

>> Everything you've ever wanted is beyond the lines of fear <<
If you dont see any updates from me.... HERE IS YOUR ANSWER
The Following User Says Thank You to Nachiket.Namjoshi For This Useful Post: [ Click to Expand ]
 
mohamedrashad
Old
#8  
mohamedrashad's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 936
Join Date: Nov 2012
Location: ismailia
Quote:
Originally Posted by Nachiket.Namjoshi View Post
Well, I had it in my mind everytime :P but never tried doing it... #laziness

Anyways, this IS usefull
Its a great honor for me that a good developer like you admires my work

On a side note : many devs ported stock apps (generally clock widget and launcher and task manager) to CM7 but no one ever shared, I don't like those who don't share their experiences

Sent from my GT-S5360 using Tapatalk 2
Pi Locker is updated to V3.1 with amazing additions and upgrading go and try it >>> Google play || XDA

The Following 2 Users Say Thank You to mohamedrashad For This Useful Post: [ Click to Expand ]
 
Jom_o1
Old
#9  
Jom_o1's Avatar
Member
Thanks Meter 63
Posts: 78
Join Date: Oct 2013
Location: Manila

 
DONATE TO ME
Wink Perfect !

Just what i needed good job OP
MY APPS FOR ALL DEVICE
S5 Lockscreen | S5 Keyboard



PORT ROMS FOR GT-S5300
CM7 KoolSony HD | CM7 Optimus Nexus Me v6 | CM7 WP - Remix

The Following User Says Thank You to Jom_o1 For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes