[d] Some resource XML files are not decoded (left as root/res/alias_<hash> raw AXML)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
Start from the decompile path that logs “Decoding file resources” and how layout entries in resources.arsc are mapped through path-map.json and alias_* files under root/res. Compare decoded files under resources/package_1/res/layout with the 276 layouts that stay raw AXML (e.g. res/Zy.xml / ime_inputview_root). Done when those layouts decode to XML like aapt2/apktool, or a warning is emitted when a file is skipped. Use the attached apkeditor_repro_min.apk.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Resource XML files are only partially decoded. aapt2 reports 579 layout/* resources in resources.arsc, but apkeditor d only writes 303 of them as XML under resources/package_1/res/layout/. The remaining 276 are not decoded at all — they are kept as raw (binary) files under root/res/alias_<hash> and only referenced from path-map.json and resources/package_1/res/values/layouts.xml:
resources/package_1/res/values/layouts.xml
<layout name="ime_inputview_root">res/Zy.xml</layout>
path-map.json
{ "name": "res/Zy.xml", "alias": "res/alias_1f76152b" }
So no data is lost, but the XML is not decoded (it stays AXML). Nothing is printed on the console — it fails silently.
The set of files that do get decoded looks arbitrary: it is not split by resource-id range, not by package (there is only 0x7f), and not by "file referenced by several resources". Decoded and missing entries are interleaved.
To Reproduce
- Used version: 1.4.9 (
apkeditor.jar, 7.61 MB) - Operating system: Windows 11 x64 (the bug is in pure Java, so it should reproduce on any OS)
- Command:
java -jar APKEditor.jar d -i apkeditor_repro_min.apk -o out
Then check the numbers:
# resources.arsc declares 579 layout resources:
aapt2 dump resources apkeditor_repro_min.apk | grep ' layout/' | wc -l
# -> 579
# apkeditor only decoded 303 of them:
ls out/resources/package_1/res/layout | wc -l
# -> 303
# the other 276 are kept as raw AXML (not decoded):
ls out/root/res/alias_*
Log/Stacktrace
No error or warning is printed (this is the main problem — it is silent):
I: [DECOMPILE] Loading resource table...
I: [DECOMPILE] Decoding value resources...
I: [DECOMPILE] Loading resource table from file: ...\framework\1.apk
I: [DECOMPILE] Decoding file resources...
I: [DECOMPILE] Generating values XMLs...
I: [DECOMPILE] Decoding AndroidManifest.xml with resources...
I: [DECOMPILE] Copying original files...
I: [DECOMPILE] Copying assets...
I: [DECOMPILE] Copying lib...
I: [DECOMPILE] Copying unknown files...
I: [DECOMPILE] Saved to: out
Used apk file
apkeditor_repro_min.apk (1.5 MB) — attached.
It is a trimmed version of a real APK (only AndroidManifest.xml + resources.arsc + res/**; dex/assets/lib removed) and it reproduces exactly the same behaviour as the full APK. The resource table and all res/ files are byte-identical to the original.
Additional context
aapt2 dump xmltree apkeditor_repro_min.apk --file res/Zy.xmldecodes one of the missing files fine → the file itself is a valid binary XML; it is apkeditor's decoder that skips it.apkeditor d -keep-res-pathshows that all res files are present (res-files/res/…) — so this is not a "file is missing from the APK" problem.- Examples of missing resources (all present in
resources.arsc):
layout/ime_inputview_root(res/Zy.xml),layout/layout_image_key,layout/view_candidate_list,layout/abc_action_bar_up_container,layout/ime_onehand_left, … - The APK uses resource path obfuscation: the files on disk are
res/Zy.xml,res/GF.xml,res/-B.xml, … while the resource names inresources.arscare intact. Maybe the decoder bails out on something in that setup (e.g. sparse type encoding / optimized table)? - For comparison,
apktool 3.0.3decodes all 578 entries intores/layout/on the same APK — so the APK itself is fine. - Expected: all 579
layout/*resources decoded as XML (or at least a warning/error when some are skipped).
- 主要言語
- Java
- スター
- 2.3k
- フォーク
- 417
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
REAndroid/APKEditor のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
REAndroid/APKEditor の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
jenkins-infra/plugin-modernizer-tool#2070 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Event search answers 500 when calendars, attendees or organizers holds a null element再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンai-driven-qa bug Minor
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
linagora/twake-calendar-side-service#1615 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
eclipse-tradista/tradista#371 ·
メンテナーはふだん 1 日以内に返信
-
critical
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mars-sim/mars-sim#2199 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信