-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig
More file actions
219 lines (181 loc) · 9.07 KB
/
config
File metadata and controls
219 lines (181 loc) · 9.07 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#!/system/bin/sh
# Call variables script
. /data/adb/modules/DroidConsole/system/bin/variables
# Avoid conflict & restore override
[ $(getprop droid.restore) ] && if [ $(getprop droid.restore) == 0 ]; then
[ $(getprop droid.gpu_throttling) ] && if [ $(getprop droid.gpu_throttling) == 1 ]; then
echo "1" > $KGSL/throttling
elif [ $(getprop droid.gpu_throttling) == 0 ]; then
echo "0" > $KGSL/throttling
fi
[ $(getprop droid.cpu_ratelimits) ] && if [ $(getprop droid.cpu_ratelimits) == 1 ]; then
if [ -d $S2 ]; then
droid $S2/up_rate_limit_us "500"
droid $S2/down_rate_limit_us "20000"
elif [ -e $SC ]; then
for cpu in /sys/devices/system/cpu/*/cpufreq/schedutil
do
droid "${cpu}/up_rate_limit_us" "500"
droid "${cpu}/down_rate_limit_us" "20000"
done
fi
fi
[ $(getprop droid.iowait_boost) ] && if [ $(getprop droid.iowait_boost) == 1 ]; then
if [ -d $S2 ]; then
echo "1" > $S2/iowait_boost_enable
elif [ -e $SC ]; then
for cpu in /sys/devices/system/cpu/*/cpufreq/schedutil
do
echo "1" > "${cpu}/iowait_boost_enable"
done
fi
elif [ $(getprop droid.iowait_boost) == 0 ]; then
if [ -d $S2 ]; then
echo "0" > $S2/iowait_boost_enable
elif [ -e $SC ]; then
for cpu in /sys/devices/system/cpu/*/cpufreq/schedutil
do
echo "0" > "${cpu}/iowait_boost_enable"
done
fi
fi
[ $(getprop droid.ram_swap) ] && if [ $(getprop droid.ram_swap) == 1 ]; then
droid $SWP 60
fi
[ $(getprop droid.power_efficient) ] && if [ $(getprop droid.power_efficient) == 1 ]; then
echo "1" > $PWR
elif [ $(getprop droid.power_efficient) == 0 ]; then
echo "0" > $PWR
fi
[ $(getprop droid.gpu_power_lvl) ] && if [ $(getprop droid.gpu_power_lvl) == 1 ]; then
echo "0" > $KGSL/default_pwrlevel
elif [ $(getprop droid.gpu_power_lvl) == 0 ]; then
echo "$MIN_GPU_POWER_LEVEL" > $KGSL/default_pwrlevel
fi
[ $(getprop droid.gpu_power_management) ] && if [ $(getprop droid.gpu_power_management) == 1 ]; then
echo "1" > $KGSL/force_bus_on
echo "1" > $KGSL/force_clk_on
echo "1" > $KGSL/force_no_nap
echo "1" > $KGSL/force_rail_on
elif [ $(getprop droid.gpu_power_management) == 0 ]; then
echo "0" > $KGSL/force_bus_on
echo "0" > $KGSL/force_clk_on
echo "0" > $KGSL/force_no_nap
echo "0" > $KGSL/force_rail_on
fi
[ $(getprop droid.sultan_optimizations) ] && if [ $(getprop droid.sultan_optimizations) == 1 ]; then
echo "Y" > $LYB_TASK/parameters/lyb_sultan_pid
echo "Y" > $LYB_TASK/parameters/lyb_sultan_pid_shrink
elif [ $(getprop droid.sultan_optimizations) == 0 ]; then
echo "N" > $LYB_TASK/parameters/lyb_sultan_pid
echo "N" > $LYB_TASK/parameters/lyb_sultan_pid_shrink
fi
if [ $(getprop droid.floating_bar) -eq 1 ]; then
su -c 'device_config put launcher ENABLE_FLOATING_SEARCH_BAR true'
su -c 'am force-stop com.google.android.apps.nexuslauncher'
elif [ $(getprop droid.floating_bar) -eq 0 ]; then
su -c 'device_config put launcher ENABLE_FLOATING_SEARCH_BAR false'
su -c 'am force-stop com.google.android.apps.nexuslauncher'
fi
# Function to force stop Google Play Services
force_stop_gms() {
su -c 'am force-stop com.google.android.gms'
if [ $? -eq 0 ]; then
echo "Successfully force-stopped Google Play Services" | tee -a /sdcard/droid.log
else
echo "Failed to force-stop Google Play Services" | tee -a /sdcard/droid.log
fi
}
# Function to disable a service
disable_service() {
local service_name="$1"
su -c "pm disable-user --user 0 \"$service_name\""
if [ $? -eq 0 ]; then
echo "Successfully disabled: $service_name" | tee -a /sdcard/droid.log
else
echo "Failed to disable: $service_name" | tee -a /sdcard/droid.log
fi
}
# Function to enable a service
enable_service() {
local service_name="$1"
su -c "pm enable --user 0 \"$service_name\""
if [ $? -eq 0 ]; then
echo "Successfully enabled: $service_name" | tee -a /sdcard/droid.log
else
echo "Failed to enable: $service_name" | tee -a /sdcard/droid.log
fi
}
# Main logic
if [ $(getprop droid.gms) -eq 1 ]; then
echo "Force-stopping Google Play Services..." | tee -a /sdcard/droid.log
force_stop_gms
echo "Disabling Google Play Services components..." | tee -a /sdcard/droid.log
# Disable Google Play Services Wakeup Services
disable_service "com.google.android.gms/.ads.identifier.service.AdvertisingIdService"
disable_service "com.google.android.gms/.ads.AdRequestBrokerService"
disable_service "com.google.android.gms/.location.reporting.service.ReportingAndroidService"
disable_service "com.google.android.gms/.nearby.exposurenotification.service.ExposureNotificationService"
disable_service "com.google.android.gms/.nearby.exposurenotification.service.NearbyMessagesService"
disable_service "com.google.android.gms/.nearby.sharing.ShareTargetDiscoveryService"
# Disable Google Play Services Location Services
disable_service "com.google.android.gms/.location.reporting.service.ReportingAndroidService"
disable_service "com.google.android.gms/.location.reporting.service.LocationHistoryInjectorService"
disable_service "com.google.android.gms/.location.activity.ActivityRecognitionService"
disable_service "com.google.android.gms/.location.fused.FusedLocationService"
# Disable Google Play Services Analytics Services
disable_service "com.google.android.gms/.analytics.AnalyticsService"
disable_service "com.google.android.gms/.analytics.internal.PlayLogReportingService"
disable_service "com.google.android.gms/.analytics.service.PlayLogMonitorIntervalProvider"
# Disable Google Backup Transport Service
disable_service "com.google.android.gms/.backup.BackupTransportService"
disable_service "com.google.android.gms/.backup.BackupService"
# Disable Google Play Services for Instant Apps
disable_service "com.google.android.gms/.instantapps.InstantAppsService"
disable_service "com.google.android.gms/.instantapps.InstantAppsRoutingService"
# Disable Google Play Services Cast Media Router
disable_service "com.google.android.gms/.cast.media.CastMediaRouteProviderService"
disable_service "com.google.android.gms/.cast.service.CastRemoteDisplayProviderService"
# Disable Nearby Sharing
disable_service "com.google.android.gms/.nearby.sharing.ShareTargetDiscoveryService"
# Disable Google Play Protect
disable_service "com.google.android.gms/.security.recaptcha.RecaptchaService"
echo "Disabling services completed." | tee -a /sdcard/droid.log
elif [ $(getprop droid.gms) -eq 0 ]; then
echo "Force-stopping Google Play Services..." | tee -a /sdcard/droid.log
force_stop_gms
echo "Re-enabling Google Play Services components..." | tee -a /sdcard/droid.log
# Re-enable Google Play Services Wakeup Services
enable_service "com.google.android.gms/.ads.identifier.service.AdvertisingIdService"
enable_service "com.google.android.gms/.ads.AdRequestBrokerService"
enable_service "com.google.android.gms/.location.reporting.service.ReportingAndroidService"
enable_service "com.google.android.gms/.nearby.exposurenotification.service.ExposureNotificationService"
enable_service "com.google.android.gms/.nearby.exposurenotification.service.NearbyMessagesService"
enable_service "com.google.android.gms/.nearby.sharing.ShareTargetDiscoveryService"
# Re-enable Google Play Services Location Services
enable_service "com.google.android.gms/.location.reporting.service.ReportingAndroidService"
enable_service "com.google.android.gms/.location.reporting.service.LocationHistoryInjectorService"
enable_service "com.google.android.gms/.location.activity.ActivityRecognitionService"
enable_service "com.google.android.gms/.location.fused.FusedLocationService"
# Re-enable Google Play Services Analytics Services
enable_service "com.google.android.gms/.analytics.AnalyticsService"
enable_service "com.google.android.gms/.analytics.internal.PlayLogReportingService"
enable_service "com.google.android.gms/.analytics.service.PlayLogMonitorIntervalProvider"
# Re-enable Google Backup Transport Service
enable_service "com.google.android.gms/.backup.BackupTransportService"
enable_service "com.google.android.gms/.backup.BackupService"
# Re-enable Google Play Services for Instant Apps
enable_service "com.google.android.gms/.instantapps.InstantAppsService"
enable_service "com.google.android.gms/.instantapps.InstantAppsRoutingService"
# Re-enable Google Play Services Cast Media Router
enable_service "com.google.android.gms/.cast.media.CastMediaRouteProviderService"
enable_service "com.google.android.gms/.cast.service.CastRemoteDisplayProviderService"
# Re-enable Nearby Sharing
enable_service "com.google.android.gms/.nearby.sharing.ShareTargetDiscoveryService"
# Re-enable Google Play Protect
enable_service "com.google.android.gms/.security.recaptcha.RecaptchaService"
echo "Re-enabling services completed." | tee -a /sdcard/droid.log
fi
elif [ $(getprop droid.restore) == 1 ]; then
restore
fi