Code Monkey home page Code Monkey logo

analisis-permisos-apk's Introduction

APK permissions Analysis

The code on this repository allows the user to analyze the permissions of an android application. Extracting the permissions list and comparing against different apk versions of the same application to get a global view about the permissions used over the time in different versions of the application.

Pre-requirement

  • You need to have apktool or another tool to decompile the apk's
  • Python 3 to execute the code present on this repository

How it works

Before all you have to clone the repository

  git clone https://github.com/karisma-klab/analisis-permisos-apk.git
  cd analisis-permisos-apk

To use it is really simple.

  • First you should have the apk's that you want to analyze.
  • Second, you can use the script under the utils folder utils/apk_coordinator.sh to create the good folders structure used by the code.
  • Last create a python script that uses the APKAnalyzer class as on the example.py file. That will generate the permissions x versions matrix on the desired format.

Usage example

We want to analyze the android application "gamma101".

We have already downloaded the apk versions that we want to analyze to the following directory:

└── Downloads
    ├── gamma101_v2.0.5_apkpure.com.apk
    ├── gamma101_v2.0.7_apkpure.com.apk
    └── gamma101_v2.1.2_apkpure.com.apk

So we modify the bash script apk_coordinator.sh with the following values:

declare -a arr=("v2.0.5" "v2.0.7" "v2.1.2")
download_path="<full_path>/../Downloads/"
project_name="gamma101"
sink_folder="/../Documents../../Project001"

Warning: here you should have already installed apktool because is used by the bash script to decompile the apk

After executing the bash script we obtain the following directories structure at the sink folder location:

└── Project001
    └── gamma101
        ├── v2.0.5
        │   └── gamma101
        │       └── AndroidManifest.xml
        │       └── ...
        │       └── ...
        ├── v2.0.7
        │   └── gamma101
        └── v2.1.2
            └── gamma101

Finally, we create python code as following:

from apk_perms_analyzer import APKAnalyzer

apk_versions = ["v2.0.5", "2.0.7", "2.1.2"]

analyzer = APKAnalyzer()

analyzer.apk_permission_analysis("gamma101", apk_versions, "/../Documents../../Project001")

After execute it you will obtain the permissions comparison matrix between the different apk versions.

analisis-permisos-apk's People

Contributors

kastellanos avatar velasquez avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.