-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSlim WearOS.bat
More file actions
177 lines (163 loc) · 5.57 KB
/
Copy pathSlim WearOS.bat
File metadata and controls
177 lines (163 loc) · 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
@echo off
:menu
cls
set /P "=//////////////////////////////////////////////////////" < NUL & echo/
set /P "=.__ _ _ __ __ ___ __ " < NUL & echo/
set /P "=/ _\ (_)_ __ ___ / / /\ \ \___ __ _ _ __ /___\/ _\ " < NUL & echo/
set /P "=\ \| | | '_ ` _ \ \ \/ \/ / _ \/ _` | '__// //\ \ " < NUL & echo/
set /P "=_\ \ | | | | | | | \ /\ / __/ (_| | | / \_// _\ \ " < NUL & echo/
set /P "=\__/_|_|_| |_| |_| \/ \/ \___|\__,_|_| \___/ \__/ " < NUL & echo/
set /P "=//////////////////////////////////// By JordanJ //////" < NUL & echo/
echo:
echo:
echo Main Menu
echo.
echo 1. Connect WearOS Device
echo 2. Enable/Disable Google Fit
echo 3. Enable/Disable Custom Apps
echo 4. Quit
echo.
set /p choice=Enter your choice:
if %choice%==1 goto connect
if %choice%==2 goto enable_disable_fit
if %choice%==3 goto enable_disable_apps
if %choice%==4 exit
else (
goto menu
:connect
cls
set /P "=//////////////////////////////////////////////////////" < NUL & echo/
set /P "=.__ _ _ __ __ ___ __ " < NUL & echo/
set /P "=/ _\ (_)_ __ ___ / / /\ \ \___ __ _ _ __ /___\/ _\ " < NUL & echo/
set /P "=\ \| | | '_ ` _ \ \ \/ \/ / _ \/ _` | '__// //\ \ " < NUL & echo/
set /P "=_\ \ | | | | | | | \ /\ / __/ (_| | | / \_// _\ \ " < NUL & echo/
set /P "=\__/_|_|_| |_| |_| \/ \/ \___|\__,_|_| \___/ \__/ " < NUL & echo/
set /P "=//////////////////////////////////// By JordanJ //////" < NUL & echo/
echo:
echo:
echo Connect WearOS Device
echo:
echo Make sure:
echo 1. Make sure you WearOS device is connected to the same wifi network.
echo 2. ADB debugging is enabled on your device.
echo 3. You know the IP address of your device.
echo:
set /p ipaddress=Your device's IP address:
adb connect %ipaddress%
pause
goto menu
:enable_disable_fit
cls
set /P "=//////////////////////////////////////////////////////" < NUL & echo/
set /P "=.__ _ _ __ __ ___ __ " < NUL & echo/
set /P "=/ _\ (_)_ __ ___ / / /\ \ \___ __ _ _ __ /___\/ _\ " < NUL & echo/
set /P "=\ \| | | '_ ` _ \ \ \/ \/ / _ \/ _` | '__// //\ \ " < NUL & echo/
set /P "=_\ \ | | | | | | | \ /\ / __/ (_| | | / \_// _\ \ " < NUL & echo/
set /P "=\__/_|_|_| |_| |_| \/ \/ \___|\__,_|_| \___/ \__/ " < NUL & echo/
set /P "=//////////////////////////////////// By JordanJ //////" < NUL & echo/
echo:
echo:
echo Enable/Disable Google Fit
echo.
echo 1. Disable Google Fit
echo 2. Enable Google Fit
echo 3. Back
echo.
set /p choice=Enter your choice:
if %choice%==1 goto disablefit
if %choice%==2 goto enablefit
if %choice%==3 goto menu
else (
goto enable_disable_fit
:enable_disable_apps
cls
set /P "=//////////////////////////////////////////////////////" < NUL & echo/
set /P "=.__ _ _ __ __ ___ __ " < NUL & echo/
set /P "=/ _\ (_)_ __ ___ / / /\ \ \___ __ _ _ __ /___\/ _\ " < NUL & echo/
set /P "=\ \| | | '_ ` _ \ \ \/ \/ / _ \/ _` | '__// //\ \ " < NUL & echo/
set /P "=_\ \ | | | | | | | \ /\ / __/ (_| | | / \_// _\ \ " < NUL & echo/
set /P "=\__/_|_|_| |_| |_| \/ \/ \___|\__,_|_| \___/ \__/ " < NUL & echo/
set /P "=//////////////////////////////////// By JordanJ //////" < NUL & echo/
echo:
echo:
echo Enable/Disable Custom Apps
echo.
echo 1. List All Apps
echo 2. List Apps Seperatly
echo 3. Change Enable/Disable Preferences
echo 4. Apply Custom Enable/Disable List
echo 5. Back
echo.
set /p choice=Enter your choice:
if %choice%==1 goto listallapps
if %choice%==2 goto listseperatly
if %choice%==3 goto editapps
if %choice%==4 goto apply
if %choice%==5 goto menu
:disablefit
cls
adb shell pm disable-user --user 0 com.google.android.apps.fitness
pause
goto menu
:enablefit
cls
adb shell pm enable --user 0 com.google.android.apps.fitness
pause
goto menu
:listallapps
cls
adb shell pm list packages > apps.txt
setlocal enabledelayedexpansion
set "search=package:"
set "replace="
set "textfile=apps.txt"
set "newfile=applist.txt"
(for /f "delims=" %%i in (%textfile%) do (
set "line=%%i"
set "line=!line:%search%=%replace%!"
echo !line!
))>"%newfile%"
del apps.txt
@echo Apps To Enable:>"Enable.txt"
@echo Apps To Disable>"Disable.txt"
pause
goto menu
:listseperatly
cls
adb shell pm list packages -d > "Packages-List/disabledlist.txt"
adb shell pm list packages -e > "Packages-List/enabledlist.txt"
adb shell pm list packages -s > "Packages-List/systemlist.txt
pause
goto menu
:editapps
cls
echo Two text documents will be automaticly created one after the other. One will be the apps that you want disabled, the other will be the apps you want enabled.
echo:
echo -Each app should be on its own line with no extra characters anywhere.
echo -The package name should be something like ***.******.*****.*** E.g (com.google.android.apps.fitness)
echo -Make sure you save both. (but don't worry about the saved location. It sould already be in the right place)
pause
notepad Disable.txt
notepad Enable.txt
pause
goto menu
:apply
cls
setlocal enabledelayedexpansion
set "prefix=adb shell pm enable --user 0 "
(for /f "delims=" %%a in (Enable.txt) do (
set "line=%%a"
echo !prefix!%%a
)) > Enable.txt
setlocal enabledelayedexpansion
set "prefix=adb shell pm disable-user --user 0 "
(for /f "delims=" %%a in (Disable.txt) do (
set "line=%%a"
echo !prefix!%%a
)) > Disable.txt
ren "Disable.txt" "Disable.bat"
ren "Disable.txt" "Enable.bat"
start "Disable" "Disable.bat"
start "Enable" "Enable.bat"
pause
goto menu