Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Guide] How to port Stock 2.3.6 apps to cm7

OP mohamedrashad

1st May 2014, 12:45 PM   |  #1  
mohamedrashad's Avatar
OP Senior Member
Flag ismailia
Thanks Meter: 459
 
975 posts
Join Date:Joined: Nov 2012
More
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

Last edited by mohamedrashad; 2nd May 2014 at 04:50 PM.
The Following 8 Users Say Thank You to mohamedrashad For This Useful Post: [ View ]
1st May 2014, 07:46 PM   |  #3  
mohamedrashad's Avatar
OP Senior Member
Flag ismailia
Thanks Meter: 459
 
975 posts
Join Date:Joined: Nov 2012
More
I Will release some apps, after my exams finish

Sent from my GT-S5360 using Tapatalk 2
2nd May 2014, 04:22 PM   |  #4  
Junior Member
Flag Salatiga
Thanks Meter: 0
 
12 posts
Join Date:Joined: Apr 2012
Is it possible to port stock fm radio to cm7?
2nd May 2014, 04:43 PM   |  #5  
mohamedrashad's Avatar
OP Senior Member
Flag ismailia
Thanks Meter: 459
 
975 posts
Join Date:Joined: Nov 2012
More
Quote:
Originally Posted by bluestarfish

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
3rd May 2014, 10:02 PM   |  #6  
Minions_Army's Avatar
Senior Member
Flag 【Gru Laboratories】
Thanks Meter: 156
 
434 posts
Join Date:Joined: Nov 2012
More
yeah finaly i got this
many thanks sir
The Following User Says Thank You to Minions_Army For This Useful Post: [ View ]
6th May 2014, 05:31 AM   |  #7  
Nachiket.Namjoshi's Avatar
Recognized Contributor
Flag ◄♪♫██ ♪♫►
Thanks Meter: 1,533
 
488 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Well, I had it in my mind everytime :P but never tried doing it... #laziness

Anyways, this IS usefull
The Following User Says Thank You to Nachiket.Namjoshi For This Useful Post: [ View ]
6th May 2014, 03:32 PM   |  #8  
mohamedrashad's Avatar
OP Senior Member
Flag ismailia
Thanks Meter: 459
 
975 posts
Join Date:Joined: Nov 2012
More
Quote:
Originally Posted by Nachiket.Namjoshi

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
The Following 2 Users Say Thank You to mohamedrashad For This Useful Post: [ View ]
8th May 2014, 07:28 AM   |  #9  
Jom_o1's Avatar
Member
Flag Manila
Thanks Meter: 74
 
82 posts
Join Date:Joined: Oct 2013
Donate to Me
More
Wink Perfect !
Just what i needed good job OP

The Following User Says Thank You to Jom_o1 For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes