Skip to content

[tools] Replace APK utilities with skill file apps - #12108

Merged
jonathanpeppers merged 3 commits into
mainfrom
dev/simonrozsival/android-tool-file-apps
Jul 23, 2026
Merged

[tools] Replace APK utilities with skill file apps#12108
jonathanpeppers merged 3 commits into
mainfrom
dev/simonrozsival/android-tool-file-apps

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Summary

  • replace the standalone assembly-store reader and decompressor executable projects with .NET file-based apps owned by repository skills
  • expand read-assembly-store to invoke its bundled app directly
  • add an extract-android-assemblies skill for customer APK/AAB investigation and decompilation preparation
  • remove the obsolete legacy reader project, launch wrappers, and solution entries while retaining the shared compatibility parser
  • build both file apps in CI

Stack

This PR is stacked on #12104, which provides the shared v1/v2/v3 and LZ4/Zstd compatibility layer. Review this PR as the single commit on top of that branch. It can be retargeted to main after #12104 merges.

File apps

dotnet run --file .github/skills/read-assembly-store/scripts/read-assembly-store.cs -- <input>

dotnet run --file .github/skills/extract-android-assemblies/scripts/extract-android-assemblies.cs -- --output <directory> <input>

The extractor handles:

  • APK, AAB, raw store, manifest, store base-name, and DLL inputs
  • legacy and current assembly stores
  • raw, ELF payload, and _assembly_store wrappers
  • historical and current individually packaged assemblies
  • LZ4 and Zstd compression
  • multiple ABIs and satellite assemblies

Customer inputs remain local. Extraction rejects path traversal, output-name collisions, and overwrites.

Validation

  • both skills pass skill-creator validation and package successfully
  • both file apps build and run through their CI commands
  • shared parser builds for .NET 10 and .NET 11
  • 10 assembly-store compatibility tests pass
  • byte-for-byte extraction exercised for:
    • current store APKs
    • standalone stores
    • ELF-wrapped individual assemblies
    • current and historical satellite names
    • modern loose individual assemblies

Copilot AI review requested due to automatic review settings July 14, 2026 20:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Comment thread .github/skills/read-assembly-store/scripts/read-assembly-store.cs Outdated
Comment thread .github/skills/extract-android-assemblies/scripts/extract-android-assemblies.cs Outdated
@jonathanpeppers

Copy link
Copy Markdown
Member

/review

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — ⚠️ Needs minor changes

Reviewed the top commit ([tools] Replace APK utilities with skill file apps) on top of the stacked base #12104. The refactor cleanly consolidates the standalone reader/decompressor executables into two skill-owned dotnet run --file apps plus a shared AssemblyStorePayload helper, and wires both apps into Windows CI via --help smoke runs. The path-traversal guard (GetSafeOutputFile), overwrite refusal, and unique-output checks are good defensive touches.

Findings

  • ⚠️ 2 error-handling issues (inline): InvalidDataException from the path-traversal guard is not in Main’s catch list in the extractor, and ParseArchList throws an uncaught InvalidOperationException on bad --arch input in the reader. Both surface as stack traces instead of clean messages.
  • 💡 1 cleanup: empty unused ShowHelp () in the reader.

None are blockers, but the two error-handling items are worth addressing so malformed input/malicious archives fail gracefully.

Notes

  • CI status is currently pending (checks not yet reported) — verify the two new file-app build steps go green before merge.
  • Reviewed as the single commit atop #12104 per the PR description; retarget to main once #12104 lands.

Automated review; verify suggestions against full context.

Generated by Android PR Reviewer for #12108 · 106.2 AIC · ⌖ 18.8 AIC · ⊞ 6.8K
Comment /review to run again

Comment thread .github/skills/read-assembly-store/scripts/read-assembly-store.cs Outdated
Comment thread .github/skills/read-assembly-store/scripts/read-assembly-store.cs Outdated

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise this looks good. 👍

Base automatically changed from dev/simonrozsival/update-assembly-store-tools to main July 20, 2026 19:51
simonrozsival and others added 3 commits July 20, 2026 15:57
Move assembly-store inspection and managed assembly extraction into skill-owned .NET file-based apps. Remove the redundant executable projects and launch wrappers while keeping the shared compatibility parser and exercising both apps in CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 55493571-86e2-4326-850e-ea55883aa5d8
Report invalid architecture filters and path traversal errors without stack traces, remove dead reader code, and correct the extractor usage text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 55493571-86e2-4326-850e-ea55883aa5d8
Relocate the shared parser and compatibility tests under the read-assembly-store skill, update all source and project consumers, and remove the obsolete assembly-store-reader-mk2 directory.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8c81166b-f589-4e13-87d3-942acf3c9df2
@jonathanpeppers
jonathanpeppers force-pushed the dev/simonrozsival/android-tool-file-apps branch from 75188b8 to 197d0cb Compare July 20, 2026 20:59
@jonathanpeppers

Copy link
Copy Markdown
Member

/review

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Android PR Review — ⚠️ Minor suggestions (no blocking issues)

Reviewed as the single commit stacked on #12104: replacing the tools/assembly-store-reader* / decompress-assemblies executables with two dotnet run --file skill apps and moving the shared AssemblyStore parser + tests under .github/skills/read-assembly-store/.

Verdict

No bugs or correctness issues found. This is a clean, well-executed refactor. Two 💡 non-blocking suggestions posted inline.

Positive callouts

  • Path-traversal defense is solid. GetSafeOutputFile normalizes with Path.GetFullPath + Path.GetRelativePath and rejects rooted / ..-escaping paths, and writes use FileMode.CreateNew to refuse overwrites — good defense-in-depth for untrusted customer packages. HaveUniqueOutputs also prevents output-name collisions up front.
  • Improved arch parsing. TryParseArchList now validates against the supported set and returns a graceful error instead of the old ParseArchList throwing an uncaught InvalidOperationException.
  • New AssemblyStorePayload.TryExtractELFPayload validates stream capabilities, guards offset/size > Int64.MaxValue, pools its copy buffer via ArrayPool, and restores stream position on the not-ELF path.
  • Relative #:project paths verified correct for both file apps, and CI now smoke-builds both via dotnet run --file ... -- --help.

CI

Status is currently pending / no checks reported for 197d0cb. Not mergeable until the dotnet-android pipeline reports green — please confirm the two new "Build ... file app" steps and AssemblyStore.Tests pass.

Notes

  • This PR is stacked on #12104 and should be retargeted to main after that merges, per the description.

Prioritized: bugs > safety > performance > tests > duplication > consistency > docs. Suggestions are optional.

Generated by Android PR Reviewer for #12108 · 148.4 AIC · ⌖ 18.8 AIC · ⊞ 6.8K
Comment /review to run again

Comment thread .github/skills/read-assembly-store/scripts/read-assembly-store.cs
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 22, 2026
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) July 22, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants