Sha256: 62e97f114940c72f87b63f8d7a320c3d0e9f1081b9c475584813552358b51564

Contents?: true

Size: 882 Bytes

Versions: 13

Compression:

Stored size: 882 Bytes

Contents

class AndroidManifestSwitcher
    def initialize
    end

    def switch(config)
        Solara.logger.start_step("Switch AndroidManifest")
        manifest_file = FilePath.android_manifest
        if File.exist?(manifest_file)
            manifest_content = File.read(manifest_file)
            updated_manifest = update_app_name(manifest_content, config)
            File.write(manifest_file, updated_manifest)
            Solara.logger.debug("Updated #{FilePath.android_manifest} to use string resource for app name")
        else
            Solara.logger.debug("❌ #{FilePath.android_manifest} not found. Skipping manifest update.")
        end
        Solara.logger.end_step("Switch AndroidManifest")
    end

    private

    def update_app_name(manifest_content, config)
        manifest_content.gsub(/android:label="[^"]+"/, 'android:label="@string/app_name"')
    end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
solara-0.7.4 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.7.3 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.7.2 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.7.1 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.7.0 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.6.0 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.5.0 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.4.0 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.3.0 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.2.4 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.2.3 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.2.2 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
solara-0.2.1 solara/lib/core/scripts/platform/android/android_manifest_switcher.rb