Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot modify/recompile XLMs of Jelly Bean Contacts.apk #11

Closed
SunnyOK opened this issue Aug 4, 2012 · 39 comments
Closed

Cannot modify/recompile XLMs of Jelly Bean Contacts.apk #11

SunnyOK opened this issue Aug 4, 2012 · 39 comments
Milestone

Comments

@SunnyOK
Copy link

SunnyOK commented Aug 4, 2012

I am trying to modify XMLs of Jelly Bean Contacts.apk. Using all apktools (up to 1.4.9) that has been used for ICS and other Jelly Bean apks, I can decompile and then recomplie it without any error. However, the recompiled Contacts.apk would not work in cell phone, showing a message "Unfortunately, Contacts has stopped!".

To simplify the problem, I simply do decompiling and then recompiling without any modifications. I found that the size of resources.arsc has been changed from 1480 KB to 1525 KB. The new Contacts.apk causes FC!

Note: Files in smali folder can still be modified. After editing, use apktool to recompile and create a new apk. Then use WinRAR or 7zip to drag the newly created classes.dex into the original Contacts.apk. Such a "modified" Contacts.apk works properly. Note here that we did not modify resources.arsc.

This problem is only related to resources.arsc! XMLs cannot be recompiled.

Please fix this problem in apktool 1.4.10.

@huawuxin
Copy link

huawuxin commented Aug 6, 2012

Hi SunnyOK, please double check:

  1. You are using the latest version of aapt.exe from Android 4.1 SDK.
  2. When you add the new resources.arsc into the original Contacts.apk, for the compression level, you choosed "store" or "no compression", etc.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 7, 2012

  1. I used the aapt for ICS. Its size is 805KB.
  2. I tried all compression levels in WinRAR: Store, Fatest, Fast, Normal, Good and Best. None of them is working.
  3. I also decompile and then recompile Contacts.apk in linux. Decompiling and recompiling have no errors. But it does not work in phone like what I got in Windows 7.

@SunnyOK SunnyOK closed this as completed Aug 7, 2012
@SunnyOK SunnyOK reopened this Aug 7, 2012
@SunnyOK
Copy link
Author

SunnyOK commented Aug 7, 2012

Today, I use the latest version of aapt from Android 4.1 SDK (r20.0.1). Its size is 829.
Size of resources.arsc is changed, but Contacts.apk does still not work.

@iBotPeaches
Copy link
Owner

I think your messing up on the re-injection of the resources.arsc file. It works fine for me.

Copy the exact commands in order you are running.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 8, 2012

Thank you for your reply. It gives me a new hope.
I have tried more. But I am still getting it work.
Would you please let me know which apktool.jar and aapt you are using? If possible, can you let me download your tools and have a try?

@SunnyOK
Copy link
Author

SunnyOK commented Aug 8, 2012

Sorry. There is a typo in my last comment. The second line should be:

I have tried more. But I am still NOT getting it work.

@iBotPeaches
Copy link
Owner

Can you post the commands you are running? I will duplicate exactly then

@SunnyOK
Copy link
Author

SunnyOK commented Aug 8, 2012

Framework:
java -jar apktool.jar if framework-res.apk

Decompile:
java -Xmx64m -jar apktool.jar d Contacts.apk Contacts

Recompile:
java -Xmx64m -jar apktool.jar b Contacts New_Contacts.apk

@SunnyOK
Copy link
Author

SunnyOK commented Aug 8, 2012

aapt is from Android 4.1 SDK (r20.0.1). Its size is 829.
apktool.jar is 1.4.9.
I also tried apktool for ICS, and apktool 1.4.3 - 1.4.9.

@iBotPeaches
Copy link
Owner

Could you upload the framework-res and Contacts here?

And any other APK in the /system/framework folder

@SunnyOK
Copy link
Author

SunnyOK commented Aug 8, 2012

These is my toolkit: (aapt, apktool) and Contacts.aph and framework-res.apk.

http://www.mediafire.com/?xu48ze0oj8qhe1v

Note that when I use the latest aapt from Android 4.1 SDK (r20.0.1), the size of resources.arsc is correct.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 9, 2012

Hi iBotPeaches,
Can you send me your aapt and apktool.jar for Jelly Bean when you say "It works fine for me"?
This will allow me to test in my computer directly. Thanks.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 9, 2012

I am sorry. I am not successful through decompiling and then recompiling Contacts.apk by using your aapt and apktool_1.4.9.jar in linux. The promlem persists.

My Contacts.apk and framework-res.apk are from Jelly Bean 4.1.1 for Samsung Galaxy GT-I9000 and I897.

