Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
55538aba6a | ||
|
0d66d5b79e | ||
|
4ed01b60ae | ||
|
c8e9845954 | ||
|
2680ddca0a | ||
|
71f67b709a |
|
@ -1,3 +1,4 @@
|
|||
# This Code is undergoing a rewrite and is currently not functioning correctly. Check back soon for the updated version
|
||||
# Android-Mobile-Toolkit
|
||||
This is a python based program to root and extract data from android devices using adb
|
||||
|
||||
|
|
1
amt.py
1
amt.py
|
@ -2,7 +2,6 @@
|
|||
"""
|
||||
Code to interact with an android device using ADB
|
||||
Written by Kevin Rode
|
||||
Last Updated Sep 28 2019
|
||||
"""
|
||||
import sys
|
||||
from helpers import root
|
||||
|
|
|
@ -12,7 +12,6 @@ def recovery_boot():
|
|||
else:
|
||||
device = root.adb_connect()
|
||||
root.twrp_download(device)
|
||||
root.push_files(device)
|
||||
root.reboot_bootloader()
|
||||
adb = "platform-tools\\adb.exe"
|
||||
fastboot = "platform-tools\\fastboot.exe"
|
||||
|
@ -20,6 +19,15 @@ def recovery_boot():
|
|||
for file in files:
|
||||
if "twrp" in file:
|
||||
twrp = file
|
||||
else:
|
||||
twrploc = 0
|
||||
while twrploc == 0:
|
||||
input("TWRP not found. Please ensure it is in the correct location and press enter to continue. ")
|
||||
files = os.listdir(os.curdir)
|
||||
for file in files:
|
||||
if "twrp" in file:
|
||||
twrp = file
|
||||
twrploc = 1
|
||||
os.system(fastboot + " boot "+twrp)
|
||||
input("Press Enter when TWRP has booted")
|
||||
|
||||
|
@ -44,7 +52,8 @@ def download_app(o=None):
|
|||
else:
|
||||
os.system(adb+" pull /sdcard/"+app)
|
||||
else:
|
||||
os.makedirs(o)
|
||||
if os.path.isdir(o) == False:
|
||||
os.makedirs(o)
|
||||
os.system(adb+" pull /sdcard/"+app+" "+o)
|
||||
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ def twrp_download(d):
|
|||
if "twrp" in file:
|
||||
found = 1
|
||||
if found != 1:
|
||||
cpu = d.shell('cat /proc/cpuinfo | grep Hardware')
|
||||
cpu = cpu.replace(" ", "")
|
||||
cpu = re.sub(r'(.+:)', '', cpu)
|
||||
cpu = d.shell('getprop ro.product.board')
|
||||
r = requests.get('https://dl.twrp.me/'+cpu)
|
||||
tree = html.fromstring(r.text)
|
||||
urls = tree.xpath('//a/@href')
|
||||
|
@ -38,24 +36,28 @@ def twrp_download(d):
|
|||
for i in urls:
|
||||
if "img" in i:
|
||||
downloads.append(i)
|
||||
url_to_download = "https://dl.twrp.me"+downloads[0]
|
||||
url_to_download = url_to_download.replace('.html', '')
|
||||
s = requests.Session()
|
||||
s.headers.update({'referer':url_to_download})
|
||||
img = s.get(url_to_download)
|
||||
with open("twrp.img",'wb') as f:
|
||||
f.write(img.content)
|
||||
files = os.listdir(os.curdir)
|
||||
for file in files:
|
||||
if "twrp" in file:
|
||||
found = 1
|
||||
while found != 1:
|
||||
print("File not found. Please confirm it has been moved to the correct directory")
|
||||
input("Press Enter to continue...")
|
||||
files = os.listdir(os.curdir)
|
||||
for file in files:
|
||||
if "twrp" in file:
|
||||
found = 1
|
||||
url_to_download = "https://dl.twrp.me"+downloads[0]
|
||||
url_to_download = url_to_download.replace('.html', '')
|
||||
s = requests.Session()
|
||||
s.headers.update({'referer':url_to_download})
|
||||
img = s.get(url_to_download)
|
||||
with open("twrp.img",'wb') as f:
|
||||
f.write(img.content)
|
||||
files = os.listdir(os.curdir)
|
||||
for file in files:
|
||||
if "twrp" in file:
|
||||
found = 1
|
||||
while found != 1:
|
||||
print("File not found. Please confirm it has been moved to the correct directory")
|
||||
input("Press Enter to continue...")
|
||||
files = os.listdir(os.curdir)
|
||||
for file in files:
|
||||
if "twrp" in file:
|
||||
found = 1
|
||||
else:
|
||||
print("Error. Returning to the main menu")
|
||||
time.sleep(2)
|
||||
|
||||
else:
|
||||
print("twrp already downloaded")
|
||||
|
||||
|
|
|
@ -3539,32 +3539,14 @@
|
|||
"integrity": "sha1-8nNdwig2dPpnR4sQGBBZNVw2nl4="
|
||||
},
|
||||
"handlebars": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz",
|
||||
"integrity": "sha1-trN8HO0DBrIh4JT8eso+wjsTG2c=",
|
||||
"version": "4.5.3",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz",
|
||||
"integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==",
|
||||
"requires": {
|
||||
"neo-async": "^2.6.0",
|
||||
"optimist": "^0.6.1",
|
||||
"source-map": "^0.6.1",
|
||||
"uglify-js": "^3.1.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "2.20.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
|
||||
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
|
||||
"optional": true
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.5.9",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.9.tgz",
|
||||
"integrity": "sha512-WpT0RqsDtAWPNJK955DEnb6xjymR8Fn0OlK4TT4pS0ASYsVPqr5ELhgwOwLCP5J5vHeJ4xmMmz3DEgdqC10JeQ==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"commander": "~2.20.0",
|
||||
"source-map": "~0.6.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"has": {
|
||||
|
@ -5688,7 +5670,7 @@
|
|||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
|
||||
}
|
||||
}
|
||||
|
@ -6643,6 +6625,24 @@
|
|||
"source-map": "~0.6.1"
|
||||
}
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.7.3",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.3.tgz",
|
||||
"integrity": "sha512-7tINm46/3puUA4hCkKYo4Xdts+JDaVC9ZPRcG8Xw9R4nhO/gZgUM3TENq8IF4Vatk8qCig4MzP/c8G4u2BkVQg==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"commander": "~2.20.3",
|
||||
"source-map": "~0.6.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"uglifyjs-webpack-plugin": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.3.0.tgz",
|
||||
|
|
Reference in New Issue
Block a user