def get_setup_wizard(): setup_wizard = Package("SetupWizardPrebuilt", "com.google.android.setupwizard", Constants.is_priv_app, "SetupWizard") setup_wizard.delete("Provision") setup_wizard.delete("SetupWizardPrebuilt") setup_wizard.delete("SetupWizard") setup_wizard.delete("GoogleRestore") 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", Constants.is_priv_app) setup_wizard_set = AppSet("SetupWizard") setup_wizard_set.add_package(setup_wizard) setup_wizard_set.add_package(google_restore) if TARGET_ANDROID_VERSION >= 10: google_one_time_initializer = Package( "GoogleOneTimeInitializer", "com.google.android.onetimeinitializer", Constants.is_priv_app) setup_wizard_set.add_package(google_one_time_initializer) return setup_wizard_set
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_stock_package(): app_set_list = NikGappsPackages.get_omni_package() google_velvet = Package("Velvet", "com.google.android.googlequicksearchbox", Constants.is_priv_app) google_velvet.priv_app_permissions.append( "android.permission.WRITE_APN_SETTINGS") google_velvet.priv_app_permissions.append( "android.permission.BLUETOOTH_PRIVILEGED") google_velvet.additional_installer_script = """ set_prop "ro.opa.eligible_device" "true" "$install_partition/build.prop" """ app_set_list.append(AppSet("Velvet", [google_velvet])) google_board = Package("LatinIMEGooglePrebuilt", "com.google.android.inputmethod.latin", Constants.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") app_set_list.append(AppSet("GBoard", [google_board])) app_set_list.append(NikGappsPackages.get_pixel_launcher()) if TARGET_ANDROID_VERSION == 11: app_set_list.append(NikGappsPackages.get_google_files()) play_games = Package("PlayGames", "com.google.android.play.games", Constants.is_system_app) app_set_list.append(AppSet("PlayGames", [play_games])) google_calendar = Package("CalendarGooglePrebuilt", "com.google.android.calendar", Constants.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_markup = Package("MarkupGoogle", "com.google.android.markup", Constants.is_system_app) app_set_list.append(AppSet("MarkupGoogle", [google_markup])) google_wallpaper = Package("WallpaperPickerGooglePrebuilt", "com.google.android.apps.wallpaper", Constants.is_priv_app, "GoogleWallpaper") app_set_list.append(AppSet("GoogleWallpaper", [google_wallpaper])) google_feedback = Package("GoogleFeedback", "com.google.android.feedback", Constants.is_priv_app) app_set_list.append(AppSet("GoogleFeedback", [google_feedback])) google_partner_setup = Package("PartnerSetupPrebuilt", "com.google.android.partnersetup", Constants.is_priv_app, "GooglePartnerSetup") app_set_list.append( AppSet("GooglePartnerSetup", [google_partner_setup])) google_sounds = Package("SoundPickerPrebuilt", "com.google.android.soundpicker", Constants.is_system_app, "GoogleSounds") app_set_list.append(AppSet("GoogleSounds", [google_sounds])) if TARGET_ANDROID_VERSION >= 10: android_device_policy = Package( "DevicePolicyPrebuilt", "com.google.android.apps.work.clouddpc", Constants.is_system_app, "AndroidDevicePolicy") app_set_list.append( AppSet("AndroidDevicePolicy", [android_device_policy])) return app_set_list
def get_basic_package(): app_set_list = NikGappsPackages.get_core_package() digital_wellbeing = Package("WellbeingPreBuilt", "com.google.android.apps.wellbeing", Constants.is_priv_app, "DigitalWellbeing") if TARGET_ANDROID_VERSION == 10: digital_wellbeing.predefined_file_list.append( "overlay/WellbeingOverlay.apk") vanced_manager = Package("VancedManager", "com.vanced.manager", Constants.is_system_app) vanced_manager.enabled = 0 app_set_list.append(AppSet("DigitalWellbeing", [digital_wellbeing])) app_set_list.append(AppSet("VancedManager", [vanced_manager])) google_messages = Package("PrebuiltBugle", "com.google.android.apps.messaging", Constants.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", Constants.is_priv_app) if TARGET_ANDROID_VERSION == 10: google_dialer.predefined_file_list.append( "overlay/PhoneOverlay.apk") google_dialer.predefined_file_list.append( "overlay/TelecomOverlay.apk") google_dialer.predefined_file_list.append( "overlay/DefaultDialerOverlay.apk") google_dialer.predefined_file_list.append( "framework/com.google.android.dialer.support.jar") google_dialer.delete("Dialer") google_dialer.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 # set Google Dialer as default; based on the work of osm0sis @ xda-developers setver=\"122\" # lowest version in MM, tagged at 6.0.0 setsec=\"/data/system/users/0/settings_secure.xml\" if [ -f \"$setsec\" ]; then if grep -q 'dialer_default_application' \"$setsec\"; then if ! grep -q 'dialer_default_application\" value=\"com.google.android.dialer' \"$setsec\"; then curentry=\"$(grep -o 'dialer_default_application\" value=.*$' \"$setsec\")\" newentry='dialer_default_application\" value=\"com.google.android.dialer\" package=\"android\" />\\r' sed -i \"s;${curentry};${newentry};\" \"$setsec\" fi else max=\"0\" for i in $(grep -o 'id=.*$' \"$setsec\" | cut -d '\"' -f 2); do test \"$i\" -gt \"$max\" && max=\"$i\" done entry='<setting id=\"'\"$((max + 1))\"'\" name=\"dialer_default_application\" value=\"com.google.android.dialer\" package=\"android\" />\\r' sed -i \"/<settings version=\\\"/a\ \ ${entry}\" \"$setsec\" fi else if [ ! -d \"/data/system/users/0\" ]; then install -d \"/data/system/users/0\" chown -R 1000:1000 \"/data/system\" chmod -R 775 \"/data/system\" chmod 700 \"/data/system/users/0\" fi { echo -e \"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\\r\" echo -e '<settings version=\"'$setver'\">\\r' echo -e ' <setting id="1" name=\"dialer_default_application\" value=\"com.google.android.dialer\" package=\"android\" />\\r' echo -e '</settings>'; } > \"$setsec\" fi chown 1000:1000 \"$setsec\" chmod 600 \"$setsec\" if [ -f "$setsec" ]; then addToLog "- $setsec Successfully Written!" fi""" app_set_list.append(AppSet("GoogleDialer", [google_dialer])) google_contacts = Package("GoogleContacts", "com.google.android.contacts", Constants.is_priv_app) google_contacts.delete("Contacts") app_set_list.append(AppSet("GoogleContacts", [google_contacts])) carrier_services = Package("CarrierServices", "com.google.android.ims", Constants.is_priv_app) app_set_list.append(AppSet("CarrierServices", [carrier_services])) google_clock = Package("PrebuiltDeskClockGoogle", "com.google.android.deskclock", Constants.is_system_app, "GoogleClock") google_clock.delete("DeskClock") app_set_list.append(AppSet("GoogleClock", [google_clock])) 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)]
def build_from_directory(app_set_build_list): dir_path = Constants.source_directory cmd = Cmd() app_set_list = [] for app_set in app_set_build_list: app_set: AppSet name = app_set.title app_set_path = Constants.path.join(dir_path, name) package_list = [] for package in app_set.package_list: pkg_to_build = package package_title = pkg_to_build.package_title pkg_path = Constants.path.join(app_set_path, package_title) file_dict = dict() folder_dict = dict() install_list = [] package_name = None app_type = None primary_app_location = None delete_files_list = [] # print("Package Name: " + package.title) for pkg_files in Path(pkg_path).rglob("*"): if Path(pkg_files).is_dir() or str(pkg_files).__contains__(".git") \ or str(pkg_files).endswith(".gitattributes") or str(pkg_files).endswith("README.md"): continue if str(pkg_files).endswith(Constants.DELETE_FILES_NAME): for str_data in FileOp.read_string_file(pkg_files): delete_file = str_data[:-1] if delete_file not in pkg_to_build.delete_files_list: delete_files_list.append(delete_file) continue pkg_files_path = str(pkg_files) pkg_files_path = pkg_files_path[pkg_files_path.find("___") + 3:] if pkg_to_build.package_name is not None and str(pkg_files_path).endswith(".apk") and not str( pkg_files).__contains__("split_") and not str(pkg_files).__contains__("___m___"): primary_app_location = pkg_files.absolute() package_name = cmd.get_package_name(primary_app_location) # print("File: " + package_name) package_version = cmd.get_package_version(primary_app_location) # print("Package Version: " + package_version) if str(primary_app_location).__contains__("___priv-app___"): app_type = Constants.is_priv_app elif str(primary_app_location).__contains__("___app___"): app_type = Constants.is_system_app for folder in FileOp.get_dir_list(pkg_files_path): folder_dict[folder] = folder # We don't need this but for the sake of consistency install_list.append(pkg_files_path.replace("___", "/")) file_dict[pkg_files.absolute()] = str(pkg_files_path.replace("___", "/")).replace("\\", "/") if primary_app_location is not None: title = Constants.get_base_name(primary_app_location)[:-4] else: title = package_title pkg = Package(title, package_name, app_type, package_title) pkg.install_list = install_list pkg.file_dict = file_dict pkg.folder_dict = folder_dict pkg.additional_installer_script = pkg_to_build.additional_installer_script pkg.primary_app_location = primary_app_location # Generate priv-app permissions whitelist if pkg.primary_app_location is not None and app_type == Constants.is_priv_app: permissions_list = cmd.get_white_list_permissions(primary_app_location) if permissions_list.__len__() >= 1 and not permissions_list[0].__contains__("Exception"): pkg.generate_priv_app_whitelist(app_set.title, permissions_list, Constants.source_directory) pkg.delete_rom_files_list = pkg_to_build.delete_rom_files_list # Add the deleted files from the pkg_to_build object for delete_file in pkg_to_build.delete_files_list: delete_files_list.append(delete_file) pkg.delete_files_list = delete_files_list package_list.append(pkg) if package_list.__len__() > 0: app_set_to_build = AppSet(app_set.title, package_list) app_set_list.append(app_set_to_build) return app_set_list