lnln1111 / android-apktool

Automatically exported from code.google.com/p/android-apktool
Other
0 stars 0 forks source link

apktool fails to build resources.arsc correctly in ICS 4.0.3 #307

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. apktool d Contacts.apk
2. (changed nothing just to test apktool)
3. apktool b Contacts
4. Copied resources.arsc from \APKTool\Contacts\build\apk\ to original APK.
5. Copied this APK back on to the phone
6. Run "People" (Contacts.apk) fine but when you run "Phone" (which taps into 
your Contacts.apk) I get a FC "Unfortunately, Contacts has stopped" Repeat, I 
get this error when I run "Phone".

What is the expected output? What do you see instead?
I expect no force closes. The reason I am testing this is I need to edit some 
XML's in the values folder which as far as I am led to believe is in 
resources.arsc. I would normally just reuse resources.arsc from the original 
APK but this time I have made changes so I can't do that.

What version of the product are you using? On what operating system?
Apktool 1.4.3 with latest aapt.exe from ADK (Updated ADK only a few days ago)

Please provide any additional information below.
I believe it has something to do with smali and maybe the id's generated at 
build. Obviously, logcat below points to NullPointerException (which I think 
means, it expected something to be true but it was null) and T9Search and/or 
Dialpadfragment.
----------------------------------------
Log of CMD prompt:
C:\Files\Android\APKTool>apktool d Contacts.apk
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Documents and 
Settings\username\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

C:\Files\Android\APKTool>apktool b Contacts
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...

C:\Files\Android\APKTool>
----------------------------------------

----------------------------------------
Logcat:
02-15 12:38:07.825 I/ActivityManager( 1977): Start proc com.android.contacts 
for activity com.android.contacts/.activities.DialtactsActivity: pid=6200 
uid=10000 gids={3003, 1015}
02-15 12:38:07.860 D/OpenGLRenderer( 2243): Flushing caches (mode 1)
02-15 12:38:07.975 D/AccountTypeManager( 6200): Registering external account 
type=com.voxer.account, packageName=com.rebelvox.voxer
02-15 12:38:07.995 D/AccountTypeManager( 6200): Registering external account 
type=com.skype.contacts.sync, packageName=com.skype.raider
02-15 12:38:08.005 D/OpenGLRenderer( 2243): Flushing caches (mode 0)
02-15 12:38:08.025 W/ResourceType( 6200): getEntry failing because entryIndex 
1168 is beyond type entryCount 195
02-15 12:38:08.030 W/ResourceType( 6200): Failure getting entry for 0x7f020490 
(t=1 e=1168) in package 0 (error -2147483647)
02-15 12:38:08.030 W/ResourceType( 6200): getEntry failing because entryIndex 
1169 is beyond type entryCount 195
02-15 12:38:08.030 W/ResourceType( 6200): Failure getting entry for 0x7f020491 
(t=1 e=1169) in package 0 (error -2147483647)
02-15 12:38:08.030 W/ResourceType( 6200): getEntry failing because entryIndex 
1170 is beyond type entryCount 195
02-15 12:38:08.030 W/ResourceType( 6200): Failure getting entry for 0x7f020492 
(t=1 e=1170) in package 0 (error -2147483647)
02-15 12:38:08.030 W/ResourceType( 6200): getEntry failing because entryIndex 
1563 is beyond type entryCount 195
02-15 12:38:08.030 W/ResourceType( 6200): Failure getting entry for 0x7f02061b 
(t=1 e=1563) in package 0 (error -2147483647)
02-15 12:38:08.030 D/AccountTypeManager( 6200): Registering external account 
type=com.viber.voip.account, packageName=com.viber.voip
02-15 12:38:08.065 D/dalvikvm( 6200): GC_CONCURRENT freed 217K, 5% free 
9332K/9735K, paused 2ms+5ms
02-15 12:38:08.080 D/dalvikvm( 6200): GC_FOR_ALLOC freed 7K, 5% free 
9325K/9735K, paused 14ms
02-15 12:38:08.080 I/dalvikvm-heap( 6200): Grow heap (frag case) to 10.273MB 
for 1048592-byte allocation
02-15 12:38:08.105 D/dalvikvm( 6200): GC_FOR_ALLOC freed <1K, 5% free 
10349K/10823K, paused 16ms
02-15 12:38:08.140 I/ContactPhotoManager( 6200): Cache adj: 1.0
02-15 12:38:08.195 D/dalvikvm( 6200): GC_CONCURRENT freed 117K, 3% free 
10774K/11079K, paused 2ms+2ms
02-15 12:38:08.240 D/dalvikvm( 6200): GC_CONCURRENT freed 15K, 3% free 
11285K/11527K, paused 1ms+2ms
02-15 12:38:08.260 W/dalvikvm( 6200): threadid=13: thread exiting with uncaught 
exception (group=0x40a561f8)
02-15 12:38:08.260 E/AndroidRuntime( 6200): FATAL EXCEPTION: Thread-300
02-15 12:38:08.260 E/AndroidRuntime( 6200): java.lang.NullPointerException
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
com.android.contacts.dialpad.T9Search.initT9Map(T9Search.java:223)
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
com.android.contacts.dialpad.T9Search.getAll(T9Search.java:79)
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
com.android.contacts.dialpad.T9Search.<init>(T9Search.java:74)
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
com.android.contacts.dialpad.DialpadFragment$2.run(DialpadFragment.java:512)
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
java.lang.Thread.run(Thread.java:856)
02-15 12:38:08.265 W/ActivityManager( 1977):   Force finishing activity 
com.android.contacts/.activities.DialtactsActivity
02-15 12:38:08.315 W/ResourceType( 6200): getEntry failing because entryIndex 
310 is beyond type entryCount 195
02-15 12:38:08.315 W/ResourceType( 6200): Failure getting entry for 0x7f020136 
(t=1 e=310) in package 0 (error -2147483647)
02-15 12:38:08.315 W/ResourceType( 6200): getEntry failing because entryIndex 
293 is beyond type entryCount 195
02-15 12:38:08.315 W/ResourceType( 6200): Failure getting entry for 0x7f020125 
(t=1 e=293) in package 0 (error -2147483647)
02-15 12:38:08.315 D/AccountTypeManager( 6200): Registering external account 
type=com.facebook.auth.login, packageName=com.facebook.katana
02-15 12:38:08.320 W/ResourceType( 6200): getEntry failing because entryIndex 
280 is beyond type entryCount 195
02-15 12:38:08.320 W/ResourceType( 6200): Failure getting entry for 0x7f020118 
(t=1 e=280) in package 0 (error -2147483647)
02-15 12:38:08.325 D/AccountTypeManager( 6200): Registering 1 extension packages
02-15 12:38:08.325 I/AccountTypeManager( 6200): Loaded meta-data for 6 account 
types, 1 accounts in 354ms(wall) 22ms(cpu)
02-15 12:38:08.375 D/libEGL  ( 6200): loaded /system/lib/egl/libEGL_mali.so
02-15 12:38:08.380 D/libEGL  ( 6200): loaded 
/system/lib/egl/libGLESv1_CM_mali.so
02-15 12:38:08.380 D/libEGL  ( 6200): loaded /system/lib/egl/libGLESv2_mali.so
02-15 12:38:08.460 D/OpenGLRenderer( 6200): Enabling debug mode 0
02-15 12:38:08.475 V/MoodLW  ( 2199): pause
02-15 12:38:08.475 D/AndroidGraphics( 2199): pause
02-15 12:38:08.475 D/AndroidInput( 2199): sensor listener tear down
02-15 12:38:08.530 E/DefaultVoicemailNotifier( 6200): No voicemails to notify 
about: clear the notification.
02-15 12:38:08.575 D/dalvikvm( 6200): GC_CONCURRENT freed 266K, 4% free 
11695K/12167K, paused 1ms+5ms
02-15 12:38:08.575 W/CursorWrapperInner( 6200): Cursor finalized without prior 
close()
02-15 12:38:08.575 W/CursorWrapperInner( 6200): Cursor finalized without prior 
close()
02-15 12:38:08.635 I/ActivityManager( 1977): Displayed 
com.android.contacts/.activities.DialtactsActivity: +939ms
02-15 12:38:08.640 I/ActivityManager( 1977): No longer want 
com.android.keychain (pid 5842): hidden #16
02-15 12:38:08.665 D/OpenGLRenderer( 6200): Flushing caches (mode 1)
02-15 12:38:08.690 E/DefaultVoicemailNotifier( 6200): No voicemails to notify 
about: clear the notification.

