android-classyshark icon indicating copy to clipboard operation
android-classyshark copied to clipboard

Suggestion: Have a look at "apk-parser" library

Open AndroidDeveloperLB opened this issue 6 years ago • 13 comments

It offers various things that are missing here, and vice versa:

https://github.com/hsiafan/apk-parser

It would be great to have a single library that has both of what those libraries offer.

We could, this way, get resources data properly, maybe even parse more...

AndroidDeveloperLB avatar Nov 30 '19 11:11 AndroidDeveloperLB

Came here for this issue. Is this the apk-parser library you're referring to?

I'm getting drastically different numbers for .so file sizes when comparing the apkanalyzer and classy-shark.

https://android.googlesource.com/platform/tools/base/+/studio-master-dev/apkparser

kmadsen avatar Aug 17 '20 15:08 kmadsen

@kmadsen Sorry I forgot to put a link.

I wish I could have a reliable library&app to get information of APK files, on both Android and PC. Things such as : package-name, app-name (label), version-code, version-name, app-icon, whether it's a split APK or not...

AndroidDeveloperLB avatar Aug 17 '20 15:08 AndroidDeveloperLB

Hi all,

Few things here

  • package-name, app-name (label), version-code, version-name, app-icon ==> ClassyShark supports from the manifest (ClassyShark doesn't support splits)
  • .so file sizes ==> ClassyShark just prints the size of the zip entry from the APK file, @kmadsen what is your use case, please ?

borisf avatar Aug 17 '20 15:08 borisf

@borisf Can't use it for Android though as a library, and can't use with InputStream as a parameter, right?

Also, how exactly do you see that's possible, using this UI:

image

Where do you see that I can get the icon and name of the app?

Even when opening the manifest, I can't see it:

image

AndroidDeveloperLB avatar Aug 17 '20 18:08 AndroidDeveloperLB

Read here how to use ClassyShark as a library

About icons yes, we don't support raw images, as there are other tools that do it

borisf avatar Aug 17 '20 19:08 borisf

@borisf So again, there is no library that can do it for Android properly. And it's not just raw images. Those don't always exist. It's also AdaptiveIconDrawable and VectorDrawable.

About the link, this shows that it can use File. What about InputStream or Uri using ContentProvider? After all, you can't always access File on Android, especially due to the various restrictions over the years. And if I could access using File, I wouldn't have needed a library (except for the case of split APK files), because Android has this: https://developer.android.com/reference/android/content/pm/PackageManager#getPackageArchiveInfo(java.lang.String,%20int)

I wanted a library that can handle all kinds of APK files. Both normal and split APK files, and could do it even if presented Uri instead of a File.

AndroidDeveloperLB avatar Aug 17 '20 19:08 AndroidDeveloperLB

.so file sizes ==> ClassyShark just prints the size of the zip entry from the APK file, @kmadsen what is your use case, please ?

@borisf exactly this, we want the zip size of each native library (.so objects) for each build. Android Studio provides the download sizes for each of these, but we want to keep record of it internally. So we're looking to turn these values into JSON objects.

https://github.com/JetBrains/android/tree/master/apkanalyzer Screen Shot 2020-08-10 at 11 59 44 AM

EDIT: Sorry I won't derail this thread, opened a new ticket over here https://github.com/google/android-classyshark/issues/189

kmadsen avatar Aug 20 '20 14:08 kmadsen

@AndroidDeveloperLB there seems to be confusion here

ClassyShark is not intended to be used on Android phones but rather on desktop environment (swing etc), thus content providers are not in the scope ....

borisf avatar Aug 20 '20 20:08 borisf

@borisf Well then I can ask this:

  1. What does Google offer to parse all kinds of APK files, including split APK files, including not from File API?
  2. What does this library/tool do that others don't, including even from online solutions?
  3. Why only for desktop, if it's in Java? Java is supposed to be cross platform. You are missing some, if you don't offer for Android too, especially as it's for Android apps...
  4. If it's for developers, shouldn't it also work on ChromeOS, as Android Studio also works there? Actually, speaking about Android Studio, why not have it inside Android Studio?

AndroidDeveloperLB avatar Aug 20 '20 21:08 AndroidDeveloperLB

  1. What does Google offer to parse all kinds of APK files, including split APK files, including not from File API? If this is for running on Android devices you should look at Android Developer Documentation For development the key tools/APIs are Android Studio, ClassyShark, Play Console etc'

  2. What does this library/tool do that others don't, including even from online solutions? ClassyShark does APK/Jar/Zip parsing focusing on dex internals and method counts per classes.dex entry

  3. Why only for desktop, if it's in Java? Java is supposed to be cross platform. You are missing some, if you don't offer for Android too, especially as it's for Android apps... ClassyShark runs where Java JDK is running, Linux/OSX/Windows

  4. If it's for developers, shouldn't it also work on ChromeOS, as Android Studio also works there? Actually, speaking about Android Studio, why not have it inside Android Studio? Chrome OS I don;t know, as I didn't check

ClassyShark can't be integrated inside Android Studio as ClassyShark has different design and optimizations considerations, that require ClassyShark be a process on its own (many files, threads etc')

borisf avatar Aug 21 '20 07:08 borisf

@borisf ClassyShark was released way after Android Studio was announced: https://github.com/google/android-classyshark/releases?after=6.4 - "First Android Drop" on Nov 3, 2015 https://en.wikipedia.org/wiki/Android_Studio

Android Studio was announced on May 16, 2013 at the Google I/O conference. It was in early access preview stage starting from version 0.1 in May 2013, then entered beta stage starting from version 0.8 which was released in June 2014.[11] The first stable build was released in December 2014, starting from version 1.0.

So your explanation doesn't hold, as developers of the tool knew there is an IDE that's for Android, and could work with it.

AndroidDeveloperLB avatar Aug 21 '20 08:08 AndroidDeveloperLB

APK Analyzer and ClassyShark were developed concurrently to address different needs (around 2016)

borisf avatar Aug 21 '20 08:08 borisf

@borisf Still later than Android Studio. Also, if there is one tool, doesn't mean there can't be another.

AndroidDeveloperLB avatar Aug 21 '20 09:08 AndroidDeveloperLB