Skip to content

Commit 3695d05

Browse files
authored
Update unlock.bat
1 parent b9984c5 commit 3695d05

1 file changed

Lines changed: 57 additions & 18 deletions

File tree

unlock.bat

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,72 @@
11
@echo off
2-
REM Ensure ADB is available in PATH
3-
SET PATH=%PATH%;%~dp0
2+
SETLOCAL ENABLEDELAYEDEXPANSION
43

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.
951
pause
1052
exit /b
1153
)
1254

13-
REM Run ADB commands
55+
echo Device found. Applying tweaks...
56+
1457
adb shell settings put global setup_wizard_has_run 1
1558
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
2061

21-
REM Wait for 5 seconds
62+
adb shell am start -c android.intent.category.HOME -a android.intent.action.MAIN
2263
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
2765
timeout /t 5 /nobreak
2866

29-
REM Reboot the device
30-
adb shell reboot
67+
echo Rebooting device...
68+
adb reboot
3169

3270
echo All done! The device is rebooting.
3371
pause
72+

0 commit comments

Comments
 (0)