Merge pull request #9 from FoxRefire/main

Fix subprocess
This commit is contained in:
hyugogirubato 2024-05-19 23:27:02 +02:00 committed by GitHub
commit 628add77d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -77,7 +77,7 @@ For advanced users looking to use custom functions with KeyDive, a comprehensive
## Temporary Disabling L1 for L3 Extraction ## Temporary Disabling L1 for L3 Extraction
Some manufacturers (e.g., Xiaomi) allow the use of L1 keyboxes even after unlocking the bootloader. In such cases, it's necessary to install a Magisk module called [liboemcrypto-disabler](https://github.com/Magisk-Modules-Repo/liboemcryptodisabler) to temporarily disable L1, thereby facilitating L3 key extraction. Some manufacturers (e.g., Xiaomi) allow the use of L1 keyboxes even after unlocking the bootloader. In such cases, it's necessary to install a Magisk module called [liboemcrypto-disabler](https://github.com/hzy132/liboemcryptodisabler) to temporarily disable L1, thereby facilitating L3 key extraction.
## Credits ## Credits
@ -89,4 +89,4 @@ KeyDive is intended for educational and research purposes only. The use of this
--- ---
By using KeyDive, you acknowledge and agree to the terms of use and disclaimer stated above. By using KeyDive, you acknowledge and agree to the terms of use and disclaimer stated above.

View File

@ -64,7 +64,7 @@ class Cdm:
""" """
# https://source.android.com/docs/core/architecture/configuration/add-system-properties?#shell-commands # https://source.android.com/docs/core/architecture/configuration/add-system-properties?#shell-commands
properties = {} properties = {}
sp = subprocess.run(f'adb -s "{self.device.id}" shell getprop', capture_output=True) sp = subprocess.run(['adb', '-s', self.device.id, 'shell', 'getprop'], capture_output=True)
for line in sp.stdout.decode('utf-8').splitlines(): for line in sp.stdout.decode('utf-8').splitlines():
match = re.match(r'\[(.*?)\]: \[(.*?)\]', line) match = re.match(r'\[(.*?)\]: \[(.*?)\]', line)
if match: if match:
@ -137,7 +137,7 @@ class Cdm:
# https://github.com/frida/frida/issues/1225#issuecomment-604181822 # https://github.com/frida/frida/issues/1225#issuecomment-604181822
# Iterate through lines starting from the second line (skipping header) # Iterate through lines starting from the second line (skipping header)
processes = {} processes = {}
sp = subprocess.run(f'adb -s "{self.device.id}" shell ps', capture_output=True) sp = subprocess.run(['adb', '-s', self.device.id, 'shell', 'ps'], capture_output=True)
for line in sp.stdout.decode('utf-8').splitlines()[1:]: for line in sp.stdout.decode('utf-8').splitlines()[1:]:
try: try:
line = line.split() # USER,PID,PPID,VSZ,RSS,WCHAN,ADDR,S,NAME line = line.split() # USER,PID,PPID,VSZ,RSS,WCHAN,ADDR,S,NAME

View File

@ -29,7 +29,7 @@ if __name__ == '__main__':
logger.info('Version: %s', extractor.__version__) logger.info('Version: %s', extractor.__version__)
# Ensure the ADB server is running # Ensure the ADB server is running
sp = subprocess.run('adb start-server', capture_output=True) sp = subprocess.run(['adb', 'start-server'], capture_output=True)
if sp.returncode != 0: if sp.returncode != 0:
raise EnvironmentError('ADB is not recognized as an environment variable, see https://github.com/hyugogirubato/KeyDive/blob/main/docs/PACKAGE.md#adb-android-debug-bridge') raise EnvironmentError('ADB is not recognized as an environment variable, see https://github.com/hyugogirubato/KeyDive/blob/main/docs/PACKAGE.md#adb-android-debug-bridge')