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

[BUG] cannot recompile gboard.apk #2778

Closed
jiashie opened this issue Mar 12, 2022 · 4 comments
Closed

[BUG] cannot recompile gboard.apk #2778

jiashie opened this issue Mar 12, 2022 · 4 comments
Milestone

Comments

@jiashie
Copy link

jiashie commented Mar 12, 2022

Information

  1. Apktool Version (apktool -version) -
    2.6.1
  2. Operating System (Mac, Linux, Windows) -
    windows
  3. APK From? (Playstore, ROM, Other) -
    gboard,version 11.5.04.427194903, from playstore

Stacktrace/Logcat

Include stacktrace here
>I: Using Apktool 2.6.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether resources has changed...
I: Building resources...
W: F:\tmpApk\gboard\res\layout\APKTOOL_DUPLICATE_layout_0x7f0e0003.xml:2: error: No resource identifier found for attribute 'divider' in package 'com.google.android.inputmethod.latin'
W:
W: F:\tmpApk\gboard\res\layout\APKTOOL_DUPLICATE_layout_0x7f0e0003.xml:2: error: No resource identifier found for attribute 'dividerPadding' in package 'com.google.android.inputmethod.latin'
W:
W: F:\tmpApk\gboard\res\layout\APKTOOL_DUPLICATE_layout_0x7f0e0005.xml:2: error: No resource identifier found for attribute 'srcCompat' in package 'com.google.android.inputmethod.latin'
....
error: No resource identifier found for attribute 'fontProviderPackage' in package 'com.google.android.inputmethod.latin'
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\xxx\AppData\Local\Temp\brut_util_Jar_66849209130865219152362277066519366901.tmp, p, --forced-package-id, 127, --min-sdk-version, 23, --target-sdk-version, 31, --version-code, 78716822, --version-name, 11.5.04.427194903-release-arm64-v8a, --no-version-vectors, -F, C:\Users\xxx\AppData\Local\Temp\APKTOOL4245597754793566276.tmp, -e, C:\Users\xxx\AppData\Local\Temp\APKTOOL2807030578629431984.tmp, -0, arsc, -I, C:\Users\xxx\AppData\Local\apktool\framework\1.apk, -S, F:\tmpApk\gboard\res, -M, F:\tmpApk\gboard\AndroidManifest.xml]
W:
W: F:\tmpApk\gboard\res\font\APKTOOL_DUPLICATE_font_0x7f090006.xml:2: error: No resource identifier found for attribute 'fontProviderQuery' in package 'com.google.android.inputmethod.latin'

Steps to Reproduce

  1. apktool

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)
already run apktool2.6.1.jar empty-framework-dir --force

APK

If this APK can be freely shared, please upload/attach a link to it.
https://play.google.com/store/apps/details?id=com.google.android.inputmethod.latin

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?
  3. Are you using the latest apktool version?
    YES
@iBotPeaches
Copy link
Owner

I'm not obtaining the same error you mention, but a different one.

➜  2778 apktool b com.google.android.inputmethod.latin_11.5.04.427194903-beta-armeabi-v7a-78716813_minAPI23\(armeabi-v7a\)\(nodpi\)_apkmirror.com --use-aapt2
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
I: Using Apktool 2.6.1-ddc4bb-SNAPSHOT
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: /home/ibotpeaches/Downloads/Apktool/2778/com.google.android.inputmethod.latin_11.5.04.427194903-beta-armeabi-v7a-78716813_minAPI23(armeabi-v7a)(nodpi)_apkmirror.com/AndroidManifest.xml:43: error: unexpected element <uses-native-library> found in <manifest><application>.
W: /home/ibotpeaches/Downloads/Apktool/2778/com.google.android.inputmethod.latin_11.5.04.427194903-beta-armeabi-v7a-78716813_minAPI23(armeabi-v7a)(nodpi)_apkmirror.com/AndroidManifest.xml:44: error: unexpected element <uses-native-library> found in <manifest><application>.

So holding open for a bit since unsure.

@pashamcr
Copy link
Contributor

@iBotPeaches
Copy link
Owner

@iBotPeaches you have the old code aapt2 aosp-mirror/platform_frameworks_base@6a5b8b1#diff-87a131c4fe0533388598e0e20792541b7347fca9bb6aea96036c64ba3a773fd8

Thanks, I'm in the process of an upgrade for that other ticket. Probably not updating aapt1 though.

@iBotPeaches iBotPeaches added this to the v2.6.2 milestone Mar 21, 2022
@iBotPeaches
Copy link
Owner

I've started revert of affected code here - #2785 and have an aapt2/aapt1 upgrade in process locally. Seems like 116k commits between upstream and mine, so I will probably re-apply all patches manually in 2 commits (aapt/aapt2) since this is getting difficult to keep up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants