[Q]Decompiling Conversations.apk (stock sms app) - Defy Q&A, Help & Troubleshooting

Hi,
I'm trying to decompile conversations.apk from the motorola stock rom, and am failing at it. Right now i have used the following framework files:
-blur-res.apk
-moto-res.apk
In addition all of these files are odexed. And again, i am failing at deodexing them.
Any help please?
I have multitool(apktool), virtuous ten studio (for the code modding, but first i must correctly decompile), and also have xUltimate (for deodexing)

Here... I have deodexed and decompiled Conversations.apk for you
P.S. Conversations.apk is from CEE 2.2.2. Froyo stock

Thanks =)

The files are corrupt (when trying to convert to jar file using dex2jar).
Are you sure you included all the BOOTCLASSPATH files when deodexing?

Related

[Q] Mail.apk Mobileprint.apk & Camera.apk

Has anyone had any success deodexing these three files on a Verizon Tab? Every other apk deodexed just fine but I can't get these three done at all.
If anyone has had any success would you please post them for me, or let me know what dependencies you had to manually add in.
Thanks!
+1 here
Sent from my Verizon Tab using XDA App
When I used xUltimate to deodex files from my Motorola I1 several files failed to deodex. I deodexed them manually by running (in a command prompt) for each one something akin to the following line:
java -jar baksmali-1.2.5.jar -c :am.jar:android.awt.jar:android.motorola.videoplayer.jar:...etc. -x Camera.odex
I included as dependencies(the jar list after the "-c") every jar that was in /system/framework(I copied all the deodexed framework jars to my working directory, as well). For each odex file this created an "out" folder. I used smali to compile this out folder into a classes.dex, which I then inserted into the corresponding apk file.
Good luck

[Q] Trying to modify a system app - what am I missing?

I'm trying to modify Email.apk. I'm currently running stock 3.1 from http://forum.xda-developers.com/showthread.php?t=1154492
Here's what I did:
1. Extracted Email.apk from update zip and dumped using APKTools.
2. Made my modifications - specifically I'm editing a .smali file with my desired changes.
3. Rebuild Email.apk using APKTools.
4. Renamed existing Email.apk and Email.odex for backup.
5. Copy my Email.apk to system\app and set permissions.
6. Reboot into CWM and wipe davlik cache (not sure if this is required).
7. Reboot.
Now the email app no longer exists in list of applications.
What steps am I missing?
If I'm not mistaken You can't edit odexed firmware!
You must first flash a deodexed rom and then change it to your heart's desire.
I guess I'll have to try deodex the rom myself then.
Thanks!
I'm now using Virtuous Picasso which is deodexed and am now able to modify /system/app applications.
However I think the actual problem was I forgot to sign the modified Email.apk. (Also had to sign Exchange.apk also as they need to be signed with the same certificate)
I think as long as the device is rooted you can replace /system/app applications?
See my signature for signing - piece of cake!
If you have a good and clear deodexing tutorial I'd appreciate it

[SCRIPT/TOOL](Updated 10/22)Auto-deodexer 1.2.8 for the Captivate (Froyo-Gingerbread)

***I added some minor reliability improvements, by including more error checking, seems to run pretty smooth***
I've been playing around with making a deodexer script and having some issues, did a google search and came across these two posts.
http://forum.xda-developers.com/showthread.php?t=598026
http://forum.xda-developers.com/showpost.php?p=5775540&postcount=57
So I merged what I had with theirs and modified it to work on the Captivate ROM's.
I thought it would be a useful tool to have and thought I would share with anyone interested in deodexing their own stock ROM.
Why would you want to deodex your own ROM when you could download somebody elses? Something to do I guess.
It deodexes the app and framework folders in three passes, the first pass does the files that don't require a specific boot class path, the second pass deodexes the files that do require a boot class path and the third does a check for any files the for-do loop may have skipped.
It takes approximately 10 to 30 minutes to complete, depending on your computer, but considering that it took me almost a day to deodexed a ROM manually, , thats not so bad.
It can pull a stock ROM from your phone and deodex it, using adb or you can extract a factoryfs.rfs file and place app and framework folder into the app and framework folders for the script.
It also has a batch zipalign tool for when its done deodexing.
You have the option to select boot class paths for Captivate i897 (gingerbread or froyo), or you can input a custom boot class path string.
Extract the Deodexer_i897.zip to a folder that does not have spaces in the name.
Pull the system from your phone or add your app and framework folders to the extracted folder for the deodexer.
Then just doubleclick on deoall.bat and your off and running.
I included a Readme file with instructions.
You have to have the Java sdk and samsung usb drivers installed on your computer for it to work.
The script is a windows batch file and was modified on Windows 7. I assume it will work on XP as well, but haven't tested it.
I've tested it on:
i897 - KB1, KF1, KH3, KI1, KI2, KJ1, KJ2, KJ3, KK1 and KK2
Rogers - KH2
i9000 - JVO, JVR and JVS stock ROMs.
I've flashed and tested KF1, KH3, KI2, KJ1, KJ2 and KJ3 on my phone with no problems.
(Remember, stock KH3 - KJ3 do not have any ringtones so you will have to copy them to the media/audio folder from another ROM)
Note: Remember to check the app and framework folders for files that got skipped. If there is, try running the deodexer again just to make sure it just wasn't a glitch.
Thanks and credits goes out to Daneshm90 and crzyruski for the deodexer scripts and JesusFreke for giving us baksmali-smali and not to forget, Igor Pavlov for 7zip.
UPDATE- I'm adding a basic clockworkmod flashable script template that you can pop your system into. It includes redbend_ua, wipe, busybox, su and superuser.apk for root. You will have to add a kernel (zImage) and the appropriate modem (modem.bin) to the updates folder.
You will have to flash an update.zip (Froyo) http://forum.xda-developers.com/showthread.php?t=734163
or flash a kernel tar using odin, that has clockwork mod baked in (Gingerbread), and will need to add a cwm modded kernel to the update folder in the template if you want to keep clockwork mod recovery (Gingerbread). The template will not work with special kernels that have scripting included such as init.d, you will have to flash special MOD kernels that contain scripts, afterwards.
*****CAUTION:This is a full wipe template so be careful and know what you are doing.*****
***Fixed the Core_ROM.zip so it will install the modem and kernel, plus added the wipe script.***
It is beyond the scope of my talents and time to completely teach someone how to do all of this, but google is your friend when it comes to learning this stuff. There are allot of resources out there to help you accomplish your task. I'm just merely supplying some basic tools for you.
TOOLS
Notepad++ works great at editing the updater-script in the META-INF folder.
And the smali and xmls in the apks and jars.
http://notepad-plus-plus.org/
And Apkmanager is great to decompile and compile apk and jar files - Thanks raziel23x
http://forum.xda-developers.com/showthread.php?t=1227179
Just add .apk to the end of the .jar, do your modding, change it back to jar when you're done, works great.
Plus raziel23x has a new apk multi tool that is still in beta but is worth watching http://apkmultitool.com/
Also for those that want a free alternative to Photoshop to modify your graphics, there is a great program called Paint.Net http://paintnet.org/
If you are serious about MODDING here is another valuable tool, Beyond Compare available here $$ http://www.scootersoftware.com/
And this is a valuable reference for those interested in Modding
http://forum.xda-developers.com/showthread.php?t=822311
KERNELS
For KF1 I found this link for the cog5-beta2-kernel.tar, thanks to designgears. http://ftp.captivate.org.ua/samsung/captivate/2.3.x/2.3.3/ROM/cognition_5/
And of course, for KH3 and KI1-KI2 use Boogs kernel available here http://forum.xda-developers.com/showthread.php?t=1242533
For KJ1, KJ2 and KJ3 use Boogs kernel here http://forum.xda-developers.com/showthread.php?t=1294849
***The script has been updated to include the boot class path as an option, instead of having to copy and paste the whole thing, so the Bootclass_path.txt file is no longer needed... Thanks to ralphreyes ***
**NOTICE: due to the nature of DOS (Windows) environmental variables, the deodexer needs to be extracted to the root folder, or any folder it resides in, can't have a space in its name. e.g. Android SDK as opposed to Android_SDK***
As always, I am not responsible if it messes up your phone.
I hope someone finds this useful.
***NOW ITS FINAL***
This is awesome !! Thanks for sharing.
I will have to check this out when I get time this weekend...or sooner.
What about an odexer?
I would like to odex the ROM on my phone after I get my desired modifications in. Any chance on an odexer script?
Thanks I've been looking for an easy way to deodex my own stock rom. I will put it to good use.
Sent from my SAMSUNG-SGH-I897 using XDA App
gibson3659 said:
I would like to odex the ROM on my phone after I get my desired modifications in. Any chance on an odexer script?
Click to expand...
Click to collapse
Odexing is a little tricky, I haven't found a compiler to do that, something exclusive to google and phone manufacturing developers. Though the performance of an odexed ROM is so slight over a deodexed one, it probably wouldn't be worth it.
Nice job on the "Read me".
Will be trying my hand at this asap...
thanks again
4-2ndtwin said:
Nice job on the "Read me".
Will be trying my hand at this asap...
thanks again
Click to expand...
Click to collapse
Thanks, let me know how it goes. I did three more ROMs after I fixed it and flashed two of them and had no problems. When I get home tonight, was going to add an option to root plus will upload some templates for cwm recovery.
Sent from my SAMSUNG-SGH-I897 using XDA App
crt60 said:
**NOTICE** I added another deodexer for high performance computers with quad-core or high end dual core processors, even though the original deodexer works fine, because the script would run so fast, it can produce errors, or skip files because of possible memory segment overlap, causing null pointer exceptions, so I added a 3 second pause between each operation to solve this issue. It only adds a minute or two to the deodexing time, but should add reliability and integrity to the deodexed ROM -> Deodexer_i897x.zip
I've been playing around with making a deodexer script and having some issues, did a google search and came across these two posts.
http://forum.xda-developers.com/showthread.php?t=598026
http://forum.xda-developers.com/showpost.php?p=5775540&postcount=57
So I merged what I had with theirs and modified it to work on the Captivate ROM's.
I thought it would be a useful tool to have and thought I would share with anyone interested in deodexing their own stock ROM.
Why would you want to deodex your own ROM when you could download somebody elses? Something to do I guess.
It deodexes the app and framework folders in three passes, the first pass does the files that don't require a specific boot class path, the second pass deodexes the files that do require a boot class path and the third does a check for any files the for-do loop may have skipped.
It takes approximately 10 to 30 minutes to complete, depending on your computer, but considering that it took me almost a day to deodexed a ROM manually, , thats not so bad.
It can pull a stock ROM from your phone and deodex it, using adb or you can extract a factoryfs.rfs file and place app and framework folder into the app and framework folders for the script.
It also has a batch zipalign tool for when its done deodexing.
You have to manually add the boot class paths at the beginning when prompted, but I included a text file that you can just copy and paste the appropriate boot class paths into the script. I did that in case of future or other ROMs, so the boot class paths could be modified.
Just doubleclick on deoall.bat and your off and running.
I included a Readme file with instructions.
You have to have the Java sdk and samsung usb drivers installed on your computer for it to work.
The script is a windows batch file and was modified on Windows 7. I assume it will work on XP as well, but haven't tested it.
I've tested it on KB1, KF1, KH3, KI1-KI2, KJ1, KJ2, KJ3 and Rogers KH2 stock ROMs.
I've flashed and tested KF1, KH3, KI2, KJ1, KJ2 and KJ3 on my phone with no problems.
(Remember, stock KH3 - KJ3 do not have any ringtones so you will have to copy them to the media/audio folder from another ROM)
Note: Remember to check the app and framework folders for files that got skipped. If there is, try running the deodexer again just to make sure it just wasn't a glitch.
Thanks and credits goes out to Daneshm90 and crzyruski for the deodexer scripts and JesusFreke for giving us baksmali-smali and not to forget, Igor Pavlov for 7zip.
UPDATE- I'm adding a basic clockworkmod flashable script template that you can pop your system into. It includes redbend_ua, busybox, su and superuser.apk for root. You will have to add a kernel (zImage) and the appropriate modem (modem.bin) to the updates folder.
You will have to flash an update.zip (Froyo) http://forum.xda-developers.com/showthread.php?t=734163
or flash a kernel tar using odin, that has clockwork mod baked in (Gingerbread), and will need to add a cwm modded kernel to the update folder in the template if you want to keep clockwork mod recovery (Gingerbread). The template will not work with special kernels that have scripting included such as init.d, you will have to flash special MOD kernels that contain scripts, afterwards.
*****CAUTION:This is a full wipe template so be careful and know what you are doing.*****
It is beyond the scope of my talents and time to completely teach someone how to do all of this, but google is your friend when it comes to learning this stuff. There are allot of resources out there to help you accomplish your task. I'm just merely supplying some basic tools for you.
TOOLS
Notepad++ works great at editing the updater-script in the META-INF folder.
And the smali and xmls in the apks and jars.
http://notepad-plus-plus.org/
And Apkmanager is great to decompile and compile apk and jar files - Thanks raziel23x
http://forum.xda-developers.com/showthread.php?t=1227179
Just add .apk to the end of the .jar, do your modding, change it back to jar when you're done, works great.
Also for those that want a free alternative to Photoshop to modify your graphics, there is a great program called Paint.Net http://paintnet.org/
KERNELS
For KF1 I found this link for the cog5-beta2-kernel.tar, thanks to designgears. http://ftp.captivate.org.ua/samsung/captivate/2.3.x/2.3.3/ROM/cognition_5/
And of course, for KH3 and KI1-KI2 use Boogs kernel available here http://forum.xda-developers.com/showthread.php?t=1242533
For KJ1 and KJ2, use Boogs kernel here http://forum.xda-developers.com/showthread.php?t=1294849
As always, I am not responsible if it messes up your phone.
I hope someone finds this useful.
***Fixed Root***
Click to expand...
Click to collapse
thanks for your work ,so i can build my own rom by myself with less work
crt60,
Didn't get a chance to try this out last weekend. I hope to get to it this Sat. I'll give u some feed back afterwards.
Appreciate the work u are doing and sharing.
Sent from i897uckj3
How can I extract a one-click .exe stock ROM?
Thansk.
chappatti said:
How can I extract a one-click .exe stock ROM?
Thansk.
Click to expand...
Click to collapse
You can't that I know of, it is a microsoft mfc program and I haven't found a decompiler for it. You will have to find the original odin tar file
Sent from my SAMSUNG-SGH-I897 using XDA App
crt60 said:
You can't that I know of, it is a microsoft mfc program and I haven't found a decompiler for it.
Sent from my SAMSUNG-SGH-I897 using XDA App
Click to expand...
Click to collapse
Thanks for your quick reply !!
One thing is not clear in your reademe? Do I need to run the deodexer from the stock ROM folder, or do ineed to edit my win $path.?
chappatti said:
Thanks for your quick reply !!
One thing is not clear in your reademe? Do I need to run the deodexer from the stock ROM folder, or do ineed to edit my win $path.?
Click to expand...
Click to collapse
Copy the app and framework folders in system into the deodexer folder and merge with the app and framework folders already there.
Sent from my SAMSUNG-SGH-I897 using XDA App
crt60 said:
Copy the app and framework folders in system into the deodexer folder and merge with the app and framework folders already there.
Sent from my SAMSUNG-SGH-I897 using XDA App
Click to expand...
Click to collapse
I have checked the updater-script and found it doesn't extract the 'updates' folder ,so the zImage and modem.bin can't be installed
q659503934 said:
I have checked the updater-script and found it doesn't extract the 'updates' folder ,so the zImage and modem.bin can't be installed
Click to expand...
Click to collapse
I will check it out when i get time
Sent from my SAMSUNG-SGH-I897 using XDA App
crt60 said:
I will check it out when i get time
Sent from my SAMSUNG-SGH-I897 using XDA App
Click to expand...
Click to collapse
I just add the script
ui_print("");
ui_print("extract files...");
package_extract_dir("updates", "/tmp");
set_perm(0, 0, 0777, "/tmp/redbend_ua");
i think you could build a ROM template ,it's more useful.
Yep, you're right. I must have accidentally deleted that, when I removed the wipe program, trying to simplify the script. It has been fixed, plus I went ahead and added the wipe script back in. Thanks for your input...
Sent from my SAMSUNG-SGH-I897 using XDA App
I thought I would make it a little easier on your script by adding a couple extra lines to the 'deoall.bat' file so the bootclass path is included within. When it prompts you to enter the bootclass path, you can enter 1 for GingerBread, 2 for Froyo, or you can just enter your custom one.
Replace the line that starts with
Code:
set /P INPUT=Enter BootClassPath (ex 1.jar:2.jar:3.jar): %=%
with the following:
Code:
echo Enter BootClassPath: 1=GingerBread, 2=Froyo,
set /P INPUT=or custom (ex file1.jar:file2.jar:file3.jar): %=%
IF %INPUT%==1 (set INPUT=core.jar:bouncycastle.jar:core-junit.jar:twframework.jar:services.jar:framework.jar:seccamera.jar:javax.obex.jar:com.google.android.maps.jar)
IF %INPUT%==2 (set INPUT=core.jar:twframework.jar:android.policy.jar:services.jar:framework.jar:seccamera.jar:javax.obex.jar:com.google.android.maps.jar)
Thank you for your excellent work crt60!!
ralphreyes said:
I thought I would make it a little easier on your script by adding a couple extra lines to the 'deoall.bat' file so the bootclass path is included within. When it prompts you to enter the bootclass path, you can enter 1 for GingerBread, 2 for Froyo, or you can just enter your custom one.
Replace the line that starts with
Code:
set /P INPUT=Enter BootClassPath (ex 1.jar:2.jar:3.jar): %=%
with the following:
Code:
echo Enter BootClassPath: 1=GingerBread, 2=Froyo,
set /P INPUT=or custom (ex file1.jar:file2.jar:file3.jar): %=%
IF %INPUT%==1 (set INPUT=core.jar:bouncycastle.jar:core-junit.jar:twframework.jar:services.jar:framework.jar:seccamera.jar:javax.obex.jar:com.google.android.maps.jar)
IF %INPUT%==2 (set INPUT=core.jar:twframework.jar:android.policy.jar:services.jar:framework.jar:seccamera.jar:javax.obex.jar:com.google.android.maps.jar)
Thank you for your excellent work crt60!!
Click to expand...
Click to collapse
Nice, I did make a script like that but thought it would be too confusing for those that use this for non-captivate ROMs. I'll update the link with the new code.
Thanks
could add option 3 , custom boot class list (as it is now) for other devices! or have them save it to a txt file in a list one per line and have the bat read the custom txt list

