예제 #1
0
def analyze(args, apk_queue, res_queue, output_data):
        log = Logger(args.log_file, res_queue)

        while True:
                if apk_queue.empty():
                        return
                else:
                        apk_file = apk_queue.get()
                        file_path = args.in_dir + "/" + apk_file
                        
                        log.log("Checking: %s\n" % file_path)
                        a,d,dx = AnalyzeAPK(file_path)
                        act = ""
                        
                        for act in a.get_activities(): 
                                intent_list = a.get_intent_filters("activity",act)
                                if INTENT_CATEGORY in str(intent_list):
                                        log.log("Found an interesting activity!")
                                        log.log(act)
                                        log.log(intent_list)

                        log.log("\n\n")
                        log.flush()
예제 #2
0
    if details[0] == 'dangerous':
        # Protection levels: https://developer.android.com/guide/topics/permissions/overview#normal-dangerous
        print(perm)

print('\nServices:')
for service in apk.get_services():
    print(service)

print('\nBroadcasts:')
for receiver in apk.get_receivers():
    print(receiver)

print('\nIntent Filters:')
for service in apk.get_services():
    print('\nFilters for {}'.format(service))
    filters = apk.get_intent_filters('service', service)
    if filters:
        print(filters)

for receiver in apk.get_receivers():
    print('\nFilters for {}'.format(receiver))
    filters = apk.get_intent_filters('receiver', receiver)
    if filters:
        print(filters)

print('\nSensitive method calls:')
SENSITIVE_API_CALLS = {
    "android.content.ContextWrapper": [
        "bindService", "deleteDatabase", "deleteFile",
        "deleteSharedPreferences", "getSystemService", "openFileInput",
        "startService", "stopService", "unbindService", "unregisterReceiver"