zdzhjx / android-apktool

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

Apk crashes after rebuilding #222

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Decompress LenovoClock.apk (apktool.bat d LenovoClock.apk)
2. Do nothing and compress it back (apktool.bat b LenovoClock)
3. Replace resources.arsc in original apk
4. Install on phone

What is the expected output? What do you see instead?
Expected working app, but it crashes when it tries to show popup.
I tried "adb logcat" and there is such error:
FATAL EXCEPTION: main
java.util.UnknownFormatConversionException: Conversion: $
    at java.util.Formatter$FormatToken.unknownFormatConversionException(Formatter.java:1461)
    at java.util.Formatter$FormatToken.checkFlags(Formatter.java:1398)
    at java.util.Formatter.transform(Formatter.java:1504)
    at java.util.Formatter.doFormat(Formatter.java:1132)
    at java.util.Formatter.format(Formatter.java:1093)
    at java.util.Formatter.format(Formatter.java:1062)
    at java.lang.String.format(String.java:2208)
    at java.lang.String.format(String.java:2182)
    at com.lenovomobile.deskclock.SetAlarm.formatToast(SetAlarm.java:442)
    at com.lenovomobile.deskclock.SetAlarm.popAlarmSetToast(SetAlarm.java:404)
    at com.lenovomobile.deskclock.SetAlarm.popAlarmSetToast(SetAlarm.java:392)
    at com.lenovomobile.deskclock.AlarmClock.updateIndicatorAndAlarm(AlarmClock.java:112)
    at com.lenovomobile.deskclock.AlarmClock.access$100(AlarmClock.java:89)
    at com.lenovomobile.deskclock.AlarmClock$AlarmTimeAdapter$1.onClick(AlarmClock.java:151)
    at android.view.View.performClick(SourceFile:2535)
    at android.view.View$PerformClick.run(SourceFile:9130)
    at android.os.Handler.handleCallback(SourceFile:618)
    at android.os.Handler.dispatchMessage(SourceFile:123)
    at android.os.Looper.loop(SourceFile:329)
    at android.app.ActivityThread.main(SourceFile:3820)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:538)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(SourceFile:901)
    at com.android.internal.os.ZygoteInit.main(SourceFile:659)
    at dalvik.system.NativeStart.main(Native Method)
  Force finishing activity com.lenovomobile.deskclock/com.lenovomobile.clock.Clock

What version of the product are you using? On what operating system?
1.4.2 (SNAPSHOT 17/05/2011), Windows 7 64bit

Please provide any additional information below.
I rebuild about 50 apks for this phone, and everything was ok, except 
LenovoClock.apk.
Thanks in advance!

Original issue reported on code.google.com by mrja...@gmail.com on 3 Oct 2011 at 2:50

Attachments:

GoogleCodeExporter commented 9 years ago
I tried v.1.3.3 from this thread: 
http://forum.xda-developers.com/showthread.php?t=1063055
and it works!
The problem is that 1.4.2 (and 1.4.1) decompiles the wrong parameters in 
/res/values/arrays.xml
the right string are:
    <string-array name="alarm_set">
        <item>This alarm is set for less than 1 minute from now.</item>
        <item>This alarm is set for %1$s from now.</item>
        <item>This alarm is set for %2$s from now.</item>
        <item>This alarm is set for %1$s and %2$s from now.</item>
        <item>This alarm is set for %3$s from now.</item>
        <item>This alarm is set for %1$s and %3$s from now.</item>
        <item>This alarm is set for %2$s and %3$s from now.</item>
        <item>This alarm is set for %1$s, %2$s, and %3$s from now.</item>
    </string-array>

wrong strings:
    <string-array name="alarm_set">
        <item>This alarm is set for less than 1 minute from now.</item>
        <item>This alarm is set for %1$s from now.</item>
        <item>This alarm is set for %2$s from now.</item>
        <item>This alarm is set for %1$1$s and %2$2$s from now.</item>
        <item>This alarm is set for %3$s from now.</item>
        <item>This alarm is set for %1$1$s and %2$3$s from now.</item>
        <item>This alarm is set for %1$2$s and %2$3$s from now.</item>
        <item>This alarm is set for %1$1$s, %2$2$s, and %3$3$s from now.</item>
    </string-array>

Original comment by mrja...@gmail.com on 3 Oct 2011 at 4:32

GoogleCodeExporter commented 9 years ago
can confirm this issue with sevral APKs.
this happens with values in arrays.xml and plurals.xml.

noticeable apks:
clockpackage.apk
mms.apk

Original comment by shauli.b...@gmail.com on 18 Nov 2011 at 8:56

GoogleCodeExporter commented 9 years ago

Original comment by Brut.alll on 2 Dec 2011 at 2:40