Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@string/permdesc_XXX how to get description of permissions #529

Closed
wickywaka opened this issue Jun 7, 2018 · 12 comments · Fixed by #646
Closed

@string/permdesc_XXX how to get description of permissions #529

wickywaka opened this issue Jun 7, 2018 · 12 comments · Fixed by #646

Comments

@wickywaka
Copy link

wickywaka commented Jun 7, 2018

When I try to get permission details using apk.get_details_permissions() In the protectionLevel, label I get the strings @string/permdesc_XXX, which seems like a reference to strings and I am if we can get somehow the description.

@reox
Copy link
Member

reox commented Jun 7, 2018

this is related to #503

these are defined as resource but our parser is not aware of it natively.

@U039b
Copy link

U039b commented Oct 21, 2018

Hi!
I just published this toy script https://github.com/U039b/aosp_permissions_extraction and I think it would help for this issue.

Cheers!

@reox
Copy link
Member

reox commented Feb 12, 2019

@U039b would it be possible to run this tool and get the json files we use for all API levels? probably just checking out platform_framework_base and get each API tag...

@U039b
Copy link

U039b commented Feb 12, 2019

@reox I think that the easiest way is to clone the AOSP project and then run the script on each release branch.
2019-02-12_14-02

@reox
Copy link
Member

reox commented Feb 12, 2019

yeah I thought (and feared) the same.. In this case you need to know which codename is which API level. And there are point releases as well which makes everything super nasty

@U039b
Copy link

U039b commented Feb 12, 2019

(Codename, API level) mapping is available here https://source.android.com/setup/start/build-numbers

@reox
Copy link
Member

reox commented Feb 12, 2019

but how do I know what eclair-sholes and eclair-passion is? Is this defined somewhere?

@U039b
Copy link

U039b commented Feb 12, 2019

That's what I am looking for :-)

@U039b
Copy link

U039b commented Feb 12, 2019

Okay, the Github mirror of https://android.googlesource.com/platform/frameworks/base.git seems to be f***ed up. Tags in the official repo are more convenient.

{
    "api_levels": [
        {"codename": "Pie", "version": "9", "api_level": 28, "tag": "android-9.0.0_r33"},
        {"codename": "Oreo", "version": "8.1.0", "api_level": 27, "tag": "android-8.1.0_r61"},
        {"codename": "Oreo", "version": "8.0.0", "api_level": 26, "tag": "android-8.0.0_r36"},
        {"codename": "Nougat", "version": "7.1", "api_level": 25, "tag": "android-7.1.2_r36"},
        {"codename": "Nougat", "version": "7.0", "api_level": 24, "tag": "android-7.0.0_r35"},
        {"codename": "Marshmallow", "version": "6.0", "api_level": 23, "tag": "android-6.0.1_r81"},
        {"codename": "Lollipop", "version": "5.1", "api_level": 22, "tag": "android-5.1.1_r29"},
        {"codename": "Lollipop", "version": "5.0", "api_level": 21, "tag": "android-5.0.2_r1"},
        {"codename": "KitKat", "version": "4.4 - 4.4.4", "api_level": 19, "tag": "android-4.4.4_r2.0.1"},
        {"codename": "Jelly Bean", "version": "4.3.x", "api_level": 18, "tag": "android-4.3_r1.1"},
        {"codename": "Jelly Bean", "version": "4.2.x", "api_level": 17, "tag": "android-4.2.2_r1.2"},
        {"codename": "Jelly Bean", "version": "4.1.x", "api_level": 16, "tag": "android-4.1.2_r2.1"},
        {"codename": "Ice Cream Sandwich", "version": "4.0.3 - 4.0.4", "api_level": 15, "tag": "android-4.0.4_r2.1"},
        {"codename": "Ice Cream Sandwich", "version": "4.0.1 - 4.0.2", "api_level": 14, "tag": "android-4.0.2_r1"},
        {"codename": "Honeycomb", "version": "3.2.x", "api_level": 13, "tag": "android-3.2.4_r1"},
        {"codename": "Honeycomb", "version": "3.1", "api_level": 12, "tag": "missing"},
        {"codename": "Honeycomb", "version": "3.0", "api_level": 11, "tag": "missing"},
        {"codename": "Gingerbread", "version": "2.3.3 - 2.3.7", "api_level": 10, "tag": "android-2.3.7_r1"},
        {"codename": "Gingerbread", "version": "2.3 - 2.3.2", "api_level": 9, "tag": "android-2.3.2_r1"},
        {"codename": "Froyo", "version": "2.2.x", "api_level": 8, "tag": "android-2.2.3_r2.1"},
        {"codename": "Eclair", "version": "2.1", "api_level": 7, "tag": "android-2.1_r2.1p2"},
        {"codename": "Eclair", "version": "2.0.1", "api_level": 6, "tag": "android-2.0.1_r1"},
        {"codename": "Eclair", "version": "2.0", "api_level": 5, "tag": "android-2.0_r1"},
        {"codename": "Donut", "version": "1.6", "api_level": 4, "tag": "android-1.6_r1.5"}
]}

@reox
Copy link
Member

reox commented Feb 12, 2019

wow nice :) thanks!

@U039b
Copy link

U039b commented Feb 12, 2019

@reox tell me if android-api-levels.tar.gz is convenient for androguard.

@reox
Copy link
Member

reox commented Feb 12, 2019

yeah that would work! The current format looks like this: https://github.com/androguard/androguard/blob/master/androguard/core/api_specific_resources/aosp_permissions/permissions_25.json

so just a list of the permissions. And there are a few transformations to do:

protection_level --> protectionLevel
permission_group --> permissionGroup

idk if we need the html files, but the jsons are very usable.

reox added a commit to reox/androguard that referenced this issue Feb 18, 2019
@reox reox closed this as completed in #646 Feb 18, 2019
reox added a commit that referenced this issue Feb 18, 2019
adding new permission lists, resolving #529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants