Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strange Python related errors for androwarn.py. Please help!

58 views
Skip to first unread message

Sean Son

unread,
May 24, 2016, 3:13:47 PM5/24/16
to
hello all

I am testing out a script called androwarn.py, which I downloaded from:

https://github.com/maaaaz/androwarn

using the instructions found on:

https://github.com/maaaaz/androwarn/wiki/Installation

When I ran the following commands to test the APK for AirBNB:


python androwarn.py -i SampleApplication/bin/"Airbnb 5.19.0.apk" -v 3 -r
html -n


I received the following errors:

Traceback (most recent call last):
File "androwarn.py", line 116, in <module>
main(options, arguments)
File "androwarn.py", line 99, in main
data = perform_analysis(APK_FILE, a, d, x, no_connection)
File "/home/dost/androwarn/androwarn/analysis/analysis.py", line 115, in
perform_analysis
( 'device_settings_harvesting',
gather_device_settings_harvesting(x) ),
File
"/home/dost/androwarn/androwarn/search/malicious_behaviours/device_settings.py",
line 96, in gather_device_settings_harvesting
result.extend( detect_get_package_info(x) )
File
"/home/dost/androwarn/androwarn/search/malicious_behaviours/device_settings.py",
line 79, in detect_get_package_info
flags = recover_bitwise_flag_settings(flag, PackageManager_PackageInfo)
File "/home/dost/androwarn/androwarn/util/util.py", line 257, in
recover_bitwise_flag_settings
if (int(flag) & option_value) == option_value :
ValueError: invalid literal for int() with base 10:
'Lcom/google/android/gms/common/GooglePlayServicesUtil;->zzad(Landroid/content/Context;)V'


I am absolutely at a loss as to how I should fix these errors? Anyone have
any ideas? Sorry for just throwing this at you guys without warning, but
Ive been tasked with fixing this at work and I need assistance please!

MRAB

unread,
May 24, 2016, 3:31:44 PM5/24/16
to
It looks like this issue:

https://github.com/maaaaz/androwarn/issues/10

dating from 11 Dec 2014 and as yet unanswered.

Sean Son

unread,
May 24, 2016, 3:46:21 PM5/24/16
to
Thanks for the reply.

Looks like I am screwed on this one lol
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Sean Son

unread,
May 26, 2016, 1:26:09 PM5/26/16
to
Hello all

>From what I can tell from the error message that I received, line 257 of
the util.py script is causing the error. Here is a link to this script:

https://github.com/maaaaz/androwarn/blob/master/androwarn/util/util.py

I am not a python developer myself, unfortunately, so I have no idea how I
should fix this error. All help is greaaaaaaaaaaaaaaaaatly appreciated!

Thanks

On Tue, May 24, 2016 at 3:46 PM, Sean Son <linuxmailin...@gmail.com>
wrote:

Sean Son

unread,
May 26, 2016, 1:31:23 PM5/26/16
to
Here are the links to the other scripts mentioned in the error messages:

https://github.com/maaaaz/androwarn/blob/master/androwarn/search/malicious_behaviours/device_settings.py

https://github.com/maaaaz/androwarn/blob/master/androwarn/analysis/analysis.py

and the main androwarn.py script:

https://github.com/maaaaz/androwarn/blob/master/androwarn.py

Hopefully those help in any troubleshooting steps that you all recommend to
me!

Thank you!

On Thu, May 26, 2016 at 1:25 PM, Sean Son <linuxmailin...@gmail.com>

Michael Torrie

unread,
May 26, 2016, 7:58:37 PM5/26/16
to
On 05/26/2016 11:31 AM, Sean Son wrote:
> Hopefully those help in any troubleshooting steps that you all recommend to
> me!
>
> Thank you!

You could try emailing the author who's email address is listed on the
project's main github page. I suspect the project itself is abandoned.

Was this working before and is no longer working? What brought about
the change? A new version of Android? A new version of this program?
Seems like this github project is abandoned and, as you have found,
bitrotting as Android moves on and likely causes incompatibilities with
it as time goes on.

Unless the author can advise you, help may be hard to come by. The
error itself is simple enough. But what is feeding bad data to this
function (a string instead of a number) is unknown and would take some
effort to get to the bottom of it, especially by any of us who have
never seen this code before, and many of whom haven't ever worked with
Android before.

If this particular program is critical to your employer's business,
consider offering the original author (or folks on this list) some
payment for the fix.

Michael Torrie

unread,
May 26, 2016, 8:31:31 PM5/26/16
to
On 05/26/2016 05:57 PM, Michael Torrie wrote:
> You could try emailing the author who's email address is listed on the
> project's main github page. I suspect the project itself is abandoned.

Ahem. That should have been whose. Sigh.

Sean Son

unread,
May 27, 2016, 10:41:33 AM5/27/16
to
Hello

Thank you for your reply. So the error isnt due to a bug in function
itself? It is due to a possible error in the Android APK file? If that is
the case, it would take a while to figure this out. I tried contacted the
author of the project but I have yet to hear back from him .

Thanks
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Michael Torrie

unread,
May 27, 2016, 10:10:27 PM5/27/16
to
On 05/27/2016 08:41 AM, Sean Son wrote:
> Thank you for your reply. So the error isnt due to a bug in function
> itself? It is due to a possible error in the Android APK file? If that
> is the case, it would take a while to figure this out. I tried contacted
> the author of the project but I have yet to hear back from him .

Yes it sounds like a bug, but the bug is probably not in the function
that you pointed to. The exception occurs there, yes, but it occurs
because the function is expecting an integer to be passed to it, but is
receiving a string instead. In other words, something is passing bad
data (or data the function doesn't know how to interpret). Debuggers
and Python are not my strong points, but if you could go back through
the stack trace and find out what's calling it, you might be able to
find out where this bad data is coming from. I doubt it's an error in
the apk. More likely Google has changed something inside of apks and
the python code hasn't been updated to account for this. Could be
something in the XML manifest inside the apk. Just shooting in the dark
there. Not so helpful, but that's all I know really.

Michael Torrie

unread,
May 27, 2016, 11:03:15 PM5/27/16
to
On 05/27/2016 08:09 PM, Michael Torrie wrote:
> On 05/27/2016 08:41 AM, Sean Son wrote:
>> Thank you for your reply. So the error isnt due to a bug in function
>> itself? It is due to a possible error in the Android APK file? If that
>> is the case, it would take a while to figure this out. I tried contacted
>> the author of the project but I have yet to hear back from him .
>
> Yes it sounds like a bug, but the bug is probably not in the function
> that you pointed to. The exception occurs there, yes, but it occurs
> because the function is expecting an integer to be passed to it, but is
> receiving a string instead. In other words, something is passing bad
> data (or data the function doesn't know how to interpret).

I guess I don't mean integer. I mean it expects a string that can be
converted to an integer. But it's getting some other text instead,
which it doesn't know how to handle.

0 new messages