├── LICENSE ├── README.md ├── main.py └── requirements.txt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 johntad110 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tablet Automation Toolkit 2 | 3 | A simple toolkit for automating tablet operations like rebooting into recovery mode and bypassing FRP (Factory Reset Protection) on Android devices, specifically for Huawei and Lenovo tablets. 4 | 5 | ## Features 6 | - List connected devices via ADB. 7 | - Reboot selected devices into recovery mode. 8 | - Continuously bypass FRP when a device is connected. 9 | 10 | ## Installation 11 | 12 | ### Prerequisites 13 | 1. **ADB (Android Debug Bridge)**: Make sure ADB is installed and accessible via your system's PATH. 14 | - You can download ADB from the official Android developer site: [ADB Download](https://developer.android.com/studio/command-line/adb). 15 | 16 | 2. **Python 3.x**: This script requires Python 3.x to run. 17 | - You can download Python from: [Python Download](https://www.python.org/downloads/) 18 | 19 | 3. **ADB Permissions**: Ensure your devices have USB debugging enabled and proper ADB permissions are granted. 20 | 21 | ### Step-by-Step Setup 22 | 23 | 1. Clone this repository to your local machine: 24 | ```bash 25 | git clone https://github.com/johntad110/Tablet-Automation-Toolkit.git 26 | cd Tablet-Automation-Toolkit 27 | ``` 28 | 29 | 2. Install the required Python libraries: 30 | ```bash 31 | pip install -r requirements.txt 32 | ``` 33 | 34 | 3. Ensure that ADB is properly set up and devices are connected with USB debugging enabled. 35 | 36 | ## Usage 37 | 38 | 1. Open a terminal/command prompt and navigate to the project directory. 39 | 2. Run the script: 40 | ```bash 41 | python main.py 42 | ``` 43 | 44 | 3. Select one of the options from the menu: 45 | - **List Devices**: Displays a list of all connected devices. 46 | - **Reboot to Recovery Mode**: Allows you to choose a device and reboot it into recovery mode. 47 | - **Bypass FRP Mode**: Automatically bypasses FRP when a new device is detected. 48 | 49 | ### Exiting the script 50 | You can press `Ctrl + C` or choose the exit option in the menu to stop the script. 51 | 52 | ### Notes 53 | - **ADB Drivers**: Ensure that the correct ADB drivers for your device are installed on your computer. 54 | - **FRP Bypass**: The FRP bypass command only works when the device is in the correct mode (e.g., fastboot, recovery, or while setting up a new device). 55 | 56 | ## Requirements 57 | 58 | Ensure you have the following dependencies installed. These can also be found in the `requirements.txt` file: 59 | 60 | ```txt 61 | keyboard 62 | ``` 63 | 64 | ## License 65 | 66 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 67 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import os 2 | import keyboard 3 | import time 4 | 5 | def list_devices(): 6 | devices = os.popen("adb devices").read().strip().splitlines() 7 | devices = [device.split()[0] for device in devices[1:] if "device" in device] 8 | 9 | if not devices: 10 | print("No devices found. Please connect a device.") 11 | return None 12 | else: 13 | print("List of connected devices:") 14 | for i, device in enumerate(devices): 15 | print(f"{i+1}. {device}") 16 | return devices 17 | 18 | def choose_device(devices): 19 | while True: 20 | try: 21 | choice = int(input("Enter the number of the device you want to choose: ")) - 1 22 | if 0 <= choice < len(devices): 23 | return devices[choice] 24 | else: 25 | print("Invalid choice. Please choose a valid device number.") 26 | except ValueError: 27 | print("Please enter a valid number.") 28 | 29 | def reboot_to_recovery(device): 30 | result = os.popen(f"adb -s {device} reboot recovery").read() 31 | print(f"Rebooting device {device} into recovery mode...") 32 | print(result) 33 | time.sleep(10) # Give time for the device to enter recovery mode 34 | print(f"Device {device} should now be in recovery mode.") 35 | 36 | def bypass_frp(device): 37 | while True: 38 | print(f"Checking FRP bypass status on device {device}...") 39 | result = os.popen(f"adb -s {device} shell content insert --uri content://settings/secure --bind name:s:user_setup_complete --bind value:s:1").read() 40 | print(f"FRP bypass result on device {device}: {result}") 41 | time.sleep(5) # Wait a bit before the next check 42 | if keyboard.is_pressed("q"): 43 | print("Exiting FRP bypass mode...") 44 | break 45 | 46 | def monitor_device_insertion_recovery(): 47 | print("Monitoring for new devices and rebooting to recovery mode...") 48 | last_devices = [] 49 | while True: 50 | devices = list_devices() 51 | if devices and devices != last_devices: 52 | print(f"New device detected: {devices[0]}") 53 | reboot_to_recovery(devices[0]) 54 | last_devices = devices 55 | break # If you don't wanna to get back to the options remove the `break` 56 | time.sleep(2) # Check every 2 seconds for new devices 57 | 58 | def monitor_device_insertion_frp(): 59 | print("Monitoring for new devices and bypassing FRP...") 60 | while True: 61 | devices = list_devices() 62 | if devices: 63 | print(f"New device detected: {devices[0]}") 64 | bypass_frp(devices[0]) 65 | time.sleep(2) # Check every 2 seconds for new devices 66 | 67 | def main(): 68 | while True: 69 | print("\nOptions:") 70 | print("1. List connected devices") 71 | print("2. Reboot device into recovery mode") 72 | print("3. Continuously bypass FRP on inserted device") 73 | print("4. Continuously reboot inserted device into recovery mode") 74 | print("5. Exit") 75 | 76 | choice = input("Choose an option: ") 77 | 78 | if choice == "1": 79 | devices = list_devices() 80 | if devices: 81 | print("Devices listed successfully.") 82 | 83 | elif choice == "2": 84 | devices = list_devices() 85 | if devices: 86 | device = choose_device(devices) 87 | reboot_to_recovery(device) 88 | 89 | elif choice == "3": 90 | monitor_device_insertion_frp() 91 | 92 | elif choice == "4": 93 | monitor_device_insertion_recovery() 94 | 95 | elif choice == "5": 96 | print("Exiting script.") 97 | break 98 | 99 | else: 100 | print("Invalid option. Please try again.") 101 | 102 | if __name__ == "__main__": 103 | main() 104 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | keyboard 2 | --------------------------------------------------------------------------------