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

invalid literal for int() with base 10 #10

Open
jandyle opened this issue Dec 11, 2014 · 11 comments
Open

invalid literal for int() with base 10 #10

jandyle opened this issue Dec 11, 2014 · 11 comments

Comments

@jandyle
Copy link

jandyle commented Dec 11, 2014

Traceback (most recent call last):
File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn.py", line 116, in
main(options, arguments)
File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn.py", line 99, in main
data = perform_analysis(APK_FILE, a, d, x, no_connection)
File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn/analysis/analysis.py", line 115, in perform_analysis
( 'device_settings_harvesting', gather_device_settings_harvesting(x) ),
File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn/search/malicious_behaviours/device_settings.py", line 96, in gather_device_settings_harvesting
result.extend( detect_get_package_info(x) )
File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn/search/malicious_behaviours/device_settings.py", line 79, in detect_get_package_info
flags = recover_bitwise_flag_settings(flag, PackageManager_PackageInfo)
File "/TOOLS/Static/androwarn/test/androwarn-master/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/tumblr/App;->getAppContext()Landroid/content/Context;'

im testing the tumblr app. can you help me?

@xstr8edgepersianx
Copy link

Hello.. has anyone figured out the solution to this error? I tested a few apks using androwarn.py and I get this same error each time? It would help if someone could reply to this thread.. its about 2 years old!

@eon01
Copy link

eon01 commented Aug 26, 2016

+1 I had the same issue.

1 similar comment
@kobikal1
Copy link

+1 I had the same issue.

@The-Chairman
Copy link

+1 I also had this issue with some of my tests

@agucova
Copy link

agucova commented May 26, 2017

+1 I had the same issue :P

@mukila92
Copy link

Had the same issue.
So modified device_settings.py file and then it worked. Under detect_get_package_info(x) method added the below set of codes
flag = get_register_value(2, registers) #prev line
if (flag != '0'): #start
flags = flag.split()
package_name = flags[0]
flag = flags[1] #end

@ikoun
Copy link

ikoun commented Apr 27, 2018

I had to slightly modify @mukila92 's code as I encountered cases where the flag was only returning a list with one element; thus an IndexError: list index out of range was thrown again.
My code addition (together with mukila92's code):

if (flag != '0'): #start
    flags = flag.split()
    if len(flags) > 1:
        package_name = flags[0]
        flag = flags[1] #end
    else:
        flag = flags[0]

@rschwass
Copy link

I tried this fix. Still not working

@Xarlan
Copy link

Xarlan commented Oct 29, 2018

Hi,
androwarn/androwarn/util/util.py
I did the following:

def recover_bitwise_flag_settings(flag, constants_dict) :
	"""
		@param flag : an integer value to be matched with bitwise OR options set
		@param constants_dict : a dictionary containing each options' integer value
	
		@rtype : a string summing up settings
	"""
	recover = ''
	options = []

	try:
		flag_var = int(flag)

	except ValueError:
		print "ValueError, flag = ", flag

	else:
		for option_value in constants_dict :
			# if (int(flag) & option_value) == option_value :
			if (flag_var & option_value) == option_value :
				options.append(constants_dict[option_value])

		recover = ', '.join(i for i in options)

		return recover

After that, I get report about apk
The error/message was:
_ValueError, flag = Lcom/google/android/gms/measurement/internal/zzn;->getContext()Landroid/content/Contex_t;

@maaaaz
Copy link
Owner

maaaaz commented Dec 30, 2018

Hello there,

Thank you for trying to debug this, could you point me an APK leading that issue ?

Best regards.

@Xarlan
Copy link

Xarlan commented Jan 9, 2019

Hello maaaaz
The APK wich generate this "error" follow by this link:
https://play.google.com/store/apps/details?id=com.gsgroup.tricoloronline&hl=ru

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

No branches or pull requests