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

Enhancement Request: Nicer Json output for info command #147

Open
SZRabinowitz opened this issue Nov 18, 2024 · 2 comments
Open

Enhancement Request: Nicer Json output for info command #147

SZRabinowitz opened this issue Nov 18, 2024 · 2 comments

Comments

@SZRabinowitz
Copy link

When I run:
java -jar apkeditor.jar info -i input.apk -t json
It outputs a JSON list of many Dicts. For example:

[
 {
  "package":"com.waze"
 },
 {
  "VersionCode":1021577
 },
 {
  "VersionName":"9999.46.0.2"
 },
 {
  "AppName":"Waze"
 },
 {
  "AppIcon":"res/drawable-ldpi-v4/launch_icon.png"
 },
 {
  "application-class":"com.waze.WazeApplication"
 },
 {
  "activity-main":"com.waze.FreeMapAppActivity"
 }
]

This isn't the most optimized output for anything automated. Lookups are not easy. It would better to have this output:

[
 {
  "package":"com.waze",
  "VersionCode":1021577,
  "VersionName":"9999.46.0.2",
  "AppName":"Waze",
  "AppIcon":"res/drawable-ldpi-v4/launch_icon.png",
  "application-class":"com.waze.WazeApplication",
  "activity-main":"com.waze.FreeMapAppActivity",
 }
]

With this output, it will be easy to lookup any key and get a value. Example: result.getString("activity-main");. The current implementation looking through each set of key, value to find the right one.

@REAndroid please let me know your thoughts, thank you for this amazing project!

@REAndroid
Copy link
Owner

@SZRabinowitz
Sorry for late reply,

Your points makes much sense, my initial thought while designing info was to provide information specific as per user demand in any of offered formats, for example you might need only to print package and dex.

This info feature needs a lot modifications including using uniform and widely used names like the one defined under AndroidManifest.

I currently busy at massive rework on ARSCLib, I highly appreciate if you (or someone) do PR.

Thank you!

AbhiTheModder added a commit to AbhiTheModder/APKEditor that referenced this issue Nov 27, 2024
Refactored `InfoWriterJson` to produce a single JSON object containing all information. This addresses the issue of fragmented JSON output (REAndroid#147). The `writeStringPool` method now correctly adds its data to the main JSON object.
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

No branches or pull requests

3 participants
@REAndroid @SZRabinowitz and others