Giter Club home page Giter Club logo

aosp_permissions_extraction's Introduction

AOSP permissions extraction toy

This toy tool is meant to extract:

  • permission groups (name, icon, label, description)
  • permissions (name, label, description, group, protection level)

from the AOSP sources and generate a JSON file containing information listed above in the locale you choose.

This tool uses the VectorDrawable2Svg script of Alessandro Lucchet which has been lightly modified.

This toy is only compatible with Python 3.x

Preliminaries

First of all, you have to clone the huge AOSP repository and optionnaly remove useless content:

mkdir AOSP
git clone https://github.com/aosp-mirror/platform_frameworks_base.git AOSP
cd AOSP
rm -rf  Android.bp Android.mk apct-tests api CleanSpec.mk cmds config data docs drm graphics keystore libs location lowpan media MODULE_LICENSE_APACHE2 native nfc-extras NOTICE obex opengl packages pathmap.mk PREUPLOAD.cfg proto rs samples sax services startop telecomm telephony test-base test-legacy test-mock test-runner tests tools vr wifi

Usage

pip install git+https://github.com/U039b/aosp_permissions_extraction.git
extract_required_permissions.py [path to AOSP folder] [2-letter locale] [destination folder]

the destination folder will be automatically created.

Example of outputs

The dist folder versioned in this repository gives you an example of output in various locales.

dist
  ├── permissions-en.html
  ├── permissions-en.json
  ├── permissions-es.html
  ├── permissions-es.json
  ├── permissions-fr.html
  ├── permissions-fr.json
  ├── permissions-it.html
  ├── permissions-it.json
  ├── permissions-ja.html
  └── permissions-ja.json

aosp_permissions_extraction's People

Contributors

u039b avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

aosp_permissions_extraction's Issues

Problem extraction

Test on Debian 9 and Debian 11, same issue

Traceback (most recent call last):
File "/usr/local/bin/extract_aosp/permissions.py", line 149, in <module> groups = extract_permission_groups(aosp_root_dir)
File "/usr/local/bin/extract_aosp/permissions.py", line 47, in extract_permission_groups
'request_ptr': str(g.attributes['android:request'].value.replace('@string/', '')),
File "/usr/lib/python3.9/xml/dom/minidom/py", line 553, in __getitem__ return self._attrs[attname_or_tuple]
KeyError: 'android:request'

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.