jaredrummler / APKParser

APK parser for Android
Other
637 stars 107 forks source link

Questions about the library #1

Closed AndroidDeveloperLB closed 8 years ago

AndroidDeveloperLB commented 8 years ago
  1. Can it parse Intent-Filters?
  2. How is it in terms of memory? I remember the original library (for PC) was quite memory consuming, which caused OOM sometimes when I tried it on Android: https://github.com/CaoQianLi/apk-parser/issues/19
  3. Can you please put a sample too, and not just a library? Also, can you split the code , so that it would be possible to use via gradle? Maybe via https://jitpack.io/ ?
  4. What about the license? Does it require to put info about the repo in the "about" screen of apps, or something?
jaredrummler commented 8 years ago

Can it parse Intent-Filters?

No, but I will add this.

How is it in terms of memory? I remember the original library (for PC) was quite memory consuming, which caused OOM sometimes when I tried it on Android: caoqianli/apk-parser#19

Depends on usage. Parsing a single APK should not cause an OutOfMemoryError.

Can you please put a sample too, and not just a library? Also, can you split the code , so that it would be possible to use via gradle? Maybe via https://jitpack.io/ ?

I'll add it to maven central soon. Probably in a couple weeks. This is not a high priority project for me. I just added a sample project but all it does for now is parse the AndroidManifest.xml. I will add more samples in the following weeks.

What about the license? Does it require to put info about the repo in the "about" screen of apps, or something?

Putting it in the about section of your app is fine. The original author of the library already addressed this.

AndroidDeveloperLB commented 8 years ago
  1. This might help: https://github.com/caoqianli/apk-parser/commit/73643b1a47637eaaf605ba5569da7485c520047a
  2. No matter how large the APK is?
  3. Thank you.
  4. Nice. Should it be pointed to here, or to the other project, or both?
jaredrummler commented 8 years ago

1) Thanks, I just added it. Example usage:

ApplicationInfo appInfo = getPackageManager().getApplicationInfo("com.android.settings", 0);
ApkParser parser = ApkParser.create(appInfo);
AndroidManifest manifest = parser.getAndroidManifest();
for (AndroidComponent activity : manifest.activities) {
  String activityName = activity.name;
  List<IntentFilter> intentFilters = activity.intentFilters;
  // do stuff
}

2) It depends what you are doing. If you are only getting the AndroidManifest you should be good. All it is doing is extracting and parsing the AndroidManifest.xml from the APK (ZIP).

4) Pointed here. All you are required to do is include the license in your project: https://raw.githubusercontent.com/jaredrummler/apk-parser/master/LICENSE.txt

AndroidDeveloperLB commented 8 years ago

1) Thank you. Please put the sample code in the project as a sample, or at least on the main page

2) Nice !

4) English isn't my main language, and it looks like "lawyer" language, which even in Hebrew it's hard for me to understand. :(

jaredrummler commented 8 years ago

1)

Added to the README

4)

Feel free to use the library in any of your projects; BSD is a permissive license. All you need to do is add attribution somewhere in your app (many apps don't even do this).

You can find many examples in the Play Store on how others show licenses for open source projects. There are some good libraries for attribution here.

jaredrummler commented 8 years ago

Added to maven central. See the README.

AndroidDeveloperLB commented 8 years ago

Thank you for all you effort.