[Q] General Questions About Modifications

Hi everyone, I am new to xda and relatively new to modifying my VZW LG G2. I am looking for some general information on making modifications to APKs as I am trying to change a few things on my phone's interface (rooted but running stock VS98011A 4.2.2 firmware with stock launcher). I am familiar with rooting, TWRP, flashing mods, Xposed modules, apktool, adb, and making basic changes to APKs. I have been able to use 7-Zip to modify images within system APKs to do things like change the app drawer icon and change the status bar icons to all white but for the most part that is the most I know about modifying APKs. I have used apktool to decompile a few APKs successfully (including loading framework files) but I am not really familiar with recompiling them (I always seem to get errors but the APK still builds successfully), signing them, etc.
Here are my general questions:
-Where do odex files play into decompiling and recompiling APKs and do I need any special tools to be able to deodex and decompile an APK, make changes to it then recompile and reodex it?
-Do system APKs need to be signed after being recompiled?
-What is the best tool to sign APKs?
-What are smali and baksmali and do I need them?
-When attempting to recompile a modified copy of LGSystemUI.apk using apktool, I get the messages "W: Could not find sources" and "aapt: warning: string 'sp_remote_info_NORMAL has no default translation in C:\Users\Sean\Desktop\LGSystemUI\res; found: [long list of languages]" but the APK still builds. Is this of concern? Does it have anything to do with the odex files or the framework files?
Sorry for the bombardment of questions. I have read several posts across multiple android forums and can't seem to figure all this out.
rooted VZW LG G2 VS980, stock firmware (4.2.2 VS98011A), stock launcher, running LG G2 Xposed module
bump

[LG G3 KK 4.4.2] Decompiling lge-res.apk with Tickle my Android

So, since decompiling the framework-res.apk is a cinch with TickleMyAndroid , I decided:
"Let's try lge-res.,apk aswell and look at some .xml files"
Decompiling it... works !
Recompiling it (with original Signature) ? No dice.... will error out (and I haven't even changed *any* files in the lge-res.apk to begin with, it is UNTOUCHED....
(I even retried the whole process, purging the TMA dir, reinstalling the framework-res.apk and using the newest available apktool 2.2.0, no results.
Any ideas on this ? I find this rather weird, as the framework-res.apk worked like a charm
Maybe my lge-res.apk is botched (but then my phone wouldn't work... right ?
Thanks in advance for any lge-res.apk stock files and/or suggestions on how to get the da#n lge-res.apk to de and REcompile.
-Rye-
EDIT: https://github.com/iBotPeaches/Apktool/issues/1307

Categories

Resources