Help modifying APK files on recovery image - Android Q&A, Help & Troubleshooting

Hello,
I bought a Umi Diamond X and i just found out that it came with adware.
Since i could not find any custom roms for it, i tried editing the recovery image. Manged to remove some APK files, but SystemUI is giving me some problems.
What I did until now:
1) Used simg2img to convert system.img to a mountable image
2) mounted the previously generated image and deleted suspicious folders from system/app and system/priv-app.
3) Use SPFT to flash the edited image to the device.
However, I found that SystemUI.apk is also making dubious requests in the background, so I need to replace it with a stock version. I tried taking SystemUI.apk from different roms of similar phones, with a similar SoC, and copy-paste it into my edited system.img. However, everytime i do this, SystemUI crashes when the phone starts up.
Going into the stock recovery, i have the option to "check root integraty". This appears to scan (among others) all APK files in system/app and system/priv-app. I see it detects the deleted APKs and the 1 modified APK. Could the installer have a signature of the expected APKs and not install if the file doesn't match that signature?
Is there any way I can replace SystemUI.apk with a known good version?

Bump..

Bump again..

Related

System app modification problem

Hi everyone,
I'm trying to modify Phone.apk 'smali' but am having some difficulties.
What I did so far:
1. Decompiled Phone.apk I pulled from my phone.
2. Modified smali file.
3. Buit it, unzipped, copied original META-INF folder and androidmanifest.xml from unmodified original Phone.apk to my modified Phone.apk
4. Zipped it and pushed to the phone. Got nothing but the "no service". :crying:
Other problems I encountered in the process:
1. When I unzip original Phone.apk and zip it again without modification, I get a different file size than the original no matter what compression method I use.
It worked but force closed on phone call end. (used 7zip). When I zipped (WinRar this time) with no compression (storage only) it worked.
2. I made a tiny modification in 'smali' by defining a new variable (to be sure I didn't mess something up with my mods), built it,
copied META-INF and androidmanifest.xml from the original, and zipped (no compression, storage only, winrar) and it showed 'no service' again.
The phone I used is Samsung Galaxy Advanced (I9070) with Gingerbread Stock ROM.
I tried the described procedure on Samsung Galaxy S (I9000) and it worked.
What am I doing wrong in the process? Please anyone help.

[Q] How should I de/recompile a system app? What did I do wrong?

Hi,
So the situations is like this:
Just got a new LG Nexus 4, NFC enabled, GREAT!!!!
But then I start using it, and the NFC sound (everytime the phone reads a nfc-tag it makes an sound) annoys me beyond belief.
So I start looking around, it seems there's no solution, except recompiling the app.
So I learn how to compile an app (noob here), using this guide: http://forum.xda-developers.com/showthread.php?t=1860115
I'm up to the point where my apk is decompiled, and I have modified the sound files, located in my decompiled files folder respectively at res/raw/start.ogg & res/raw/end.ogg.
I modded the files using audacity, lowering the volume to zero, used them to replace the original .ogg files. The file size is a bit smaller as the original ones (1Kb difference).
Next I use the recompile command: apktool b decompiled_apk_folder_with_modified_files modded_apk_file.apk
So now I have the new nfc apk file, called NfcNci.apk, with which I replace the original file in /system/app.
Next up I reboot my phone into recovery, wipe all cache and dalvik cache, and reboot again.
First thing that pops up on my screen is a force-close message, saying that the nfc-service force closed.
Anyone who can tell me what I did wrong? Or how I can fix this?
Attached are: my decompiled-files-folder (compressed to zip)
the original NfcNci.apk file
my modded NfcNci.apk file which causes the FC's.
Any help will be greatly appreciated!!!!
S.
Looks like you're still on 4.2
The latest NfcNci.apk has some more files.
And your apk is missing the META-INF folder.
I guess that this is the problem.
But you should use "adb logcat" to ensure we're on the right track.
Micky
1 thing i would recomend is not using the actual apk you just built. instead, open your new apk with a file manager such as 7zip and remove your newly compiled files out of it, then put them into the original apk from your rom using 7zip as well! thus keeping the apk's original signature
try to copy the least amount of files from one to another, so to be safe only pull out your new .ogg files, then put them into your original apk! hope this helps
ldrifta said:
1 thing i would recomend is not using the actual apk you just built. instead, open your new apk with a file manager such as 7zip and remove your newly compiled files out of it, then put them into the original apk from your rom using 7zip as well! thus keeping the apk's original signature
try to copy the least amount of files from one to another, so to be safe only pull out your new .ogg files, then put them into your original apk! hope this helps
Click to expand...
Click to collapse
Hi, I tried this, installed 7zip, and double clicked the original apk, I opende the res/raw/ directory, and only copied the files I was using: start.ogg & end.ogg. Then I close 7zip, and send the file to my phone. But as soon as I it them to /system/apps on my phone, and reboot to recovery, wiping the dalvik cache. I get FC's on reboot (NFC-service has FC'd).
Any reasons for this?
Thanks for the help, both of you!
BTW: I'm on Android 4.3 JB

