From 37d07afc6ed267634f98d948a1801de8776c5220 Mon Sep 17 00:00:00 2001 From: DrDisagree Date: Mon, 25 Sep 2023 17:36:04 +0600 Subject: [PATCH] Overlay Compilers: Add min and target SDK --- .../iconify/utils/compiler/MonetCompiler.java | 12 +++++++++++- .../iconify/utils/compiler/OnBoardingCompiler.java | 12 +++++++++++- .../iconify/utils/compiler/OnDemandCompiler.java | 12 +++++++++++- .../iconify/utils/compiler/QsMarginCompiler.java | 12 +++++++++++- .../iconify/utils/compiler/QsTileHeightCompiler.java | 12 +++++++++++- .../iconify/utils/compiler/RoundnessCompiler.java | 12 +++++++++++- .../utils/compiler/SettingsIconsCompiler.java | 12 +++++++++++- .../iconify/utils/compiler/SwitchCompiler.java | 12 +++++++++++- .../iconify/utils/compiler/VolumeCompiler.java | 12 +++++++++++- 9 files changed, 99 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/drdisagree/iconify/utils/compiler/MonetCompiler.java b/app/src/main/java/com/drdisagree/iconify/utils/compiler/MonetCompiler.java index 654b2cbfe..589f4b9c1 100644 --- a/app/src/main/java/com/drdisagree/iconify/utils/compiler/MonetCompiler.java +++ b/app/src/main/java/com/drdisagree/iconify/utils/compiler/MonetCompiler.java @@ -14,6 +14,8 @@ import com.topjohnwu.superuser.Shell; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; public class MonetCompiler { @@ -125,7 +127,15 @@ private static void postExecute(boolean hasErroredOut) { } private static boolean createManifest(String pkgName, String source) { - Shell.Result result = Shell.cmd("printf '\\n\\n\\t\\n\\t\\n' > " + source + "/AndroidManifest.xml;").exec(); + List module = new ArrayList<>(); + module.add("printf '"); + module.add(""); + module.add("\\t"); + module.add("\\t"); + module.add("\\t"); + module.add("' > " + source + "/AndroidManifest.xml;"); + + Shell.Result result = Shell.cmd(String.join("\\n", module)).exec(); if (result.isSuccess()) Log.i(TAG + " - Manifest", "Successfully created manifest for " + pkgName); diff --git a/app/src/main/java/com/drdisagree/iconify/utils/compiler/OnBoardingCompiler.java b/app/src/main/java/com/drdisagree/iconify/utils/compiler/OnBoardingCompiler.java index f70577a48..4011ee908 100644 --- a/app/src/main/java/com/drdisagree/iconify/utils/compiler/OnBoardingCompiler.java +++ b/app/src/main/java/com/drdisagree/iconify/utils/compiler/OnBoardingCompiler.java @@ -19,6 +19,8 @@ import java.nio.file.Paths; import java.security.PrivateKey; import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; public class OnBoardingCompiler { @@ -32,7 +34,15 @@ public static boolean createManifest(String name, String target, String source) int attempt = 3; while (attempt-- != 0) { - result = Shell.cmd("printf '\\n\\n\\t\\n\\t\\n' > " + source + "/AndroidManifest.xml;").exec(); + List module = new ArrayList<>(); + module.add("printf '"); + module.add(""); + module.add("\\t"); + module.add("\\t"); + module.add("\\t"); + module.add("' > " + source + "/AndroidManifest.xml;"); + + result = Shell.cmd(String.join("\\n", module)).exec(); if (result.isSuccess()) { Log.i(TAG + " - Manifest", "Successfully created manifest for " + name); diff --git a/app/src/main/java/com/drdisagree/iconify/utils/compiler/OnDemandCompiler.java b/app/src/main/java/com/drdisagree/iconify/utils/compiler/OnDemandCompiler.java index e56b36c11..ae28d9053 100644 --- a/app/src/main/java/com/drdisagree/iconify/utils/compiler/OnDemandCompiler.java +++ b/app/src/main/java/com/drdisagree/iconify/utils/compiler/OnDemandCompiler.java @@ -13,6 +13,8 @@ import com.topjohnwu.superuser.Shell; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; public class OnDemandCompiler { @@ -128,7 +130,15 @@ private static void moveOverlaysToCache() { } private static boolean createManifest(String overlayName, String source) { - Shell.Result result = Shell.cmd("printf '\\n\\n\\t\\n\\t\\n' > " + source + "/AndroidManifest.xml;").exec(); + List module = new ArrayList<>(); + module.add("printf '"); + module.add(""); + module.add("\\t"); + module.add("\\t"); + module.add("\\t"); + module.add("' > " + source + "/AndroidManifest.xml;"); + + Shell.Result result = Shell.cmd(String.join("\\n", module)).exec(); if (result.isSuccess()) Log.i(TAG + " - Manifest", "Successfully created manifest for " + overlayName); diff --git a/app/src/main/java/com/drdisagree/iconify/utils/compiler/QsMarginCompiler.java b/app/src/main/java/com/drdisagree/iconify/utils/compiler/QsMarginCompiler.java index dc3235a36..db00a7c6a 100644 --- a/app/src/main/java/com/drdisagree/iconify/utils/compiler/QsMarginCompiler.java +++ b/app/src/main/java/com/drdisagree/iconify/utils/compiler/QsMarginCompiler.java @@ -15,6 +15,8 @@ import com.topjohnwu.superuser.Shell; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; public class QsMarginCompiler { @@ -145,7 +147,15 @@ private static void postExecute(boolean hasErroredOut) { } private static boolean createManifest(String pkgName, String source, String target) { - Shell.Result result = Shell.cmd("printf '\\n\\n\\t\\n\\t\\n' > " + source + "/AndroidManifest.xml;").exec(); + List module = new ArrayList<>(); + module.add("printf '"); + module.add(""); + module.add("\\t"); + module.add("\\t"); + module.add("\\t"); + module.add("' > " + source + "/AndroidManifest.xml;"); + + Shell.Result result = Shell.cmd(String.join("\\n", module)).exec(); if (result.isSuccess()) Log.i(TAG + " - Manifest", "Successfully created manifest for " + pkgName); diff --git a/app/src/main/java/com/drdisagree/iconify/utils/compiler/QsTileHeightCompiler.java b/app/src/main/java/com/drdisagree/iconify/utils/compiler/QsTileHeightCompiler.java index dbf4cfcc8..b110f4e56 100644 --- a/app/src/main/java/com/drdisagree/iconify/utils/compiler/QsTileHeightCompiler.java +++ b/app/src/main/java/com/drdisagree/iconify/utils/compiler/QsTileHeightCompiler.java @@ -14,6 +14,8 @@ import com.topjohnwu.superuser.Shell; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; public class QsTileHeightCompiler { @@ -125,7 +127,15 @@ private static void postExecute(boolean hasErroredOut) { } private static boolean createManifest(String pkgName, String source) { - Shell.Result result = Shell.cmd("printf '\\n\\n\\t\\n\\t\\n' > " + source + "/AndroidManifest.xml;").exec(); + List module = new ArrayList<>(); + module.add("printf '"); + module.add(""); + module.add("\\t"); + module.add("\\t"); + module.add("\\t"); + module.add("' > " + source + "/AndroidManifest.xml;"); + + Shell.Result result = Shell.cmd(String.join("\\n", module)).exec(); if (result.isSuccess()) Log.i(TAG + " - Manifest", "Successfully created manifest for " + pkgName); diff --git a/app/src/main/java/com/drdisagree/iconify/utils/compiler/RoundnessCompiler.java b/app/src/main/java/com/drdisagree/iconify/utils/compiler/RoundnessCompiler.java index 618400b8d..520aac902 100644 --- a/app/src/main/java/com/drdisagree/iconify/utils/compiler/RoundnessCompiler.java +++ b/app/src/main/java/com/drdisagree/iconify/utils/compiler/RoundnessCompiler.java @@ -15,6 +15,8 @@ import com.topjohnwu.superuser.Shell; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; public class RoundnessCompiler { @@ -145,7 +147,15 @@ private static void postExecute(boolean hasErroredOut) { } private static boolean createManifest(String pkgName, String source, String target) { - Shell.Result result = Shell.cmd("printf '\\n\\n\\t\\n\\t\\n' > " + source + "/AndroidManifest.xml;").exec(); + List module = new ArrayList<>(); + module.add("printf '"); + module.add(""); + module.add("\\t"); + module.add("\\t"); + module.add("\\t"); + module.add("' > " + source + "/AndroidManifest.xml;"); + + Shell.Result result = Shell.cmd(String.join("\\n", module)).exec(); if (result.isSuccess()) Log.i(TAG + " - Manifest", "Successfully created manifest for " + pkgName); diff --git a/app/src/main/java/com/drdisagree/iconify/utils/compiler/SettingsIconsCompiler.java b/app/src/main/java/com/drdisagree/iconify/utils/compiler/SettingsIconsCompiler.java index 33db7f4c9..b08ca0413 100644 --- a/app/src/main/java/com/drdisagree/iconify/utils/compiler/SettingsIconsCompiler.java +++ b/app/src/main/java/com/drdisagree/iconify/utils/compiler/SettingsIconsCompiler.java @@ -13,6 +13,8 @@ import com.topjohnwu.superuser.Shell; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; public class SettingsIconsCompiler { @@ -171,7 +173,15 @@ private static void moveOverlaysToCache() { } private static boolean createManifest(String overlayName, String pkgName, String source) { - Shell.Result result = Shell.cmd("printf '\\n\\n\\t\\n\\t\\n' > " + source + "/AndroidManifest.xml;").exec(); + List module = new ArrayList<>(); + module.add("printf '"); + module.add(""); + module.add("\\t"); + module.add("\\t"); + module.add("\\t"); + module.add("' > " + source + "/AndroidManifest.xml;"); + + Shell.Result result = Shell.cmd(String.join("\\n", module)).exec(); if (result.isSuccess()) Log.i(TAG + " - Manifest", "Successfully created manifest for " + pkgName); diff --git a/app/src/main/java/com/drdisagree/iconify/utils/compiler/SwitchCompiler.java b/app/src/main/java/com/drdisagree/iconify/utils/compiler/SwitchCompiler.java index 576db359b..32aebf69a 100644 --- a/app/src/main/java/com/drdisagree/iconify/utils/compiler/SwitchCompiler.java +++ b/app/src/main/java/com/drdisagree/iconify/utils/compiler/SwitchCompiler.java @@ -13,6 +13,8 @@ import com.topjohnwu.superuser.Shell; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; public class SwitchCompiler { @@ -148,7 +150,15 @@ private static void moveOverlaysToCache() { } private static boolean createManifest(String overlayName, String mPackage, String source) { - Shell.Result result = Shell.cmd("printf '\\n\\n\\t\\n\\t\\n' > " + source + "/AndroidManifest.xml;").exec(); + List module = new ArrayList<>(); + module.add("printf '"); + module.add(""); + module.add("\\t"); + module.add("\\t"); + module.add("\\t"); + module.add("' > " + source + "/AndroidManifest.xml;"); + + Shell.Result result = Shell.cmd(String.join("\\n", module)).exec(); if (result.isSuccess()) Log.i(TAG + " - Manifest", "Successfully created manifest for " + overlayName); diff --git a/app/src/main/java/com/drdisagree/iconify/utils/compiler/VolumeCompiler.java b/app/src/main/java/com/drdisagree/iconify/utils/compiler/VolumeCompiler.java index 6e0ef1512..a38c08d88 100644 --- a/app/src/main/java/com/drdisagree/iconify/utils/compiler/VolumeCompiler.java +++ b/app/src/main/java/com/drdisagree/iconify/utils/compiler/VolumeCompiler.java @@ -17,6 +17,8 @@ import java.io.File; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; public class VolumeCompiler { @@ -123,7 +125,15 @@ private static void postExecute(boolean hasErroredOut) throws Exception { } private static boolean createManifest(String pkgName, String target, String source) { - Shell.Result result = Shell.cmd("printf '\\n\\n\\t\\n\\t\\n' > " + source + "/AndroidManifest.xml;").exec(); + List module = new ArrayList<>(); + module.add("printf '"); + module.add(""); + module.add("\\t"); + module.add("\\t"); + module.add("\\t"); + module.add("' > " + source + "/AndroidManifest.xml;"); + + Shell.Result result = Shell.cmd(String.join("\\n", module)).exec(); if (result.isSuccess()) Log.i(TAG + " - Manifest", "Successfully created manifest for " + pkgName);