|
1 | 1 | @echo off |
2 | | -REM Ensure ADB is available in PATH |
3 | | -SET PATH=%PATH%;%~dp0 |
| 2 | +SETLOCAL ENABLEDELAYEDEXPANSION |
4 | 3 |
|
5 | | -REM Check if ADB is connected |
6 | | -adb devices |
7 | | -IF %ERRORLEVEL% NEQ 0 ( |
8 | | - echo ADB is not connected or not found. Please connect your device and try again. |
| 4 | +REM =============================== |
| 5 | +REM INSTALLATION SECTION |
| 6 | +REM =============================== |
| 7 | +SET TARGET=C:\Scripts |
| 8 | + |
| 9 | +REM Create folder if missing |
| 10 | +IF NOT EXIST "%TARGET%" ( |
| 11 | + mkdir "%TARGET%" |
| 12 | + echo Created %TARGET% |
| 13 | +) |
| 14 | + |
| 15 | +REM Copy this script into the target folder |
| 16 | +copy "%~f0" "%TARGET%\frpbypass.bat" >nul |
| 17 | +echo Installed frpbypass.bat into %TARGET% |
| 18 | + |
| 19 | +REM Add folder to PATH if not already there |
| 20 | +echo %PATH% | find /i "%TARGET%" >nul |
| 21 | +IF ERRORLEVEL 1 ( |
| 22 | + echo Adding %TARGET% to PATH... |
| 23 | + setx /M PATH "%PATH%;%TARGET%" |
| 24 | +) ELSE ( |
| 25 | + echo %TARGET% is already in PATH. |
| 26 | +) |
| 27 | + |
| 28 | +echo. |
| 29 | +echo Installation complete. |
| 30 | +echo You can now run: frpbypass |
| 31 | +echo. |
| 32 | + |
| 33 | +REM =============================== |
| 34 | +REM RUN ONCE AFTER INSTALL |
| 35 | +REM =============================== |
| 36 | +echo Running frpbypass now... |
| 37 | +call :RUN |
| 38 | +exit /b |
| 39 | + |
| 40 | +REM =============================== |
| 41 | +REM MAIN SCRIPT (frpbypass logic) |
| 42 | +REM =============================== |
| 43 | +:RUN |
| 44 | +echo Checking device... |
| 45 | +FOR /F "skip=1 tokens=1,2" %%A IN ('adb devices') DO ( |
| 46 | + IF "%%B"=="device" SET DEVICE_CONNECTED=1 |
| 47 | +) |
| 48 | + |
| 49 | +IF NOT DEFINED DEVICE_CONNECTED ( |
| 50 | + echo No device found. Please connect your device and enable USB debugging. |
9 | 51 | pause |
10 | 52 | exit /b |
11 | 53 | ) |
12 | 54 |
|
13 | | -REM Run ADB commands |
| 55 | +echo Device found. Applying tweaks... |
| 56 | + |
14 | 57 | adb shell settings put global setup_wizard_has_run 1 |
15 | 58 | adb shell settings put secure user_setup_complete 1 |
16 | | -adb shell content insert --uri content://settings/secure --bind name:s:DEVICE_PROVISIONED --bind value:i:1 |
17 | | -adb shell content insert --uri content://settings/secure --bind name:s:user_setup_complete --bind value:i:1 |
18 | | -adb shell content insert --uri content://settings/secure --bind name:s:INSTALL_NON_MARKET_APPS --bind value:i:1 |
19 | | -adb shell am start -c android.intent.category.HOME -a android.intent.action.MAIN |
| 59 | +adb shell settings put global device_provisioned 1 |
| 60 | +adb shell settings put secure install_non_market_apps 1 |
20 | 61 |
|
21 | | -REM Wait for 5 seconds |
| 62 | +adb shell am start -c android.intent.category.HOME -a android.intent.action.MAIN |
22 | 63 | timeout /t 5 /nobreak |
23 | | - |
24 | | -adb shell am start -n com.android.settings/com.android.settings.Settings |
25 | | - |
26 | | -REM Wait for 5 seconds |
| 64 | +adb shell am start -n com.android.settings/.Settings |
27 | 65 | timeout /t 5 /nobreak |
28 | 66 |
|
29 | | -REM Reboot the device |
30 | | -adb shell reboot |
| 67 | +echo Rebooting device... |
| 68 | +adb reboot |
31 | 69 |
|
32 | 70 | echo All done! The device is rebooting. |
33 | 71 | pause |
| 72 | + |
0 commit comments