Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

lose layout_width attribute?

Open iBotPeaches opened this issue 11 years ago • 17 comments

Original issue 176 created by coolfree on 2011-06-12T02:33:45.000Z:

1.decompile mms.apk 2.recompile (nothing chang) 3.put into mobile mms FC logcat

E/AndroidRuntime( 2668): FATAL EXCEPTION: main E/AndroidRuntime( 2668): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mms/com.android.mms.ui.ConversationList}: java.lang.Runt imeException: Binary XML file line # 4: You must supply a layout_width attribute.

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #1 originally posted by Brut.alll on 2011-06-12T12:10:47.000Z:

Could you upload mms.apk and framework if needed to multiupload.com or somewhere?

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #2 originally posted by coolfree on 2011-06-12T15:17:28.000Z:

Hi,Brut.alll mms.apk and framework.apk is here http://www.multiupload.com/377CF3HHPM

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #3 originally posted by coolfree on 2011-06-12T15:37:30.000Z:

hi,Brut.alll

D:\Incredible\2.3\app_1>call apktool d -f -t incre2.31 GenieWidget.apk

I: Baksmaling... I: Loading resource table... I: Loaded. I: Loading resource table from file: C:\Documents and Settings\coolfree\apktool
framework\1.apk I: Loaded. I: Decoding file-resources... I: Decoding values_/_ XMLs... Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind ex out of range: 13 at java.lang.String.charAt(Unknown Source) at brut.androlib.res.xml.ResXmlEncoders.findNonPositionalSubstitutions(R esXmlEncoders.java:165) at brut.androlib.res.xml.ResXmlEncoders.hasMultipleNonPositionalSubstitu tions(ResXmlEncoders.java:138) at brut.androlib.res.data.value.ResStringValue.serializeExtraXmlAttrs(Re sStringValue.java:63) at brut.androlib.res.data.value.ResScalarValue.serializeToResValuesXml(R esScalarValue.java:65) at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour ces.java:264) at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137 ) at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93) at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98) at brut.apktool.Main.cmdDecode(Main.java:120) at brut.apktool.Main.main(Main.java:57) I: Baksmaling... I: Loading resource table... W: Skipping "android" package group I: Loaded. I: Loading resource table from file: C:\Documents and Settings\coolfree\apktool
framework\1.apk I: Loaded. I: Loading resource table from file: C:\Documents and Settings\coolfree\apktool
framework\2-incre2.31.apk I: Loaded. I: Decoding file-resources... I: Decoding values_/_ XMLs... Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind ex out of range: 31 at java.lang.String.charAt(Unknown Source) at brut.androlib.res.xml.ResXmlEncoders.findNonPositionalSubstitutions(R esXmlEncoders.java:165) at brut.androlib.res.xml.ResXmlEncoders.enumerateNonPositionalSubstituti ons(ResXmlEncoders.java:142) at brut.androlib.res.data.value.ResStringValue.encodeAsResXmlValue(ResSt ringValue.java:45) at brut.androlib.res.data.value.ResArrayValue.serializeToResValuesXml(Re sArrayValue.java:55) at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour ces.java:264) at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137 ) at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93) at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98) at brut.apktool.Main.cmdDecode(Main.java:120) at brut.apktool.Main.main(Main.java:57)

this is htc new version rom download here include Settings.apk GenieWidget and com.htc.resources.apk framework-res.apk http://www.multiupload.com/4DXUMQAW80

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #4 originally posted by Brut.alll on 2011-06-12T16:47:43.000Z:

"mms.apk and framework.apk is here"

I need Samsung's framework as well (most probably twframework-res.apk). I have tried one from Samsung Galaxy S2, but it didn't work.

"this is htc new version rom download here include Settings.apk GenieWidget and com.htc.resources.apk framework-res.apk"

Is this in any way related to above issue?

See Issue 169

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #5 originally posted by coolfree on 2011-06-12T18:04:18.000Z:

Hi,friend http://www.multiupload.com/Q5E7VV3R9I samsung apk files

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #6 originally posted by Brut.alll on 2011-06-12T19:33:36.000Z:

I think the problem is in res/layout/conversation_list_item.xml# 4: "style="@android:style/Widget.QuickContactBadge.WindowSmall". I don't know what that asterisk is, in AOSP there is a "?" there. I've checked that and seems it was really modified to "@", but I don't know why.

I have rebuilt this apk and seems "@*" was rebuilt properly - it's exactly the same as original apk. What version of aapt do you use? Could you upload Mms.apk rebuilt by you (which doesn't work)?

You could also try to change "@*" to "?" in res/layout/message_contact_header.xml, res/layout/search_item.xml, res/layout/conversation_list_item.xml and see if that helps.

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #7 originally posted by coolfree on 2011-06-12T19:48:33.000Z:

http://www.multiupload.com/93QOYUVBGJ friend,it's my build, nothing change

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #8 originally posted by coolfree on 2011-06-12T19:54:54.000Z:

Hi,friend there are other error message

E/AndroidRuntime( 2668): FATAL EXCEPTION: main E/AndroidRuntime( 2668): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mms/com.android.mms.ui.ConversationList}: java.lang.RuntimeException: Binary XML file line # 4: You must supply a layout_width attribute. E/AndroidRuntime( 3090): FATAL EXCEPTION: main E/AndroidRuntime( 3090): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mms/com.android.mms.ui.ConversationList}: java.lang.RuntimeException: Binary XML file line # 4: You must supply a layout_width attribute. E/AndroidRuntime( 3090): Caused by: java.lang.RuntimeException: Binary XML fileline # 4: You must supply a layout_width attribute. E/AndroidRuntime( 2969): FATAL EXCEPTION: main E/AndroidRuntime( 2969): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity}: java.lang.RuntimeException: Binary XML file line # 5: You must supply a layout_width attribute. E/AndroidRuntime( 3279): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity}: java.lang.RuntimeException: Binary XML file line # 5: You must supply a layout_width attribute. E/AndroidRuntime( 3279): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)

2011/6/13 CoolFree [email protected]

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #9 originally posted by coolfree on 2011-06-12T19:58:54.000Z:

friend,i will change @_android to ?_android and build it now and test it

2011/6/13 CoolFree [email protected]

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #10 originally posted by coolfree on 2011-06-12T20:07:55.000Z:

aapt v it's version is V0.2

2011/6/13 CoolFree [email protected]

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #11 originally posted by coolfree on 2011-06-12T20:20:06.000Z:

hi ,friend i change @*android to ?android build and put to mobile, it's same error

E/AndroidRuntime( 2753): FATAL EXCEPTION: main E/AndroidRuntime( 2753): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mms/com.android.mms.ui.ConversationList}: java.lang.RuntimeException: Binary XML file line # 4: You must supply a layout_width attribute. E/AndroidRuntime( 2753): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)

2011/6/13 CoolFree [email protected]

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #12 originally posted by Brut.alll on 2011-06-12T23:01:42.000Z:

Original XML:

E: android.widget.QuickContactBadge (line=26)
  A: android:id(0x010100d0)=@0x7f080036
  A: android:visibility(0x010100dc)=(type 0x10)0x2
  A: android:layout_marginLeft(0x010100f7)=(type 0x5)0x701
  A: android:layout_centerVertical(0x01010191)=(type 0x12)0xffffffff
  A: style=@0x1030085 (Raw: "@*android:style/Widget.QuickContactBadge.WindowSmall")

XML rebuilt by you:

E: android.widget.QuickContactBadge (line=4)
  A: android:id(0x010100d0)=@0x7f080036
  A: android:visibility(0x010100dc)=(type 0x10)0x2
  A: android:layout_marginLeft(0x010100f7)=(type 0x5)0x701
  A: android:layout_centerVertical(0x01010191)=(type 0x12)0xffffffff
  A: style=@0x103011d (Raw: "@*android:style/Widget.QuickContactBadge.WindowSmall")

As you can see ID of style attr has changed. 0x1030085 is an ID of Widget.QuickContactBadge.WindowSmall from Samsung's framework and 0x103011d is from Android SDK. It seems you have decoded apk with Samsung's framework installed and then you have removed $HOME/apktool/framework/1.apk or you have reinstalled it. Just install framework-res.apk (the same you have sent me), build apk and try to run it.

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #13 originally posted by coolfree on 2011-06-13T02:01:06.000Z:

Hi, friend http://www.multiupload.com/PFQMIESLVI this is new rebuild. i reinstall framework. this have same error

BTW

i cook samsung I997 rom mms.apk have same error

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #14 originally posted by Brut.alll on 2011-06-13T08:39:52.000Z:

Nope, it's still 0x103011d:

 E: android.widget.QuickContactBadge (line=4)
  A: android:id(0x010100d0)=@0x7f080036
  A: android:visibility(0x010100dc)=(type 0x10)0x2
  A: android:layout_marginLeft(0x010100f7)=(type 0x5)0x701
  A: android:layout_centerVertical(0x01010191)=(type 0x12)0xffffffff
  A: style=@0x103011d (Raw: "@*android:style/Widget.QuickContactBadge.WindowSmall")

Run "aapt d xmltree Mms.apk res/layout/conversation_list_item.xml" to see above output. IDs have to be exactly the same as in original apk, so style=@0x1030085. And if you look into your framework file:

aapt d resources i500_1/framework-res.apk | grep -i Widget.QuickContactBadge.WindowSmall

  spec resource 0x01030085 android:style/Widget.QuickContactBadge.WindowSmall: flags=0x00000000
    resource 0x01030085 android:style/Widget.QuickContactBadge.WindowSmall: <bag>

you'll find Widget.QuickContactBadge.WindowSmall is set to 0x01030085 in your file, not to 0x103011d, so I'm pretty sure you didn't build above apk using this framework. Did you maybe install twframework-res.apk, but didn't install framework-res.apk?

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #15 originally posted by coolfree on 2011-06-13T09:53:40.000Z:

Hi friend big thans to u i use other framework in my script file .so make this error file i'm sorry,friend

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

Comment #16 originally posted by Brut.alll on 2011-06-13T11:33:01.000Z:

It's ok :-)

iBotPeaches avatar Mar 18 '15 02:03 iBotPeaches

this error again on 2.40 version

08-03 18:07:17.321: E/AndroidRuntime(23727): Caused by: java.lang.UnsupportedOperationException: Binary XML file line #4: You must supply a layout_width attribute.
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:711)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:7095)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:7277)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.widget.FrameLayout$LayoutParams.<init>(FrameLayout.java:506)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:446)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:68)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:841)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.view.LayoutInflater.parseInclude(LayoutInflater.java:943)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:802)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
08-03 18:07:17.321: E/AndroidRuntime(23727): 	... 19 more

eriklu avatar Aug 03 '19 10:08 eriklu