[Q] editing .so file

Howdy.
I'm trying to modify a .so file (libflashplayer.so), but have run into a few problems:
I first tried editing the file after it was installed from an .apk. This appears to work at first, but the edited file is quickly replaced with the original.
I then tried editing the file in the .apk package. This causes the package to fail to install (I'm guessing because the md5 in the certificates no longer matches)
Aldo tried moving a folder with the .so files from the .apk (com.adobe.flashplayer-1 which is what is created when the .apk installs correctly) directly into /data/app-lib/.The directory was created successfully but appears to be immediately deleted.
Is there a way to accomplish what I'm trying to do? If so how?
Other possibly relevant info:
My device is rooted
I did not write the code for anything in the .apk, I got it from a link on xda (pretty dubious i know but I couldn't find another option)
I'm using cyanogenmod 10.2 (based on android 4.2 I believe).
I'm editing the file with a hex editor to change a a few characters ("AND" to "WIN")

[Q] Specific Factory ROM modification

Hello,
I need to find a way to edit factory firmware:
1. insert one or two app to be preinstalled, and placed on home screen
2. change default ringtone
I tryed android kitchen, repack system.img file (which is one of many parts files of firmware i have to edit, like boot.img etc) then i edited just one thing, e.g background or place one app. And then I get stuck, i cant find way to restore system.img. Kitchen makes update.zip file..which cant be installed becouse of signature.. So my main problem is how to edit system.img? (unpacked or packed)
Basicly every advice is how to repack, open *.img file, non is to repack.
I have PAP4500DUO and A538 Lenovo. And Windows envirement. I am a rookie too.. :/

[Q] [APK PORTING HELP] Oppo Colour OS 2.1.0i System Applications

After hours of decompiling and things alike, I finally managed to extract the Oppo Colour OS 2.1.x files from the .dat file. But Once I extracted the folders and other things. I come to the launcher folder which has 3 things in the root of the Oppolauncher folder. A folder names "arm", another folder named "lib", and the launcher apk file itself. I know by past experience (Haven't tested myself.) That the apk needs those two folders. (theres also a folder names "oppolaunchersystem" with an arm folder and "oppolaunchersystem.apk.") In order to port these apk files for use with Lollipop devices (Colour OS 2.1.x I believe is lollipop.) Do I have to implement the lib and arm folders (maybe the launchersystem apk)? And if so, how? Thanks for anyone willing to help me with creating the system dump.
I attached the two folders in a Zip file for anyone who wants to examine it.
Sorry for my bad English if I made any errors.
{EDIT} I tried installing OppoLauncher.apk through ADB and I got back [INSTALL_FAILED_DEXOPT] and with OppoLauncherSystem.apk I got back [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]. So it seems that OppoLauncher will work on the device I tested it on (Droid Ultra on 4.4.4) but It needs some sort of resource within the Colour OS 2.1 .x ROM.

Categories

Resources