This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
NikGappsPackages.py
554 lines (518 loc) · 34.3 KB
/
NikGappsPackages.py
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
import Config
from Config import TARGET_ANDROID_VERSION
from NikGapps.Helper import C
from NikGapps.Helper.AddonSet import AddonSet
from NikGapps.Helper.Package import Package
from NikGapps.Helper.AppSet import AppSet
class NikGappsPackages:
all_packages = "full"
@staticmethod
def get_packages(package_type):
if str(package_type).lower() == "go":
return NikGappsPackages.get_go_package()
if str(package_type).lower() == "core":
return NikGappsPackages.get_core_package()
if str(package_type).lower() == "basic":
return NikGappsPackages.get_basic_package()
if str(package_type).lower() == "omni":
return NikGappsPackages.get_omni_package()
if str(package_type).lower() == "stock":
return NikGappsPackages.get_stock_package()
if str(package_type).lower() == "full":
return NikGappsPackages.get_full_package()
if str(package_type).lower() == "all":
all_package_list = []
for app_set in NikGappsPackages.get_full_package():
all_package_list.append(app_set)
for app_set in NikGappsPackages.get_go_package():
all_package_list.append(app_set)
for app_set in AddonSet.get_addon_packages():
all_package_list.append(app_set)
return all_package_list
if str(package_type).lower() == "addons":
addon_set_list = AddonSet.get_addon_packages()
return addon_set_list
if str(package_type).lower() == "addonsets":
addon_set_list = []
for app_set in NikGappsPackages.get_full_package():
if app_set.title in ['Core', 'Pixelize']:
continue
addon_set_list.append(app_set)
for app_set in NikGappsPackages.get_go_package():
if app_set.title in ['CoreGo']:
continue
addon_set_list.append(app_set)
return addon_set_list
else:
addon_set_list = AddonSet.get_addon_packages(package_type)
if addon_set_list is None:
for app_set in NikGappsPackages.get_full_package():
if str(app_set.title).lower() == str(package_type).lower():
return [app_set]
elif len(app_set.package_list) > 1:
for package in app_set.package_list:
if str(package.package_title).lower() == str(package_type).lower():
return [AppSet(package.package_title, [package])]
for app_set in NikGappsPackages.get_go_package():
if str(app_set.title).lower() == str(package_type).lower():
return [app_set]
elif len(app_set.package_list) > 1:
for package in app_set.package_list:
if str(package.package_title).lower() == str(package_type).lower():
return [AppSet(package.package_title, [package])]
return [None]
else:
return addon_set_list
@staticmethod
def get_app_set(pkg: Package, title=None):
if title is None:
name = pkg.package_title
else:
name = title
return AppSet(name, [pkg])
@staticmethod
def get_go_package():
extra_files_go = Package("ExtraFilesGo", None, None)
extra_files_go.additional_installer_script = """script_text="<permissions>
<!-- Shared library required on the device to get Google Dialer updates from
Play Store. This will be deprecated once Google Dialer play store
updates stop supporting pre-O devices. -->
<library name=\\"com.google.android.dialer.support\\"
file=\\"$install_partition/framework/com.google.android.dialer.support.jar\\" />
<!-- Starting from Android O and above, this system feature is required for
getting Google Dialer play store updates. -->
<feature name=\\"com.google.android.apps.dialer.SUPPORTED\\" />
<!-- Feature for Google Dialer Call Recording -->
<feature name=\\"com.google.android.apps.dialer.call_recording_audio\\" />
</permissions>"
echo -e "$script_text" > $install_partition/etc/permissions/com.google.android.dialer.support.xml
set_perm 0 0 0644 "$install_partition/etc/permissions/com.google.android.dialer.support.xml"
installPath=$product_prefix"etc/permissions/com.google.android.dialer.support.xml"
echo "install=$installPath" >> $TMPDIR/addon/$packagePath
if [ -f "$install_partition/etc/permissions/com.google.android.dialer.support.xml" ]; then
addToLog "- $install_partition/etc/permissions/com.google.android.dialer.support.xml Successfully Written!" "$package_title"
fi"""
extra_files_go.additional_installer_script += """
script_text="<permissions>
<library name=\\"com.google.android.maps\\"
file=\\"$install_partition/framework/com.google.android.maps.jar\\" />
</permissions>"
echo -e "$script_text" > $install_partition/etc/permissions/com.google.android.maps.xml
set_perm 0 0 0644 "$install_partition/etc/permissions/com.google.android.maps.xml"
installPath=$product_prefix"etc/permissions/com.google.android.maps.xml"
echo "install=$installPath" >> $TMPDIR/addon/$packagePath
if [ -f "$install_partition/etc/permissions/com.google.android.maps.xml" ]; then
addToLog "- $install_partition/etc/permissions/com.google.android.maps.xml Successfully Written!" "$package_title"
fi"""
extra_files_go.additional_installer_script += """
script_text="<permissions>
<library name=\\"com.google.widevine.software.drm\\"
file=\\"/system/product/framework/com.google.widevine.software.drm.jar\\"/>
</permissions>"
echo -e "$script_text" > $install_partition/etc/permissions/com.google.widevine.software.drm.xml
set_perm 0 0 0644 "$install_partition/etc/permissions/com.google.widevine.software.drm.xml"
installPath=$product_prefix"etc/permissions/com.google.widevine.software.drm.xml"
echo "install=$installPath" >> $TMPDIR/addon/$packagePath
if [ -f "$install_partition/etc/permissions/com.google.widevine.software.drm.xml" ]; then
addToLog "- $install_partition/etc/permissions/com.google.widevine.software.drm.xml Successfully Written!" "$package_title"
fi"""
extra_files_go.additional_installer_script += """
script_text="<permissions>
<library name=\\"com.google.android.media.effects\\"
file=\\"$install_partition/framework/com.google.android.media.effects.jar\\" />
</permissions>"
echo -e "$script_text" > $install_partition/etc/permissions/com.google.android.media.effects.xml
set_perm 0 0 0644 "$install_partition/etc/permissions/com.google.android.media.effects.xml"
installPath=$product_prefix"etc/permissions/com.google.android.media.effects.xml"
echo "install=$installPath" >> $TMPDIR/addon/$packagePath
if [ -f "$install_partition/etc/permissions/com.google.android.media.effects.xml" ]; then
addToLog "- $install_partition/etc/permissions/com.google.android.media.effects.xml Successfully Written!" "$package_title"
fi"""
core_go = AppSet("CoreGo")
core_go.add_package(extra_files_go)
prebuiltgmscore = Package("PrebuiltGmsCore", "com.google.android.gms", C.is_priv_app, "GmsCore")
prebuiltgmscore.delete("PrebuiltGmsCoreQt")
prebuiltgmscore.delete("PrebuiltGmsCoreRvc")
prebuiltgmscore.delete("GmsCore")
prebuiltgmscore.additional_installer_script = """
gms_optimization=$(ReadConfigValue "gms_optimization" "$nikgapps_config_file_name")
[ -z "$gms_optimization" ] && gms_optimization=0
if [ "$gms_optimization" = "1" ]; then
sed -i '/allow-in-power-save package=\"com.google.android.gms\"/d' $install_partition/etc/permissions/*.xml
sed -i '/allow-in-data-usage-save package=\"com.google.android.gms\"/d' $install_partition/etc/permissions/*.xml
sed -i '/allow-unthrottled-location package=\"com.google.android.gms\"/d' $install_partition/etc/permissions/*.xml
sed -i '/allow-ignore-location-settings package=\"com.google.android.gms\"/d' $install_partition/etc/permissions/*.xml
addToLog \"- Battery Optimization Done in $install_partition/etc/permissions/*.xml!\" "$package_title"
sed -i '/allow-in-power-save package=\"com.google.android.gms\"/d' $install_partition/etc/sysconfig/*.xml
sed -i '/allow-in-data-usage-save package=\"com.google.android.gms\"/d' $install_partition/etc/sysconfig/*.xml
sed -i '/allow-unthrottled-location package=\"com.google.android.gms\"/d' $install_partition/etc/sysconfig/*.xml
sed -i '/allow-ignore-location-settings package=\"com.google.android.gms\"/d' $install_partition/etc/sysconfig/*.xml
addToLog \"- Battery Optimization Done in $install_partition/etc/sysconfig/*.xml!\" "$package_title"
else
addToLog "- Battery Optimization not Enabled" "$package_title"
fi
"""
core_go.add_package(prebuiltgmscore)
phonesky = Package("Phonesky", "com.android.vending", C.is_priv_app, "GooglePlayStore")
core_go.add_package(phonesky)
googleservicesframework = Package("GoogleServicesFramework", "com.google.android.gsf", C.is_priv_app)
core_go.add_package(googleservicesframework)
googlecontactssyncadapter = Package("GoogleContactsSyncAdapter", "com.google.android.syncadapters.contacts",
C.is_system_app)
core_go.add_package(googlecontactssyncadapter)
googlecalendarsync = Package("GoogleCalendarSyncAdapter", "com.google.android.syncadapters.calendar",
C.is_system_app)
core_go.add_package(googlecalendarsync)
for pkg in core_go.package_list:
pkg.addon_index = "05"
app_set_list = [core_go]
google_go = Package("GoogleGo", "com.google.android.apps.searchlite", C.is_priv_app)
app_set_list.append(AppSet("GoogleGo", [google_go]))
google_assistant_go = Package("AssistantGo", "com.google.android.apps.assistant", C.is_priv_app)
app_set_list.append(AppSet("AssistantGo", [google_assistant_go]))
google_maps_go = Package("MapsGo", "com.google.android.apps.mapslite", C.is_system_app)
app_set_list.append(AppSet("MapsGo", [google_maps_go]))
navigation_go = Package("NavigationGo", "com.google.android.apps.navlite", C.is_system_app)
app_set_list.append(AppSet("NavigationGo", [navigation_go]))
gallery_go = Package("GalleryGo", "com.google.android.apps.photosgo", C.is_system_app)
app_set_list.append(AppSet("GalleryGo", [gallery_go]))
gmail_go = Package("GmailGo", "com.google.android.gm.lite", C.is_system_app)
app_set_list.append(AppSet("GmailGo", [gmail_go]))
return app_set_list
@staticmethod
def get_core_package():
files = Package("ExtraFiles", None, None)
files.additional_installer_script = """script_text="<permissions>
<!-- Shared library required on the device to get Google Dialer updates from
Play Store. This will be deprecated once Google Dialer play store
updates stop supporting pre-O devices. -->
<library name=\\"com.google.android.dialer.support\\"
file=\\"$install_partition/framework/com.google.android.dialer.support.jar\\" />
<!-- Starting from Android O and above, this system feature is required for
getting Google Dialer play store updates. -->
<feature name=\\"com.google.android.apps.dialer.SUPPORTED\\" />
<!-- Feature for Google Dialer Call Recording -->
<feature name=\\"com.google.android.apps.dialer.call_recording_audio\\" />
</permissions>"
echo -e "$script_text" > $install_partition/etc/permissions/com.google.android.dialer.support.xml
set_perm 0 0 0644 "$install_partition/etc/permissions/com.google.android.dialer.support.xml"
installPath=$product_prefix"etc/permissions/com.google.android.dialer.support.xml"
echo "install=$installPath" >> $TMPDIR/addon/$packagePath
if [ -f "$install_partition/etc/permissions/com.google.android.dialer.support.xml" ]; then
addToLog "- $install_partition/etc/permissions/com.google.android.dialer.support.xml Successfully Written!" "$package_title"
fi"""
files.additional_installer_script += """
script_text="<permissions>
<library name=\\"com.google.android.maps\\"
file=\\"$install_partition/framework/com.google.android.maps.jar\\" />
</permissions>"
echo -e "$script_text" > $install_partition/etc/permissions/com.google.android.maps.xml
set_perm 0 0 0644 "$install_partition/etc/permissions/com.google.android.maps.xml"
installPath=$product_prefix"etc/permissions/com.google.android.maps.xml"
echo "install=$installPath" >> $TMPDIR/addon/$packagePath
if [ -f "$install_partition/etc/permissions/com.google.android.maps.xml" ]; then
addToLog "- $install_partition/etc/permissions/com.google.android.maps.xml Successfully Written!" "$package_title"
fi"""
files.additional_installer_script += """
script_text="<permissions>
<library name=\\"com.google.widevine.software.drm\\"
file=\\"/system/product/framework/com.google.widevine.software.drm.jar\\"/>
</permissions>"
echo -e "$script_text" > $install_partition/etc/permissions/com.google.widevine.software.drm.xml
set_perm 0 0 0644 "$install_partition/etc/permissions/com.google.widevine.software.drm.xml"
installPath=$product_prefix"etc/permissions/com.google.widevine.software.drm.xml"
echo "install=$installPath" >> $TMPDIR/addon/$packagePath
if [ -f "$install_partition/etc/permissions/com.google.widevine.software.drm.xml" ]; then
addToLog "- $install_partition/etc/permissions/com.google.widevine.software.drm.xml Successfully Written!" "$package_title"
fi"""
files.additional_installer_script += """
script_text="<permissions>
<library name=\\"com.google.android.media.effects\\"
file=\\"$install_partition/framework/com.google.android.media.effects.jar\\" />
</permissions>"
echo -e "$script_text" > $install_partition/etc/permissions/com.google.android.media.effects.xml
set_perm 0 0 0644 "$install_partition/etc/permissions/com.google.android.media.effects.xml"
installPath=$product_prefix"etc/permissions/com.google.android.media.effects.xml"
echo "install=$installPath" >> $TMPDIR/addon/$packagePath
if [ -f "$install_partition/etc/permissions/com.google.android.media.effects.xml" ]; then
addToLog "- $install_partition/etc/permissions/com.google.android.media.effects.xml Successfully Written!" "$package_title"
fi"""
# example of how to add files
# files.predefined_file_list.append("framework/com.google.android.media.effects.jar")
# files.predefined_file_list.append("lib64/libgdx.so")
prebuiltgmscore = Package("PrebuiltGmsCore", "com.google.android.gms", C.is_priv_app, "GmsCore")
prebuiltgmscore.delete("PrebuiltGmsCoreQt")
prebuiltgmscore.delete("PrebuiltGmsCoreRvc")
prebuiltgmscore.delete("GmsCore")
prebuiltgmscore.additional_installer_script = """
gms_optimization=$(ReadConfigValue "gms_optimization" "$nikgapps_config_file_name")
[ -z "$gms_optimization" ] && gms_optimization=0
if [ "$gms_optimization" = "1" ]; then
sed -i '/allow-in-power-save package=\"com.google.android.gms\"/d' $install_partition/etc/permissions/*.xml
sed -i '/allow-in-data-usage-save package=\"com.google.android.gms\"/d' $install_partition/etc/permissions/*.xml
sed -i '/allow-unthrottled-location package=\"com.google.android.gms\"/d' $install_partition/etc/permissions/*.xml
sed -i '/allow-ignore-location-settings package=\"com.google.android.gms\"/d' $install_partition/etc/permissions/*.xml
addToLog \"- Battery Optimization Done in $install_partition/etc/permissions/*.xml!\" "$package_title"
sed -i '/allow-in-power-save package=\"com.google.android.gms\"/d' $install_partition/etc/sysconfig/*.xml
sed -i '/allow-in-data-usage-save package=\"com.google.android.gms\"/d' $install_partition/etc/sysconfig/*.xml
sed -i '/allow-unthrottled-location package=\"com.google.android.gms\"/d' $install_partition/etc/sysconfig/*.xml
sed -i '/allow-ignore-location-settings package=\"com.google.android.gms\"/d' $install_partition/etc/sysconfig/*.xml
addToLog \"- Battery Optimization Done in $install_partition/etc/sysconfig/*.xml!\" "$package_title"
else
addToLog "- Battery Optimization not Enabled" "$package_title"
fi
"""
phonesky = Package("Phonesky", "com.android.vending", C.is_priv_app, "GooglePlayStore")
googleservicesframework = Package("GoogleServicesFramework", "com.google.android.gsf", C.is_priv_app)
googlecontactssyncadapter = Package("GoogleContactsSyncAdapter", "com.google.android.syncadapters.contacts",
C.is_system_app)
googlecalendarsync = Package("GoogleCalendarSyncAdapter", "com.google.android.syncadapters.calendar",
C.is_system_app)
gapps_list = [files, phonesky, googleservicesframework, googlecontactssyncadapter, googlecalendarsync,
prebuiltgmscore]
for pkg in gapps_list:
pkg.addon_index = "05"
return [AppSet("Core", gapps_list)]
@staticmethod
def get_basic_package():
app_set_list = NikGappsPackages.get_core_package()
digital_wellbeing = Package("WellbeingPreBuilt", "com.google.android.apps.wellbeing", C.is_priv_app,
"DigitalWellbeing")
app_set_list.append(AppSet("DigitalWellbeing", [digital_wellbeing]))
google_messages = Package("PrebuiltBugle", "com.google.android.apps.messaging", C.is_system_app,
"GoogleMessages")
google_messages.delete("RevengeMessages")
google_messages.delete("messaging")
google_messages.delete("Messaging")
google_messages.delete("QKSMS")
google_messages.delete("Mms")
app_set_list.append(AppSet("GoogleMessages", [google_messages]))
google_dialer = Package("GoogleDialer", "com.google.android.dialer", C.is_priv_app)
google_dialer.predefined_file_list.append("framework/com.google.android.dialer.support.jar")
google_dialer.delete("Dialer")
app_set_list.append(AppSet("GoogleDialer", [google_dialer]))
google_contacts = Package("GoogleContacts", "com.google.android.contacts", C.is_system_app)
google_contacts.delete("Contacts")
app_set_list.append(AppSet("GoogleContacts", [google_contacts]))
carrier_services = Package("CarrierServices", "com.google.android.ims", C.is_priv_app)
app_set_list.append(AppSet("CarrierServices", [carrier_services]))
google_clock = Package("PrebuiltDeskClockGoogle", "com.google.android.deskclock", C.is_system_app,
"GoogleClock")
google_clock.delete("DeskClock")
google_clock.clean_flash_only = True
app_set_list.append(AppSet("GoogleClock", [google_clock]))
return app_set_list
@staticmethod
def get_omni_package():
app_set_list = NikGappsPackages.get_basic_package()
app_set_list.append(NikGappsPackages.get_setup_wizard())
# Dropping pixelize support, need to keep it stock
calculator = Package("CalculatorGooglePrebuilt", "com.google.android.calculator", C.is_system_app,
"GoogleCalculator")
calculator.delete("ExactCalculator")
calculator.delete("RevengeOSCalculator")
app_set_list.append(AppSet("GoogleCalculator", [calculator]))
google_drive = Package("Drive", "com.google.android.apps.docs", C.is_system_app)
app_set_list.append(AppSet("Drive", [google_drive]))
google_maps = Package("GoogleMaps", "com.google.android.apps.maps", C.is_priv_app)
google_maps.delete("Maps")
app_set_list.append(AppSet("GoogleMaps", [google_maps]))
if float(Config.TARGET_ANDROID_VERSION) >= 11:
google_location_history = Package("LocationHistoryPrebuilt", "com.google.android.gms.location.history",
C.is_system_app, "GoogleLocationHistory")
app_set_list.append(AppSet("GoogleLocationHistory", [google_location_history]))
google_photos = Package("Photos", "com.google.android.apps.photos", C.is_system_app, "GooglePhotos")
google_photos.delete("Gallery")
google_photos.delete("SimpleGallery")
google_photos.delete("Gallery2")
google_photos.delete("MotGallery")
google_photos.delete("MediaShortcuts")
google_photos.delete("SimpleGallery")
google_photos.delete("FineOSGallery")
google_photos.delete("GalleryX")
google_photos.delete("MiuiGallery")
google_photos.delete("SnapdragonGallery")
app_set_list.append(AppSet("GooglePhotos", [google_photos]))
google_turbo = Package("Turbo", "com.google.android.apps.turbo", C.is_priv_app, "DeviceHealthServices")
google_turbo.delete("TurboPrebuilt")
app_set_list.append(AppSet("DeviceHealthServices", [google_turbo]))
google_board = Package("LatinIMEGooglePrebuilt", "com.google.android.inputmethod.latin",
C.is_system_app, "GBoard")
google_board.additional_installer_script = """
set_prop "ro.com.google.ime.bs_theme" "true" "$install_partition/build.prop"
set_prop "ro.com.google.ime.theme_id" "5" "$install_partition/build.prop"
set_prop "ro.com.google.ime.system_lm_dir" "$install_partition/usr/share/ime/google/d3_lms" "$install_partition/build.prop"
"""
google_board.delete("LatinIME")
google_board.clean_flash_only = True
app_set_list.append(AppSet("GBoard", [google_board]))
google_calendar = Package("CalendarGooglePrebuilt", "com.google.android.calendar", C.is_priv_app,
"GoogleCalendar")
google_calendar.delete("Calendar")
google_calendar.delete("Etar")
google_calendar.delete("SimpleCalendar")
app_set_list.append(AppSet("GoogleCalendar", [google_calendar]))
google_keep = Package("PrebuiltKeep", "com.google.android.keep", C.is_priv_app, "GoogleKeep")
google_keep.delete("Notepad")
app_set_list.append(AppSet("GoogleKeep", [google_keep]))
return app_set_list
@staticmethod
def get_stock_package():
app_set_list = NikGappsPackages.get_omni_package()
play_games = Package("PlayGames", "com.google.android.play.games", C.is_system_app)
app_set_list.append(AppSet("PlayGames", [play_games]))
app_set_list.append(AddonSet.get_pixel_launcher())
app_set_list.append(NikGappsPackages.get_google_files())
google_recorder = Package("RecorderPrebuilt", "com.google.android.apps.recorder", C.is_priv_app,
"GoogleRecorder")
google_recorder.delete("Recorder")
google_recorder.delete("QtiSoundRecorder")
app_set_list.append(AppSet("GoogleRecorder", [google_recorder]))
google_markup = Package("MarkupGoogle", "com.google.android.markup", C.is_system_app)
app_set_list.append(AppSet("MarkupGoogle", [google_markup]))
app_set_list.append(AddonSet.get_google_tts())
google_velvet = Package("Velvet", "com.google.android.googlequicksearchbox", C.is_priv_app)
google_velvet.priv_app_permissions.append("android.permission.EXPAND_STATUS_BAR")
google_velvet.priv_app_permissions.append("android.permission.SET_MEDIA_KEY_LISTENER")
google_velvet.priv_app_permissions.append("android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER")
google_velvet.priv_app_permissions.append("android.permission.MANAGE_USB")
google_velvet.priv_app_permissions.append("android.permission.START_ACTIVITIES_FROM_BACKGROUND")
google_velvet.priv_app_permissions.append("android.permission.WRITE_APN_SETTINGS")
google_velvet.priv_app_permissions.append("android.permission.BLUETOOTH_PRIVILEGED")
google_velvet.priv_app_permissions.append("android.permission.MODIFY_AUDIO_ROUTING")
google_velvet.clean_flash_only = True
google_velvet.additional_installer_script = """
set_prop "ro.opa.eligible_device" "true" "$install_partition/build.prop"
"""
google_assistant = Package("Assistant", "com.google.android.apps.googleassistant", C.is_priv_app)
google_assistant.clean_flash_only = True
app_set_list.append(AppSet("GoogleSearch", [google_velvet, google_assistant]))
google_sounds = Package("SoundPickerPrebuilt", "com.google.android.soundpicker", C.is_system_app,
"GoogleSounds")
google_sounds.clean_flash_only = True
app_set_list.append(AppSet("GoogleSounds", [google_sounds]))
return app_set_list
@staticmethod
def get_full_package():
app_set_list = NikGappsPackages.get_stock_package()
app_set_list.append(NikGappsPackages.get_chrome())
gmail = Package("PrebuiltGmail", "com.google.android.gm", C.is_system_app, "Gmail")
gmail.delete("Email")
gmail.delete("PrebuiltEmailGoogle")
app_set_list.append(AppSet("Gmail", [gmail]))
if float(Config.TARGET_ANDROID_VERSION) >= 10:
google_device_setup = Package("OTAConfigPrebuilt", "com.google.android.apps.work.oobconfig",
C.is_priv_app, "DeviceSetup")
app_set_list.append(AppSet("DeviceSetup", [google_device_setup]))
android_auto = Package("AndroidAutoStubPrebuilt", "com.google.android.projection.gearhead",
C.is_priv_app, "AndroidAuto")
android_auto.clean_flash_only = True
app_set_list.append(AppSet("AndroidAuto", [android_auto]))
google_feedback = Package("GoogleFeedback", "com.google.android.feedback", C.is_priv_app,
partition="system_ext")
app_set_list.append(AppSet("GoogleFeedback", [google_feedback]))
google_partner_setup = Package("PartnerSetupPrebuilt", "com.google.android.partnersetup", C.is_priv_app,
"GooglePartnerSetup")
app_set_list.append(AppSet("GooglePartnerSetup", [google_partner_setup]))
if float(Config.TARGET_ANDROID_VERSION) >= 10:
android_device_policy = Package("DevicePolicyPrebuilt", "com.google.android.apps.work.clouddpc",
C.is_system_app, "AndroidDevicePolicy")
app_set_list.append(AppSet("AndroidDevicePolicy", [android_device_policy]))
return app_set_list
@staticmethod
def get_google_files():
app_set_list = AppSet("GoogleFiles")
google_files = Package("FilesPrebuilt", "com.google.android.apps.nbu.files", C.is_priv_app,
"GoogleFiles")
app_set_list.add_package(google_files)
storage_manager_google = Package("StorageManagerGoogle", "com.google.android.storagemanager",
C.is_priv_app, "StorageManager", partition="system_ext")
app_set_list.add_package(storage_manager_google)
if float(Config.TARGET_ANDROID_VERSION) >= 11:
documents_ui_google = Package("DocumentsUIGoogle", "com.google.android.documentsui", C.is_priv_app)
documents_ui_google.delete("DocumentsUI")
app_set_list.add_package(documents_ui_google)
return app_set_list
@staticmethod
def get_chrome():
google_chrome = Package("GoogleChrome", "com.android.chrome", C.is_system_app)
google_chrome.delete("Bolt")
google_chrome.delete("Browser")
google_chrome.delete("Browser2")
google_chrome.delete("BrowserIntl")
google_chrome.delete("BrowserProviderProxy")
google_chrome.delete("Chromium")
google_chrome.delete("DuckDuckGo")
google_chrome.delete("Fluxion")
google_chrome.delete("Gello")
google_chrome.delete("Jelly")
google_chrome.delete("PA_Browser")
google_chrome.delete("PABrowser")
google_chrome.delete("YuBrowser")
google_chrome.delete("BLUOpera")
google_chrome.delete("BLUOperaPreinstall")
google_chrome.delete("ViaBrowser")
google_chrome.delete("Duckduckgo")
app_set_list = AppSet("GoogleChrome")
app_set_list.add_package(google_chrome)
if float(Config.TARGET_ANDROID_VERSION) >= 10:
google_webview = Package("WebViewGoogle", "com.google.android.webview", C.is_system_app)
google_webview.delete("webview")
trichromelibrary = Package("TrichromeLibrary", "com.google.android.trichromelibrary",
C.is_system_app)
app_set_list.add_package(google_webview)
app_set_list.add_package(trichromelibrary)
return app_set_list
@staticmethod
def get_setup_wizard():
setup_wizard = Package("SetupWizardPrebuilt", "com.google.android.setupwizard", C.is_priv_app,
"SetupWizard")
setup_wizard.delete("Provision")
setup_wizard.delete("SetupWizard")
setup_wizard.delete("LineageSetupWizard")
setup_wizard.additional_installer_script = """
set_prop "setupwizard.feature.baseline_setupwizard_enabled" "true" "$install_partition/build.prop"
set_prop "ro.setupwizard.enterprise_mode" "1" "$install_partition/build.prop"
set_prop "ro.setupwizard.rotation_locked" "true" "$install_partition/build.prop"
set_prop "setupwizard.enable_assist_gesture_training" "true" "$install_partition/build.prop"
set_prop "setupwizard.theme" "glif_v3_light" "$install_partition/build.prop"
set_prop "setupwizard.feature.skip_button_use_mobile_data.carrier1839" "true" "$install_partition/build.prop"
set_prop "setupwizard.feature.show_pai_screen_in_main_flow.carrier1839" "false" "$install_partition/build.prop"
set_prop "setupwizard.feature.show_pixel_tos" "false" "$install_partition/build.prop"
"""
google_restore = Package("GoogleRestore", "com.google.android.apps.restore", C.is_priv_app)
google_restore.delete("Seedvault")
android_migrate_prebuilt = Package("AndroidMigratePrebuilt", "com.google.android.apps.pixelmigrate",
C.is_priv_app)
setup_wizard_set = AppSet("SetupWizard")
setup_wizard_set.add_package(setup_wizard)
setup_wizard_set.add_package(google_restore)
if float(Config.TARGET_ANDROID_VERSION) >= 10:
google_one_time_initializer = Package("GoogleOneTimeInitializer", "com.google.android.onetimeinitializer",
C.is_priv_app, partition="system_ext")
setup_wizard_set.add_package(google_one_time_initializer)
if float(Config.TARGET_ANDROID_VERSION) < 12:
setup_wizard_set.add_package(android_migrate_prebuilt)
return setup_wizard_set
@staticmethod
def get_lawnchair():
lawnchair_set = AppSet("Lawnchair")
if float(Config.TARGET_ANDROID_VERSION) == 10:
lawnchair_ci = Package("Lawnchair", "ch.deletescape.lawnchair.ci", C.is_priv_app)
if "etc/permissions/privapp-permissions-lawnchair.xml" not in lawnchair_ci.predefined_file_list:
lawnchair_ci.predefined_file_list.append("etc/permissions/privapp-permissions-lawnchair.xml")
if "etc/sysconfig/lawnchair-hiddenapi-package-whitelist.xml" not in lawnchair_ci.predefined_file_list:
lawnchair_ci.predefined_file_list.append("etc/sysconfig/lawnchair-hiddenapi-package-whitelist.xml")
overlay = "overlay/LawnchairRecentsProvider/LawnchairRecentsProvider.apk"
lawnchair_recents_provider = Package("LawnchairRecentsProvider", "com.android.overlay.shady.recents", None)
if overlay not in lawnchair_recents_provider.predefined_file_list:
lawnchair_recents_provider.predefined_file_list.append(overlay)
lawnchair_set.add_package(lawnchair_ci)
lawnchair_recents_provider.enabled = 0
lawnchair_set.add_package(lawnchair_recents_provider)
else:
lawnchair = Package("Lawnchair", "ch.deletescape.lawnchair.plah", C.is_priv_app)
lawnchair_set.add_package(lawnchair)
lawnfeed = Package("Lawnfeed", "ch.deletescape.lawnchair.lawnfeed", C.is_system_app)
lawnchair_set.add_package(lawnfeed)
return lawnchair_set