5,595,497 Members 47,125 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
seanw712
Old
#1  
Member - OP
Thanks Meter 7
Posts: 74
Join Date: Sep 2011
Location: Schilde

 
DONATE TO ME
Question [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/show....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.
Attached Files
File Type: zip NfcNci-decompiled folder.zip - [Click for QR Code] (444.0 KB, 4 views)
File Type: apk Original NfcNci.apk - [Click for QR Code] (197.7 KB, 4 views)
File Type: apk RecompiledNfcNci.apk - [Click for QR Code] (152.5 KB, 4 views)
Samsung Galaxy Tab 8.9>Samsung Nexus 10: [MANTA]P.A.C True All in 1 ROM [JB 4.3]
HTC Wildfire S> HTC Desire> Samsung Galaxy S2> LG Nexus 4: [MAKO] P.A.C True All in 1 ROM [JB 4.3]

Nexus all the way... P.A.C. all the way... ANDROID ALL THE WAY!
 
Ameisentaetowierer
Old
#2  
Member
Thanks Meter 10
Posts: 39
Join Date: Oct 2012
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
 
ldrifta
Old
(Last edited by ldrifta; 2nd January 2014 at 09:50 AM.)
#3  
ldrifta's Avatar
Senior Member
Thanks Meter 191
Posts: 1,390
Join Date: Mar 2011
Location: Lynn, Mass
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
~It's only impossible if you stop to think about it!... Vote for Pedro
Donate Link - If you like/appreciate my work, feel free to donate
 
seanw712
Old
#4  
Member - OP
Thanks Meter 7
Posts: 74
Join Date: Sep 2011
Location: Schilde

 
DONATE TO ME
Quote:
Originally Posted by ldrifta View Post
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
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
Samsung Galaxy Tab 8.9>Samsung Nexus 10: [MANTA]P.A.C True All in 1 ROM [JB 4.3]
HTC Wildfire S> HTC Desire> Samsung Galaxy S2> LG Nexus 4: [MAKO] P.A.C True All in 1 ROM [JB 4.3]

Nexus all the way... P.A.C. all the way... ANDROID ALL THE WAY!
Tags
apk, decompile, nfc, recompile, system
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes