[PR #4696] fix(apktool): fall back to packageInfo when manifest package is omitted #6363

Open
opened 2026-10-31 01:13:53 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4696
Author: @abhishek1kr
Created: 10/17/2026
Status: 🔄 Open

Base: main ← Head: fix/apktool-package-fallback


📝 Commits (1)

  • 9421b18 fix(apktool): fall back to packageInfo when manifest package is omitted

📊 Changes

4 files changed (+311 additions, -31 deletions)

View changed files

📝 src/apktool/ApktoolDecodeOutput.test.ts (+206 -14)
📝 src/apktool/ApktoolDecodeOutput.ts (+62 -16)
📝 src/apktool/ApktoolProvider.test.ts (+41 -0)
📝 src/apktool/ApktoolProvider.ts (+2 -1)

📄 Description

Summary

Falls back to apktool.yml package identity (packageInfo: / resourcesInfo:) when modern Android manifests omit the root package attribute.

Problem and expected behavior

In modern Android builds, AndroidManifest.xml often omits the root package attribute. REA now falls back to Apktool metadata while retaining explicit null when neither source declares a package.

Change and scope

  • Adapted package resolution into the shared metadata owner in src/apktool/ApktoolDecodeOutput.ts.
  • Supports both Apktool 2 (YAML) and Apktool 3 (line-oriented) dialects.
  • Enforces source precedence: Manifest identity > cur_package > orig_package > renameManifestPackage > resourcesInfo.packageName.
  • Normalizes empty strings ("", "''", ""), "null", "~" to explicit null.
  • Rejects duplicate sections, duplicate fields, and malformed string escapes in Apktool 3 metadata.

Validation performed

  • npm run test:local -- src/apktool/ApktoolDecodeOutput.test.ts — 59 tests passing
  • npm run check:fast — turbo typecheck and lint passing with 0 errors

Author readiness

Human owner: @abhishek1kr

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4696 **Author:** [@abhishek1kr](https://github.com/abhishek1kr) **Created:** 10/17/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/apktool-package-fallback` --- ### 📝 Commits (1) - [`9421b18`](https://github.com/morluto/rea/commit/9421b186e452b92c98e7c270c26052c01d80d3d5) fix(apktool): fall back to packageInfo when manifest package is omitted ### 📊 Changes **4 files changed** (+311 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `src/apktool/ApktoolDecodeOutput.test.ts` (+206 -14) 📝 `src/apktool/ApktoolDecodeOutput.ts` (+62 -16) 📝 `src/apktool/ApktoolProvider.test.ts` (+41 -0) 📝 `src/apktool/ApktoolProvider.ts` (+2 -1) </details> ### 📄 Description ## Summary Falls back to `apktool.yml` package identity (`packageInfo:` / `resourcesInfo:`) when modern Android manifests omit the root `package` attribute. ## Problem and expected behavior In modern Android builds, `AndroidManifest.xml` often omits the root `package` attribute. REA now falls back to Apktool metadata while retaining explicit `null` when neither source declares a package. ## Change and scope - Adapted package resolution into the shared metadata owner in `src/apktool/ApktoolDecodeOutput.ts`. - Supports both Apktool 2 (YAML) and Apktool 3 (line-oriented) dialects. - Enforces source precedence: Manifest identity > `cur_package` > `orig_package` > `renameManifestPackage` > `resourcesInfo.packageName`. - Normalizes empty strings (`""`, `"''"`, `""`), `"null"`, `"~"` to explicit `null`. - Rejects duplicate sections, duplicate fields, and malformed string escapes in Apktool 3 metadata. ## Validation performed - `npm run test:local -- src/apktool/ApktoolDecodeOutput.test.ts` — 59 tests passing - `npm run check:fast` — turbo typecheck and lint passing with 0 errors ## Author readiness Human owner: @abhishek1kr - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6363
No description provided.