diff --git a/common.gradle b/common.gradle index 5463638ae..903d0d593 100644 --- a/common.gradle +++ b/common.gradle @@ -34,6 +34,7 @@ android { manifestPlaceholders = [ appName : "Tachiyomi: $extName", extClass: extClass, + extFactory: project.ext.properties.getOrDefault("extFactory", ""), nsfw: project.ext.properties.getOrDefault("containsNsfw", false) ? 1 : 0, ] } diff --git a/core/AndroidManifest.xml b/core/AndroidManifest.xml index 3b92e1e2e..42882ce0e 100644 --- a/core/AndroidManifest.xml +++ b/core/AndroidManifest.xml @@ -7,6 +7,7 @@ + diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/ThemeSourceGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/ThemeSourceGenerator.kt index 59ed75db6..1e08d20ab 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/ThemeSourceGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/ThemeSourceGenerator.kt @@ -49,7 +49,7 @@ interface ThemeSourceGenerator { return listOf("eu", "kanade", "tachiyomi", "multisrc", themePkg).joinToString(separator) } - private fun writeGradle(gradle: File, source: ThemeSourceData, baseVersionCode: Int) { + private fun writeGradle(gradle: File, source: ThemeSourceData, themePkg: String, baseVersionCode: Int) { gradle.writeText(""" // THIS FILE IS AUTO-GENERATED; DO NOT EDIT apply plugin: 'com.android.application' @@ -59,6 +59,7 @@ interface ThemeSourceGenerator { extName = '${source.name}' pkgNameSuffix = '${pkgNameSuffix(source, ".")}' extClass = '.${source.className}' + extFactory = '$themePkg' extVersionCode = ${baseVersionCode + source.overrideVersionCode + multisrcLibraryVersion} libVersion = '1.2' ${if (source.isNsfw) "containsNsfw = true\n" else ""} @@ -98,7 +99,7 @@ interface ThemeSourceGenerator { // remove everything from past runs cleanDirectory(projectRootFile) - writeGradle(projectGradleFile, source, baseVersionCode) + writeGradle(projectGradleFile, source, themePkg, baseVersionCode) writeAndroidManifest(projectAndroidManifestFile, manifestOverridesPath) writeSourceClasses(projectSrcPath, srcOverridesPath, source, themePkg, themeClass)