Have you got Contacts.apk working?

@BurgerZ
Copy link
Contributor

BurgerZ commented Aug 9, 2012

SunnyOK, try to issue this command (put all apks and apktool.jar and aapt into one folder, cd to it):
export PATH=.:$PATH && java -jar apktool.jar d Contacts.apk

@SunnyOK
Copy link
Author

SunnyOK commented Aug 9, 2012

Hi BurgerZ,

By doing this, no improvement has been achieved. I feel hopeless.

@BurgerZ
Copy link
Contributor

BurgerZ commented Aug 10, 2012

Hi! Try this http://www.mediafire.com/?dkkha0pw90090j8

@SunnyOK
Copy link
Author

SunnyOK commented Aug 10, 2012

Hi, BergerZ,
Thank you. This set of aapt and apktool.jar change resources.arsc disk size from 1481 KB to 1525 KB. I simply decompile and then recompile Constants.apk without any modifications. After flashing new Contacts.apk and rebooting, I still get "Unfortunately, Contacts has stopped".
I have a question: Whether or not this problem is related to other apks in the ROM?

@iBotPeaches
Copy link
Owner

Could you please get the logcat :o

I just need to know what the error is. So I know if its a bad resource or something.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 10, 2012

See my apks and logcat.
I include README.txt.
http://www.mediafire.com/?tfibqtmwvvbjfjj

@iBotPeaches
Copy link
Owner

Well shit.

E/AndroidRuntime(  978): java.lang.NullPointerException

E/AndroidRuntime(  978):    at com.android.contacts.dialpad.T9Search.initT9Map(T9Search.java:223)

Looks like we have new resource type. T9Map. Will have to code support for it. Its just loosing it on rebuild.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 10, 2012

iBotPeaches,
Glad to know that you found the root cause. This problem has bothered me for almost 10 days. I have exhausted all posibilities and tools that I have, including their combinations. The solution is highly desired.
Thank you for looking at this issue and look forward to hearing from you for solution..

@SunnyOK
Copy link
Author

SunnyOK commented Aug 14, 2012

Hi iBotPeaches,
Is there any progress on T9Map? Can you provide apktool that I can test? Thanks.

@iBotPeaches
Copy link
Owner

Progress will be posted when done. I don't have a phone to test. There is no development until I get a phone back.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 14, 2012

If you do not mind, I can test your new code in my phone.
When can you get your phone back?

@iBotPeaches
Copy link
Owner

It was sent yesterday. It should arrive in 2-4 days. Then development begins again.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 19, 2012

Hi, iBotPeaches,
Any progress on development? Looking forward to testing your new apktool for handling T9Map and rebuilding Contacts.apk.

@iBotPeaches
Copy link
Owner

GIT is open source. You will see if I do anything. Please don't ask anything until you notice I push changes.

I'm very busy and do this as a hobby.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 19, 2012

We are appreciated.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 21, 2012

I have tried apktool 1.4.10 today. It seems that this version od apktool does not resolve this problem associated with T9Map.

@iBotPeaches
Copy link
Owner

ugh.

Did you even read the changelog? Or the posts associated with that release?

Only 2 bugs were fixed.

I've literally setup Java Debuggers and stepped through this code for hours trying to track down SystemUI and T9Map problems. Haven't been able to fix this yet.

I'm a full time student w/ a part time job. I work when I can. Please be patience and wait for a fix and actually read the changelog.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 21, 2012

Sorry for bothering you. I did read your changelog and expect a fix. Please ignore my report. Thank you.

@SunnyOK SunnyOK closed this as completed Aug 21, 2012
@iBotPeaches iBotPeaches reopened this Aug 27, 2012
@iBotPeaches
Copy link
Owner

I have fixed this.

@SunnyOK
Copy link
Author

SunnyOK commented Aug 29, 2012

Good news.

@SunnyOK
Copy link
Author

SunnyOK commented Sep 2, 2012

Liangyz70 from gfan found the root cause of the problem. With his method, now I can recompile Contacts.apk.

@Acid-miuipolskapl
Copy link

Can you post a link to this?

@iBotPeaches
Copy link
Owner

Apktool v1.5.0 released 20min ago fixes this

@Acid-miuipolskapl
Copy link

Haha, many thanks Connor for this :) I am compiling stock JB roms and got this issue today. And here's your new apktool. Amazing ;)

Wiil let you know if this works for me.

@Acid-miuipolskapl
Copy link

Confirmed to be working with FC Contacts :) Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants