From d8a95a7a9c9b282fcaa2cf5de4251cb265bc0b6d Mon Sep 17 00:00:00 2001 From: DrDisagree Date: Thu, 10 Aug 2023 11:45:12 +0600 Subject: [PATCH] Improve overlay installation method --- .../drdisagree/iconify/utils/compiler/MonetCompiler.java | 7 ++++++- .../iconify/utils/compiler/OnDemandCompiler.java | 7 ++++++- .../iconify/utils/compiler/QsMarginCompiler.java | 7 ++++++- .../iconify/utils/compiler/QsTileHeightCompiler.java | 7 ++++++- .../iconify/utils/compiler/RoundnessCompiler.java | 7 ++++++- .../iconify/utils/compiler/SettingsIconsCompiler.java | 7 ++++++- .../drdisagree/iconify/utils/compiler/SwitchCompiler.java | 7 ++++++- 7 files changed, 42 insertions(+), 7 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 b389dd000..8f02749ae 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 @@ -95,7 +95,12 @@ private static void postExecute(boolean hasErroredOut) { if (!hasErroredOut) { Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponentME.apk " + Resources.OVERLAY_DIR + "/IconifyComponentME.apk").exec(); RootUtil.setPermissions(644, Resources.OVERLAY_DIR + "/IconifyComponentME.apk"); - Shell.cmd("pm install -r " + Resources.OVERLAY_DIR + "/IconifyComponentME.apk").exec(); + + // Move to files dir and install + Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponentME.apk " + Resources.DATA_DIR + "/IconifyComponentME.apk").exec(); + RootUtil.setPermissions(644, Resources.DATA_DIR + "/IconifyComponentME.apk"); + Shell.cmd("pm install -r " + Resources.DATA_DIR + "/IconifyComponentME.apk").exec(); + Shell.cmd("rm -rf " + Resources.DATA_DIR + "/IconifyComponentME.apk").exec(); SystemUtil.mountRW(); Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponentME.apk " + "/system/product/overlay/IconifyComponentME.apk").exec(); 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 ecdf80b4a..a622e8f7e 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 @@ -94,7 +94,12 @@ private static void postExecute(boolean hasErroredOut) { if (!hasErroredOut) { Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponent" + mOverlayName + ".apk " + Resources.OVERLAY_DIR + "/IconifyComponent" + mOverlayName + ".apk").exec(); RootUtil.setPermissions(644, Resources.OVERLAY_DIR + "/IconifyComponent" + mOverlayName + ".apk"); - Shell.cmd("pm install -r " + Resources.OVERLAY_DIR + "/IconifyComponent" + mOverlayName + ".apk").exec(); + + // Move to files dir and install + Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponent" + mOverlayName + ".apk " + Resources.DATA_DIR + "/IconifyComponent" + mOverlayName + ".apk").exec(); + RootUtil.setPermissions(644, Resources.DATA_DIR + "/IconifyComponent" + mOverlayName + ".apk"); + Shell.cmd("pm install -r " + Resources.DATA_DIR + "/IconifyComponent" + mOverlayName + ".apk").exec(); + Shell.cmd("rm -rf " + Resources.DATA_DIR + "/IconifyComponent" + mOverlayName + ".apk").exec(); SystemUtil.mountRW(); Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponent" + mOverlayName + ".apk " + "/system/product/overlay/IconifyComponent" + mOverlayName + ".apk").exec(); 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 7a36db69e..357426f4a 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 @@ -104,7 +104,12 @@ private static void postExecute(boolean hasErroredOut) { for (String overlayName : mOverlayName) { Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponent" + overlayName + ".apk " + Resources.OVERLAY_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); RootUtil.setPermissions(644, Resources.OVERLAY_DIR + "/IconifyComponent" + overlayName + ".apk"); - Shell.cmd("pm install -r " + Resources.OVERLAY_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); + + // Move to files dir and install + Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponent" + overlayName + ".apk " + Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); + RootUtil.setPermissions(644, Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk"); + Shell.cmd("pm install -r " + Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); + Shell.cmd("rm -rf " + Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); } SystemUtil.mountRW(); 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 124db28bc..98dad4270 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 @@ -95,7 +95,12 @@ private static void postExecute(boolean hasErroredOut) { if (!hasErroredOut) { Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponentQSTH.apk " + Resources.OVERLAY_DIR + "/IconifyComponentQSTH.apk").exec(); RootUtil.setPermissions(644, Resources.OVERLAY_DIR + "/IconifyComponentQSTH.apk"); - Shell.cmd("pm install -r " + Resources.OVERLAY_DIR + "/IconifyComponentQSTH.apk").exec(); + + // Move to files dir and install + Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponentQSTH.apk " + Resources.DATA_DIR + "/IconifyComponentQSTH.apk").exec(); + RootUtil.setPermissions(644, Resources.DATA_DIR + "/IconifyComponentQSTH.apk"); + Shell.cmd("pm install -r " + Resources.DATA_DIR + "/IconifyComponentQSTH.apk").exec(); + Shell.cmd("rm -rf " + Resources.DATA_DIR + "/IconifyComponentQSTH.apk").exec(); SystemUtil.mountRW(); Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponentQSTH.apk " + "/system/product/overlay/IconifyComponentQSTH.apk").exec(); 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 60084ea39..c33908fd0 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 @@ -104,7 +104,12 @@ private static void postExecute(boolean hasErroredOut) { for (String overlayName : mOverlayName) { Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponent" + overlayName + ".apk " + Resources.OVERLAY_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); RootUtil.setPermissions(644, Resources.OVERLAY_DIR + "/IconifyComponent" + overlayName + ".apk"); - Shell.cmd("pm install -r " + Resources.OVERLAY_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); + + // Move to files dir and install + Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponent" + overlayName + ".apk " + Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); + RootUtil.setPermissions(644, Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk"); + Shell.cmd("pm install -r " + Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); + Shell.cmd("rm -rf " + Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); } SystemUtil.mountRW(); 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 f84c1f56f..b6f70b946 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 @@ -113,7 +113,12 @@ private static void postExecute(boolean hasErroredOut) { for (int i = 1; i <= packages.length; i++) { Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponentSIP" + i + ".apk " + Resources.OVERLAY_DIR + "/IconifyComponentSIP" + i + ".apk").exec(); RootUtil.setPermissions(644, Resources.OVERLAY_DIR + "/IconifyComponentSIP" + i + ".apk"); - Shell.cmd("pm install -r " + Resources.OVERLAY_DIR + "/IconifyComponentSIP" + i + ".apk").exec(); + + // Move to files dir and install + Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponentSIP" + i + ".apk " + Resources.DATA_DIR + "/IconifyComponentSIP" + i + ".apk").exec(); + RootUtil.setPermissions(644, Resources.DATA_DIR + "/IconifyComponentSIP" + i + ".apk"); + Shell.cmd("pm install -r " + Resources.DATA_DIR + "/IconifyComponentSIP" + i + ".apk").exec(); + Shell.cmd("rm -rf " + Resources.DATA_DIR + "/IconifyComponentSIP" + i + ".apk").exec(); } SystemUtil.mountRW(); 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 7dad4570b..c1561b76d 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 @@ -101,7 +101,12 @@ private static void postExecute(boolean hasErroredOut) { for (String overlayName : mOverlayName) { Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponent" + overlayName + ".apk " + Resources.OVERLAY_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); RootUtil.setPermissions(644, Resources.OVERLAY_DIR + "/IconifyComponent" + overlayName + ".apk"); - Shell.cmd("pm install -r " + Resources.OVERLAY_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); + + // Move to files dir and install + Shell.cmd("cp -rf " + Resources.SIGNED_DIR + "/IconifyComponent" + overlayName + ".apk " + Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); + RootUtil.setPermissions(644, Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk"); + Shell.cmd("pm install -r " + Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); + Shell.cmd("rm -rf " + Resources.DATA_DIR + "/IconifyComponent" + overlayName + ".apk").exec(); } SystemUtil.mountRW();