def get_pixel_launcher(): pixel_launcher = Package("NexusLauncherPrebuilt", "com.google.android.apps.nexuslauncher", Constants.is_priv_app, "PixelLauncher") pixel_launcher.priv_app_permissions.append( "android.permission.PACKAGE_USAGE_STATS") pixel_launcher.delete("TrebuchetQuickStep") # pixel_launcher.delete("Launcher3QuickStep") if TARGET_ANDROID_VERSION <= 10: pixel_launcher.predefined_file_list.append( "overlay/PixelLauncherOverlay.apk") if TARGET_ANDROID_VERSION == 11: pixel_launcher.predefined_file_list.append( "overlay/PixelConfigOverlayCommon.apk") pixel_launcher.predefined_file_list.append( "etc/permissions/com.android.launcher3.xml") pixel_launcher.predefined_file_list.append( "etc/sysconfig/hiddenapi-whitelist-com.google.android.apps.nexuslauncher.xml" ) pixel_launcher.predefined_file_list.append( "etc/permissions/privapp-permissions-com.google.android.apps.nexuslauncher.xml" ) device_personalization_services = Package( "MatchmakerPrebuiltPixel4", "com.google.android.as", Constants.is_priv_app, "DevicePersonalizationServices") gapps_list = [pixel_launcher] if TARGET_ANDROID_VERSION >= 9: if TARGET_ANDROID_VERSION == 10: device_personalization_services.predefined_file_list.append( "overlay/DevicePersonalizationServicesConfig.apk") device_personalization_services.delete_in_rom( "DevicePersonalizationPrebuiltPixel4") gapps_list.append(device_personalization_services) if TARGET_ANDROID_VERSION == 11: quick_access_wallet = Package( "QuickAccessWallet", "com.android.systemui.plugin.globalactions.wallet", Constants.is_priv_app) gapps_list.append(quick_access_wallet) return AppSet("PixelLauncher", gapps_list)
def get_omni_package(): app_set_list = NikGappsPackages.get_basic_package() app_set_list.append(NikGappsPackages.get_setup_wizard()) if TARGET_ANDROID_VERSION >= 10: app_set_list.append(NikGappsPackages.get_pixelize_set()) calculator = Package("CalculatorGooglePrebuilt", "com.google.android.calculator", Constants.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", Constants.is_system_app) app_set_list.append(AppSet("Drive", [google_drive])) google_maps = Package("GoogleMaps", "com.google.android.apps.maps", Constants.is_priv_app) google_maps.delete_in_rom("Maps") app_set_list.append(AppSet("GoogleMaps", [google_maps])) if TARGET_ANDROID_VERSION == 11: google_location_history = Package( "LocationHistoryPrebuilt", "com.google.android.gms.location.history", Constants.is_system_app, "GoogleLocationHistory") google_location_history.delete_in_rom("LocationHistoryPrebuilt") app_set_list.append( AppSet("GoogleLocationHistory", [google_location_history])) gmail = Package("PrebuiltGmail", "com.google.android.gm", Constants.is_system_app, "Gmail") gmail.delete("Email") gmail.delete("PrebuiltEmailGoogle") app_set_list.append(AppSet("Gmail", [gmail])) google_photos = Package("Photos", "com.google.android.apps.photos", Constants.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", Constants.is_priv_app, "DeviceHealthServices") google_turbo.delete_in_rom("TurboPrebuilt") app_set_list.append(AppSet("DeviceHealthServices", [google_turbo])) google_duo = Package("GoogleDuo", "com.google.android.apps.tachyon", Constants.is_system_app) app_set_list.append(AppSet("GoogleDuo", [google_duo])) return app_set_list
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\\" /> </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" >> /tmp/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!" 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" >> /tmp/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!" 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" >> /tmp/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!" 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" >> /tmp/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!" fi""" core_go = AppSet("CoreGo") core_go.add_package(extra_files_go) prebuiltgmscore = Package("PrebuiltGmsCore", "com.google.android.gms", Constants.is_priv_app, "GmsCore") prebuiltgmscore.delete_in_rom("PrebuiltGmsCoreQt") prebuiltgmscore.delete_in_rom("PrebuiltGmsCoreRvc") prebuiltgmscore.delete_in_rom("GmsCore") prebuiltgmscore.additional_installer_script = """ 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!\" 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!\" """ core_go.add_package(prebuiltgmscore) phonesky = Package("Phonesky", "com.android.vending", Constants.is_priv_app, "GooglePlayStore") core_go.add_package(phonesky) googleservicesframework = Package("GoogleServicesFramework", "com.google.android.gsf", Constants.is_priv_app) core_go.add_package(googleservicesframework) googlecontactssyncadapter = Package( "GoogleContactsSyncAdapter", "com.google.android.syncadapters.contacts", Constants.is_system_app) core_go.add_package(googlecontactssyncadapter) googlecalendarsync = Package( "GoogleCalendarSyncAdapter", "com.google.android.syncadapters.calendar", Constants.is_system_app) core_go.add_package(googlecalendarsync) youtube = Package("YouTube", "com.google.android.youtube", Constants.is_system_app) core_go.add_package(youtube) pixel_launcher_set = NikGappsPackages.get_pixel_launcher() for pkg in pixel_launcher_set.package_list: core_go.add_package(pkg) app_set_list = [core_go] google_go = Package("GoogleGo", "com.google.android.apps.searchlite", Constants.is_priv_app) app_set_list.append(AppSet("GoogleGo", [google_go])) google_assistant_go = Package("AssistantGo", "com.google.android.apps.assistant", Constants.is_priv_app) app_set_list.append(AppSet("AssistantGo", [google_assistant_go])) google_maps_go = Package("MapsGo", "com.google.android.apps.mapslite", Constants.is_system_app) app_set_list.append(AppSet("MapsGo", [google_maps_go])) navigation_go = Package("NavigationGo", "com.google.android.apps.navlite", Constants.is_system_app) app_set_list.append(AppSet("NavigationGo", [navigation_go])) gallery_go = Package("GalleryGo", "com.google.android.apps.photosgo", Constants.is_system_app) app_set_list.append(AppSet("GalleryGo", [gallery_go])) gmail_go = Package("GmailGo", "com.google.android.gm.lite", Constants.is_system_app) app_set_list.append(AppSet("GmailGo", [gmail_go])) return app_set_list
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\\" /> </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" >> /tmp/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!" 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" >> /tmp/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!" 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" >> /tmp/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!" 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" >> /tmp/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!" 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", Constants.is_priv_app, "GmsCore") prebuiltgmscore.delete_in_rom("PrebuiltGmsCoreQt") prebuiltgmscore.delete_in_rom("PrebuiltGmsCoreRvc") prebuiltgmscore.delete_in_rom("GmsCore") prebuiltgmscore.additional_installer_script = """ 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!\" 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!\" """ phonesky = Package("Phonesky", "com.android.vending", Constants.is_priv_app, "GooglePlayStore") googleservicesframework = Package("GoogleServicesFramework", "com.google.android.gsf", Constants.is_priv_app) googlecontactssyncadapter = Package( "GoogleContactsSyncAdapter", "com.google.android.syncadapters.contacts", Constants.is_system_app) googlecalendarsync = Package( "GoogleCalendarSyncAdapter", "com.google.android.syncadapters.calendar", Constants.is_system_app) gapps_list = [ files, phonesky, googleservicesframework, googlecontactssyncadapter, googlecalendarsync, prebuiltgmscore ] return [AppSet("Core", gapps_list)]