[PR #2835] [CLOSED] fix(apktool): exclude configuration qualifiers from discovered locales #5425

Closed
opened 2026-10-31 01:06:31 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2835
Author: @taljeri
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: fix/apktool-exclude-configuration-locales


📝 Commits (3)

  • b2bcbbb fix(apktool): exclude configuration qualifiers from discovered locales
  • 04f7690 fix(android): require explicit invoke coverage state
  • 656fe35 fix(android): align direct invoke schema with main

📊 Changes

4 files changed (+79 additions, -5 deletions)

View changed files

📝 src/apktool/ApktoolProvider.test.ts (+61 -1)
📝 src/apktool/ApktoolProvider.ts (+5 -1)
📝 src/domain/android/androidAnalysis.ts (+2 -2)
📝 src/domain/apktool/apktoolResourceAnalysis.ts (+11 -1)

📄 Description

Summary

Fixes #2563

Decoding an APK that has strings tables under Android configuration directories reported those directory suffixes as available locales. The returned locale list could therefore include configuration qualifiers such as night, v21, or UI mode car, which are not language locales and cannot be used as valid locale requests.

Filter discovered resource directory suffixes through isResourceLocaleQualifier, verifying that the suffix matches the locale grammar and excludes configuration qualifiers such as car mode.

Changes

  • In src/domain/apktool/apktoolResourceAnalysis.ts, export RESOURCE_LOCALE_PATTERN and isResourceLocaleQualifier to identify genuine locale directory qualifiers while excluding configuration qualifiers (such as UI mode car).
  • In src/apktool/ApktoolProvider.ts, use isResourceLocaleQualifier during decoded directory traversal in countDecodedFiles so only valid resource locale tables are collected.
  • In src/apktool/ApktoolProvider.test.ts, add regression test with a fixture containing values-car, values-night, values-v21, and values-de, asserting that locales reports only ["de"] while preserving string projection.
  • Add unit test matrix for isResourceLocaleQualifier classifying valid locales vs Android configuration qualifiers.

Verification

  • npm run test:focused -- src/apktool/ApktoolProvider.test.ts (37/37 passed)
  • npm run verify:test-discovery (1066 test files discovered)
  • npm run verify:module-boundaries (1725 source files checked)

🔄 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/2835 **Author:** [@taljeri](https://github.com/taljeri) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/apktool-exclude-configuration-locales` --- ### 📝 Commits (3) - [`b2bcbbb`](https://github.com/morluto/rea/commit/b2bcbbbad9cf4b97fa9166898139d58329313a2b) fix(apktool): exclude configuration qualifiers from discovered locales - [`04f7690`](https://github.com/morluto/rea/commit/04f76909a958178c630332faaddcb7b4fcb2b43f) fix(android): require explicit invoke coverage state - [`656fe35`](https://github.com/morluto/rea/commit/656fe35c099213e560b2b78a692e0897a87cfe55) fix(android): align direct invoke schema with main ### 📊 Changes **4 files changed** (+79 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/apktool/ApktoolProvider.test.ts` (+61 -1) 📝 `src/apktool/ApktoolProvider.ts` (+5 -1) 📝 `src/domain/android/androidAnalysis.ts` (+2 -2) 📝 `src/domain/apktool/apktoolResourceAnalysis.ts` (+11 -1) </details> ### 📄 Description ## Summary Fixes #2563 Decoding an APK that has strings tables under Android configuration directories reported those directory suffixes as available locales. The returned locale list could therefore include configuration qualifiers such as `night`, `v21`, or UI mode `car`, which are not language locales and cannot be used as valid locale requests. Filter discovered resource directory suffixes through `isResourceLocaleQualifier`, verifying that the suffix matches the locale grammar and excludes configuration qualifiers such as car mode. ## Changes - In `src/domain/apktool/apktoolResourceAnalysis.ts`, export `RESOURCE_LOCALE_PATTERN` and `isResourceLocaleQualifier` to identify genuine locale directory qualifiers while excluding configuration qualifiers (such as UI mode `car`). - In `src/apktool/ApktoolProvider.ts`, use `isResourceLocaleQualifier` during decoded directory traversal in `countDecodedFiles` so only valid resource locale tables are collected. - In `src/apktool/ApktoolProvider.test.ts`, add regression test with a fixture containing `values-car`, `values-night`, `values-v21`, and `values-de`, asserting that `locales` reports only `["de"]` while preserving string projection. - Add unit test matrix for `isResourceLocaleQualifier` classifying valid locales vs Android configuration qualifiers. ## Verification - `npm run test:focused -- src/apktool/ApktoolProvider.test.ts` (37/37 passed) - `npm run verify:test-discovery` (1066 test files discovered) - `npm run verify:module-boundaries` (1725 source files checked) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:06:31 +00:00
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#5425
No description provided.