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

fix: resolve missing namespace on system resources #3234

Merged
merged 2 commits into from
Jul 30, 2023
Merged

Conversation

iBotPeaches
Copy link
Owner

@iBotPeaches iBotPeaches commented Jul 30, 2023

In some applications we see the associated namespace is stripped completely.

➜  2972 aapt2 dump xmltree base.apk --file AndroidManifest.xml
N: android=http://schemas.android.com/apk/res/android (line=0)
  E: manifest (line=0)
    A: http://schemas.android.com/apk/res/android:versionCode(0x0101021b)=23608
    A: (0x0101021c)="2.36.8" (Raw: "2.36.8")
    A: (0x01010572)=30
    A: (0x01010573)="11" (Raw: "11")
    A: package="com.bcp.innovacxion.yapeapp" (Raw: "com.bcp.innovacxion.yapeapp")
    A: platformBuildVersionCode=30
    A: platformBuildVersionName=11
      E: uses-sdk (line=0)
        A: (0x0101020c)=21
        A: (0x01010270)=30
      E: supports-screens (line=0)
        A: (0x0101026c)=true
        A: (0x01010284)=true
        A: (0x01010285)=true
        A: (0x01010286)=true
        A: (0x0101028d)=true
        A: (0x010102bf)=true

The fix here in theory is easy - resolve resourceId and if you know its a manifest attribute - use it. However that would require us to track all manifest attributes much like android.R.attr.

So this first approach will use any system resource only if the manifest prefix resolved to nothing. This seems safe because we won't touch internal resources or private.

fixes: #2972

@iBotPeaches iBotPeaches marked this pull request as ready for review July 30, 2023 11:06
@iBotPeaches iBotPeaches merged commit cd275ff into master Jul 30, 2023
31 checks passed
@iBotPeaches iBotPeaches deleted the issue-2972 branch July 30, 2023 11:18
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

Successfully merging this pull request may close these issues.

[BUG] Element type "manifest" must be followed by either attribute
1 participant