Пример #1
0
 def get_lawnchair():
     lawnchair_set = AppSet("Lawnchair")
     from Config import TARGET_ANDROID_VERSION
     if TARGET_ANDROID_VERSION == 10:
         lawnchair_ci = Package("Lawnchair", "ch.deletescape.lawnchair.ci",
                                Constants.is_priv_app)
         lawnchair_ci.delete("Lawnchair")
         lawnchair_ci.delete("Lawnfeed")
         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",
                             Constants.is_priv_app)
         lawnchair.delete("Lawnchair")
         lawnchair.delete("Lawnfeed")
         lawnchair_set.add_package(lawnchair)
     lawnfeed = Package("Lawnfeed", "ch.deletescape.lawnchair.lawnfeed",
                        Constants.is_system_app)
     lawnchair_set.add_package(lawnfeed)
     return lawnchair_set
Пример #2
0
    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
Пример #3
0
    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" >> $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!"
                        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!"
                        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!"
                                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!"
                                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("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!\"
        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!\"
    else
        addToLog "- Battery Optimization not Enabled"
    fi
        """
        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)

        vanced_manager = Package("VancedManager", "com.vanced.manager",
                                 Constants.is_system_app)
        vanced_manager.enabled = 0
        core_go.add_package(vanced_manager)

        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