def test(): apk_path = "wan.ke.ji-V1.5-1500.apk" apkf = APK(apk_path) print apkf.cert_text print apkf.file_md5 print apkf.cert_md5 print apkf.file_size print apkf.androidversion print apkf.package print apkf.get_android_manifest_xml() print apkf.get_android_manifest_axml() print apkf.is_valid_APK() print apkf.get_filename() print apkf.get_package() print apkf.get_androidversion_code() print apkf.get_androidversion_name() print apkf.get_max_sdk_version() print apkf.get_min_sdk_version() print apkf.get_target_sdk_version() print apkf.get_libraries() print apkf.get_files() # pip install python-magic print apkf.get_files_types() # print apkf.get_dex() print apkf.get_main_activity() print apkf.get_activities() print apkf.get_services() print apkf.get_receivers() print apkf.get_providers() print apkf.get_permissions() print apkf.show() apkf.parse_icon(icon_path='.')
def test(): apk_path = "/home/tdoly/com.android.vending_090150.apk" apkf = APK(apk_path) print apkf.cert_text print apkf.file_md5 print apkf.cert_md5 print apkf.file_size print apkf.androidversion print apkf.package print apkf.get_android_manifest_xml() print apkf.get_android_manifest_axml() print apkf.is_valid_APK() print apkf.get_filename() print apkf.get_package() print apkf.get_androidversion_code() print apkf.get_androidversion_name() print apkf.get_max_sdk_version() print apkf.get_min_sdk_version() print apkf.get_target_sdk_version() print apkf.get_libraries() print apkf.get_files() # pip install python-magic print apkf.get_files_types() # print apkf.get_dex() print apkf.get_main_activity() print apkf.get_activities() print apkf.get_services() print apkf.get_receivers() print apkf.get_providers() print apkf.get_permissions()
def test(): apk_path = "/users/ozgumusy/AndroidStudioProjects/RijksClient/app/app-release.apk" apkf = APK(apk_path) print apkf.cert_text print apkf.file_md5 print apkf.cert_md5 print apkf.file_size print apkf.androidversion print apkf.package print apkf.get_android_manifest_xml() print apkf.get_android_manifest_axml() print apkf.is_valid_APK() print apkf.get_filename() print apkf.get_package() print apkf.get_androidversion_code() print apkf.get_androidversion_name() print apkf.get_max_sdk_version() print apkf.get_min_sdk_version() print apkf.get_target_sdk_version() print apkf.get_libraries() print apkf.get_files() print apkf.get_files_types() #print apkf.get_dex() print apkf.get_main_activity() print apkf.get_activities() print apkf.get_services() print apkf.get_receivers() print apkf.get_providers() print apkf.get_permissions()
def test(): apk_path = "00ea77eb6f076fe87adb3cd9d39bcb3e8e487529faed7c8853c5a821be801e0a.apk" apkf = APK(apk_path) #print apkf.cert_text print apkf.file_md5 #print apkf.cert_md5 #print apkf.file_size #print apkf.androidversion #print apkf.package #print apkf.get_android_manifest_xml() #print apkf.get_android_manifest_axml() #print apkf.is_valid_APK() #print apkf.get_filename() #print apkf.get_package() #print apkf.get_androidversion_code() #print apkf.get_androidversion_name() #print apkf.get_max_sdk_version() #print apkf.get_min_sdk_version() #print apkf.get_target_sdk_version() #print apkf.get_libraries() #print apkf.get_files() # pip install python-magic #print apkf.get_files_types() #print apkf.get_dex() #print apkf.get_main_activity() print apkf.get_activities() print apkf.get_services() print apkf.get_receivers()
def test(): apk_path = r"C:\Users\heguofeng\Downloads\com.tencent.mm_6.7.3_liqucn.com.apk" apkf = APK(apk_path) print(apkf.cert_text) print( apkf.file_md5) print( apkf.cert_md5) print( apkf.file_size) print( apkf.androidversion) print( apkf.package) print( apkf.get_android_manifest_xml()) print( apkf.get_android_manifest_axml()) print( apkf.is_valid_APK()) print( apkf.get_filename()) print( apkf.get_package()) print( apkf.get_androidversion_code()) print( apkf.get_androidversion_name()) print( apkf.get_max_sdk_version()) print( apkf.get_min_sdk_version()) print( apkf.get_target_sdk_version()) print( apkf.get_libraries()) print( apkf.get_files()) # pip install python-magic print( apkf.get_files_types()) # print( apkf.get_dex() print( apkf.get_main_activity()) print( apkf.get_activities()) print( apkf.get_services()) print( apkf.get_receivers()) print( apkf.get_providers()) print( apkf.get_permissions())
p2 = set(p2_d) t1 = p1.difference(p2) # in p1 but not in p2 (removed in p2) t2 = p2.difference(p1) # in p1 but in p1 (added in p2) t3 = p1.intersection(p2) # in both added = ",".join(t2) removed = ",".join(t1) same = ",".join(t3) cur.execute( 'Update apps set services_added = ?, services_removed=?, same_services=? where app1_name=? and app2_name = ?', (added, removed, same, app1, app2)) # ----------receivers------------------- p1_d = apk1.get_receivers() p2_d = apk2.get_receivers() p1 = set(p1_d) p2 = set(p2_d) t1 = p1.difference(p2) # in p1 but not in p2 (removed in p2) t2 = p2.difference(p1) # in p1 but in p1 (added in p2) t3 = p1.intersection(p2) # in both added = ",".join(t2) removed = ",".join(t1) same = ",".join(t3) cur.execute( 'Update apps set receivers_added = ?, receivers_removed=?, same_receivers=? where app1_name=? and app2_name = ?',
import pandas as pd import numpy from numpy.random import randint with open('features_list.txt', 'r') as f: features_list = ast.literal_eval( f.read() ) # features_list is list of 456 features obtained from previous analysis and stored in txt file count = 0 for filepath in glob.iglob("/home/aman/tsting/*"): df = pd.DataFrame(columns=features_list) current = [] # list for this particular app's all features try: # try is necessary as some apps through error on calling below functions and remaining apps are not analyzed apkf = APK(filepath) current = current + apkf.get_activities() + apkf.get_services( ) + apkf.get_receivers() + apkf.get_providers() + apkf.get_permissions( ) except: continue dict = {} current = list(set(current)) for i in features_list: dict[i] = 0 for i in current: if i in dict: dict[ i] += 1 # this increments the count of a particular feature in an app for i in features_list: df.at[count, i] = dict[i] count += 1 # count keeps the number of apps analyzed and name of csv of each app is after its count