def get_caller_name(self): export = os.environ['USERPROFILE'] + '\\Desktop\\db' run_command(adb_commands['db'] + 'content://com.android.contacts/data/phones/filter/' + self.get_caller_number() + ' --projection sort_key' + ' > ' + export) return open(export).read().split('sort_key=')[1].replace('\r', '').replace( '\n', '')
def loc(): a = run_command(adb_commands['get-location']) a = a.split("Location[network")[1].split("acc")[0] latitude = a.split(",")[0] longitude = a.split(",")[1] #print "latitude:", latitude #print "longitude:", longitude results = Geocoder.reverse_geocode(float(latitude),float(longitude)) return str(results).split(',')[0].decode('unicode_escape').encode('ascii','ignore')
def get_city(): a = run_command(adb_commands['get-location']) a = a.split("Location[network")[1].split("acc")[0] latitude = a.split(",")[0] longitude = a.split(",")[1] #print "latitude:", latitude #print "longitude:", longitude results = Geocoder.reverse_geocode(float(latitude),float(longitude)) c = results.city return c
def respond_to_sms(receiver, msg): print adb.run_command(adb_commands['send-sms'].format(receiver,msg[:-1])) global win win.destroy()
def get_caller_number(self): out = run_command(adb_commands['check-callnumber']) return out.split('=')[1].replace('\n', '')
def check_if_calling(self): out = run_command(adb_commands['check-callstate']) return out[-2] == '1'
def get_caller_name(self): export = os.environ['USERPROFILE'] + '\\Desktop\\db' run_command(adb_commands['db'] + 'content://com.android.contacts/data/phones/filter/' + self.get_caller_number() + ' --projection sort_key' + ' > ' + export) return open(export).read().split('sort_key=')[1].replace('\r', '').replace('\n', '')
def decline_call(self): run_command(adb_commands['decline-call'])
def accept_call(self): run_command(adb_commands['accept-call'])