reddr / axplorer

axplorer - Android Permission Mappings
Apache License 2.0
104 stars 32 forks source link

Integration into androguard #1

Open reox opened 6 years ago

reox commented 6 years ago

Hi! I would like to integrate the permission mappings into androguard, which currently only uses the mappings generated by PScout. We are also missing the newer mappings.

I think it should not be too hard to read the files from this repository, there are just minor adjustments for the path required, ie. android.hardware.location.ActivityRecognitionHardware.disableActivityEvent(java.lang.String,int)boolean would be Landroid/hardware/location/ActivityRecognitionHardware;-disableActivityEvent-(Ljava/lang/String; I)B in the androguard defintion.

What do you think would be the best way to integrate axplorer into androguard? Maybe just as a git submodule? Idealy the permission mappings should be in a format which is easily readable from python, like json or pickle. In this case I would convert the text files from axplorer to this format at compile time.

For reference, there is already an issue in androguard: https://github.com/androguard/androguard/issues/252

reddr commented 6 years ago

Sorry for the delayed answer, don't have much time for programming atm. Great to hear that AndroGuard wants to adopt our mappings. I'm aware of the notation problem (JVM vs Java). For the export, I intentionally chose to normalize the JVM format to a human-readable format. In fact, WALA, the framework we're building on, uses a weird mix of notations. An option could be to provide the mappings in both notations.

Providing the mappings in an easier parsable format such as JSON is a good point. As soon as I can spend some time on this, I'm going to implement a JSON export. Similarly, I hope to be able to provide mappings for API level 26 soon.

reox commented 6 years ago

Thanks for the feedback! I already integrated the mappings into androguard and wrote a short converter: https://github.com/androguard/androguard/blob/master/generators/axplorer_to_androguard.py It is actually not that hard to switch between them, so I think you should stay with the syntax and we just convert them to json on the go.

So far I had no problems with the mappings, so thanks for your effort in generating them!

zqkFrank commented 5 years ago

Hello, sorry for disturbing you, I see you integrated the mappings into androguard, maybe I don't know how to use the androguard to extract these mapping informations, Could you give some suggestions? Thank you!