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

make get_apkid() return versionCode as an integer #1026

Closed
wants to merge 1 commit into from

Conversation

eighthave
Copy link
Contributor

versionCode is strictly defined to be an integer, any other type would be an error. So get_apkid() should return versionCode as an integer or fail trying.

@eighthave
Copy link
Contributor Author

On second thought, since androguard is primarily about analysis rather than correctness, it might make sense to keep this a str, if this field can be abused.

@erev0s
Copy link
Collaborator

erev0s commented Apr 27, 2024

Thank you @eighthave for this PR.
Indeed versionCode is defined either as int or long and currently the code takes care of that with str(int(value, 16)). The casting to a string, I believe happens so it is aligned with other parts that return strings.
Overall though you are right, it should be treated as an integer, though given how minor this is and that it does not affect the general correctness of the output, it should be fine.

@erev0s erev0s closed this Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants