Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

Use apktool 2.4.0 and aapt2,recomile success ,but if use AppcompatActivity,throws an exception

Open Beery1 opened this issue 7 years ago • 6 comments

Information

  1. Apktool Version (apktool -version) - 2.4.0
  2. Operating System (Mac, Linux, Windows) -Linux
  3. APK From? (Playstore, ROM, Other) - other

I use the game mother package and channel package to do the aggregation, the separate game mother package operation and channel package operation is normal, the channel package is inherited AppcompatActivity, so the Theme.AppCompat theme is needed, and my project res resource contains the theme. I don’t know why, I get an error after the aggregation. Please help me .

Stacktrace/Logcat

java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

Steps to Reproduce

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files (.apks that live in /system/framework or /system/priv-app)

APK

If this APK can be freely shared, please upload/attach a link to it.

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything?
  2. If you are trying to install a modified apk, did you resign it?
  3. Are you using the latest apktool version?

Beery1 avatar Sep 11 '19 07:09 Beery1

same problem

f0restw0w avatar Nov 08 '19 07:11 f0restw0w

你看下你的Theme 资源ID和你的资源名称是不对应的。 合并的时候,smali文件里使用的ID和public.xml的ID没对应上

f0restw0w avatar Nov 08 '19 08:11 f0restw0w

你看下你的Theme 资源ID和你的资源名称是不对应的。 合并的时候,smali文件里使用的ID和public.xml的ID没对应上

将两个包的资源合并的时候,我会先删除掉public.xml 文件,然后再根据aapt2的规则重新生成R.java 文件,这个时候public.xml是一份新的文件吧。 请问下如何做能让ID保持一致呢?

Beery1 avatar Nov 20 '19 09:11 Beery1

@Beery1 I replaced its id in smali file but it seam not to work, how did you solve this?

nimamoradi avatar Mar 13 '20 17:03 nimamoradi

@Beery1 I replaced its id in smali file but it seam not to work, how did you solve this?

不好意思,暂时没有解决这个问题,你的办法我也试过,都不能解决这个问题

Beery1 avatar Mar 24 '20 09:03 Beery1

It looks like the error itself tells you - > You need to use a Theme.AppCompat theme (or descendant) with this activity.

If Apktool caused this - what was the old? What is intended? What did it do?

We are reverse engineering here, need a bit more details.

Either way, a year+ passed (apologies). So going to close this,

iBotPeaches avatar Nov 28 '20 22:11 iBotPeaches