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

No resource identifier found in package 'android' and Cant find 9patch chunk in file #1323

Closed
facetime88 opened this issue Sep 16, 2016 · 9 comments

Comments

@facetime88
Copy link

facetime88 commented Sep 16, 2016

Information

  1. Apktool Version (apktool -version) - APKTool V 2.2.0
  2. Operating System (Mac, Linux, Windows) - WIndows 10 x64
  3. APK From? (Playstore, ROM, Other) - APKpure.com which get from google play store.

Stacktrace/Logcat

This error shown when decompiling:

W: Cant find 9patch chunk in file: "drawable-hdpi-v4/show_head_toast_bg.9.PNG". Renaming it to *.png.

Then without making any change, recompile and got this error:

I: Using Apktool 2.2.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: warning: string 'text_add_io_success' has no default translation.
W: warning: string 'text_register_hint_user' has no default translation.
W: D:\Android\Decompiler\APKTool\geek\AndroidManifest.xml:32: error: No resource identifier found for attribute 'qihoo' in package 'android'
W: Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Me\AppData\Local\Temp\brut_util_Jar_6476050558657285376.tmp, p, --forced-package-id, 127, --min-sdk-version, 10, --target-sdk-version, 19, --version-code, 26, --version-name, 2.3.9, -F, C:\Users\Me\AppData\Local\Temp\APKTOOL1894102460996166075.tmp, -0, arsc, -0, appkey, -0, res/drawable-hdpi-v4/show_head_toast_bg.9.PNG, -0, arsc, -I, C:\Users\Me\AppData\Local\apktool\framework\1.apk, -S, D:\Android\Decompiler\APKTool\geek\res, -M, D:\Android\Decompiler\APKTool\geek\AndroidManifest.xml] at brut.androlib.Androlib.buildResourcesFull(Androlib.java:473) at brut.androlib.Androlib.buildResources(Androlib.java:407) at brut.androlib.Androlib.build(Androlib.java:306) at brut.androlib.Androlib.build(Androlib.java:263) at brut.apktool.Main.cmdBuild(Main.java:224) at brut.apktool.Main.main(Main.java:84) Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Me\AppData\Local\Temp\brut_util_Jar_6476050558657285376.tmp, p, --forced-package-id, 127, --min-sdk-version, 10, --target-sdk-version, 19, --version-code, 26, --version-name, 2.3.9, -F, C:\Users\Me\AppData\Local\Temp\APKTOOL1894102460996166075.tmp, -0, arsc, -0, appkey, -0, res/drawable-hdpi-v4/show_head_toast_bg.9.PNG, -0, arsc, -I, C:\Users\MeAppData\Local\apktool\framework\1.apk, -S, D:\Android\Decompiler\APKTool\geek\res, -M, D:\Android\Decompiler\APKTool\geek\AndroidManifest.xml] at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:439) at brut.androlib.Androlib.buildResourcesFull(Androlib.java:459) ... 5 more Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\MeAppData\Local\Temp\brut_util_Jar_6476050558657285376.tmp, p, --forced-package-id, 127, --min-sdk-version, 10, --target-sdk-version, 19, --version-code, 26, --version-name, 2.3.9, -F, C:\Users\Me\AppData\Local\Temp\APKTOOL1894102460996166075.tmp, -0, arsc, -0, appkey, -0, res/drawable-hdpi-v4/show_head_toast_bg.9.PNG, -0, arsc, -I, C:\Users\Me\AppData\Local\apktool\framework\1.apk, -S, D:\Android\Decompiler\APKTool\geek\res, -M, D:\Android\Decompiler\APKTool\geek\AndroidManifest.xml] at brut.util.OS.exec(OS.java:95) at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433) ... 6 more

Steps to Reproduce

  1. Install framework 'apktool if framework-res.apk' and 'apktool if twframework-res.apk'.
  2. Decompile file 'apktool d geek.apk'.
  3. Recompile.

Frameworks

framework-res.zip
twframework-res.zip

This framework taken from Samsung Galaxy Tab S 7" SM T-705 with Android 5.0.2, where app installed just fine from Google Play Store.

APK

apk.zip

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? Yes
  2. If you are trying to install a modified apk, did you resign it? Not yet, recompiling failed.
  3. Are you using the latest apktool version? Yes
@iBotPeaches
Copy link
Owner

➜  Bug1323 apktool d geek.apk 
I: Using Apktool 2.2.1-4c93cb-SNAPSHOT on geek.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/show_head_toast_bg.9.PNG". Renaming it to *.png.
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
➜  Bug1323 apktool b geek
I: Using Apktool 2.2.1-4c93cb-SNAPSHOT
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: warning: string 'text_add_io_success' has no default translation.
W: warning: string 'text_register_hint_user' has no default translation.
I: Copying libs... (/lib)
I: Building apk file...
W:     (skipping file '.appkey' due to ANDROID_AAPT_IGNORE pattern '.*')
I: Copying unknown files/dir...
➜  Bug1323 

(I removed the qihoo attribute. I don't see any reference to it in AOSP).

@PaulWoitaschek
Copy link

I don't get it. How did you make it work?

@facetime88
Copy link
Author

If you removed the qihoo attribute, the recompiled app will crashed. I have tried many times but still crashed.

@kenthd
Copy link

kenthd commented Apr 23, 2017

@iBotPeaches I also have the same problem, how to solve it, hope you soon guide me how to fix it

Thanks,
KENT

@hamoza3
Copy link

hamoza3 commented May 16, 2017

@iBotPeaches I removed the qihoo attribute from the AndroidManifest file
the line was

<application android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:name="com.qihoo.util.StubApp55217915" android:qihoo="activity" android:theme="@style/AppTheme">

And when i remove the qiloo

<application android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:name="com.qihoo.util.StubApp55217915" android:theme="@style/AppTheme">

But the apk that was build after signing it and install it on my phone is not working and i keep getting this message Unfortunately, (The App name) has stopped

Qihoo is a Chinese security company, who make an antivirus app for Android
`

`

@iBotPeaches
Copy link
Owner

Regardless of whatever the company is. That is an attribute that is not in an AOSP framework, therefore it is invalid. You cannot build the application without removing it.

Is it possible Qihoo is intercepting Android applications on download? Repackaging them and injecting contents and thus labeling them as Qihoo secure?

@ghost
Copy link

ghost commented Jun 26, 2017

Even deleting the line qihoo
Here is the Force Close of the application
screenshot_2017-06-26-21-40-30-481_com miui bugreport

@iBotPeaches
Copy link
Owner

That is a low level stack trace of native components, there is nothing there that points to the removal of qihoo attribute.

@ghost
Copy link

ghost commented Jun 26, 2017

Which can not do anything?

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