----------------------------------------

Original issue reported on code.google.com by shaynemc...@gmail.com on 15 Feb 2012 at 2:57

GoogleCodeExporter commented 9 years ago
--------------------
02-15 12:38:08.260 E/AndroidRuntime( 6200): FATAL EXCEPTION: Thread-300
02-15 12:38:08.260 E/AndroidRuntime( 6200): java.lang.NullPointerException
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
com.android.contacts.dialpad.T9Search.initT9Map(T9Search.java:223)
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
com.android.contacts.dialpad.T9Search.getAll(T9Search.java:79)
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
com.android.contacts.dialpad.T9Search.<init>(T9Search.java:74)
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
com.android.contacts.dialpad.DialpadFragment$2.run(DialpadFragment.java:512)
02-15 12:38:08.260 E/AndroidRuntime( 6200):     at 
java.lang.Thread.run(Thread.java:856)
02-15 12:38:08.265 W/ActivityManager( 1977):   Force finishing activity 
com.android.contacts/.activities.DialtactsActivity
---------------------------

This is the main part I am focusing on but thought I would show some of the 
logcat before and after just in case I missed something.

Original comment by shaynemc...@gmail.com on 15 Feb 2012 at 2:58

GoogleCodeExporter commented 9 years ago
Sorry, I did search. (But obviously not hard enough)
Issue 290, has the same problem.

Original comment by shaynemc...@gmail.com on 15 Feb 2012 at 3:21

GoogleCodeExporter commented 9 years ago
Hello? anyone home?

Original comment by shaynemc...@gmail.com on 24 Feb 2012 at 2:50

GoogleCodeExporter commented 9 years ago
i have sme problem.

Original comment by Jorgef...@gmail.com on 24 Feb 2012 at 8:34

GoogleCodeExporter commented 9 years ago
Same issues. Unable to find resolution.

Original comment by gunther...@gmail.com on 29 Feb 2012 at 2:09

GoogleCodeExporter commented 9 years ago
I´ve tried compile AOSP contacts.apk 4.0.3 stock and work fine. I think the 
problem is to build contacts.apk with t9 implemented. Contacts.apk whit T9 
implemented not compiles fine, resources.arsc resizes.

Original comment by Jorgef...@gmail.com on 29 Feb 2012 at 2:31

GoogleCodeExporter commented 9 years ago
i have the same error when running a compiled phone apk and from contacts.apk 
in a CM7 rom .
as jorgef suggested id like to implement t9 ..howto do it with apktool?

Original comment by drbejoya...@gmail.com on 1 Sep 2012 at 1:58

GoogleCodeExporter commented 9 years ago
This was a problem with <string-array> and <array> which I believe has been 
fixed.

Original comment by connor.tumbleson on 16 Nov 2012 at 11:59