Remove service and addond features

They will be reimplemented as install hook functions
gf-arm64
FriendlyNeighborhoodShane 4 years ago
parent 9701259b5b
commit f6f4e63f5b

@ -23,8 +23,6 @@ For making your own pack and config file, check custom-pack.md
- stuff_uninstall: Everything in this list is removed from system during a system installation and uninstallation. Should include everything in the pack, along with anything that used to be in it and anything that might be from alternative conflicting packs.
- stuff_debloat: Anything not from these packs that might conflict with it. For example GApps, other location providers, etc. They are removed (and backed up) during a system install and pseudo-debloated during a Magisk install.
- stuff_perm: Subdirectories of /system on which permission are to be applied in case of a system installation. This variable exists because perming the whole system takes too long.
- service (optional): The contents of what should be in service.sh in Magisk installations and init.d scripts in system installations.
- addond (optional): The contents of what should be in the addon.d scripts in system installations. No need for this on Magisk, since modules are already stored in data.
## Functions in defconf files

@ -55,10 +55,6 @@ NOTE: I only reccomend doing this if you're familiar with shell scripts. DO NOT
- We need to add permissions to the two files, so we add their respective directories to stuff_perm.
- A service/init.d script is not really useful to us for this package, so we leave it blank.
- While an addon.d script might be useful, I ommitted it for simplicity in this file.
- We don't have anything special to do with this package, so nothing in the build or install functions. But we don't remove the functions completely, that would cause an error.
There, we have the config file for our brand new AuroraServices pack!

@ -96,12 +96,6 @@ stuff_perm="
/system/priv-app/AuroraServices
";
service="
";
addond="
";
pre_build_actions() {
return 0;

@ -142,117 +142,6 @@ stuff_perm="
/system/priv-app/MicroGGMSCore
";
service='#!/system/bin/sh
# MinMicroG bootup script
{
sleep 30;
gms="$(find /system -name MicroGGMSCore.apk -type f | head -n1)";
for i in 1 2 3; do
# Fixes GMS permission troubles
/system/bin/pm install -r "$gms";
sleep 5;
# Grant permissions
npem;
sleep 5;
done;
}
';
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addonb='
log() { echo "$1"; }
log " ";
log "=== MinMicroG addon.d script ===";
[ -e "/system_root" ] && {
mount -o ro /system_root;
sysroot="system_root";
} || {
mount -o ro /system;
[ -e "/system/system/build.prop" ] && sysroot="system";
}
sdk="$(grep ro.build.version.sdk "/$sysroot/system/build.prop" | head -n1 | cut -d= -f2)";
backupdir="/data/media/0/MinMicroG/backups";
[ "$C" ] && tmpdir="$C" || tmpdir="/tmp/backupdir";
move() {
sourceobject="$1";
destobject="$2";
if [ "$sdk" -lt 21 ]; then
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$(dirname "$sourceobject")")/$(basename "$sourceobject")"; destobject="$(dirname "$(dirname "$destobject")")/$(basename "$destobject")"; }
fi;
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$sourceobject")"; destobject="$(dirname "$destobject")"; }
[ -e "$sourceobject" ] || return 0;
mkdir -p "$(dirname "$destobject")";
cp -rf "$sourceobject" "$(dirname "$destobject")/" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
[ -e "$destobject" ] && log "MOVER: Object moved ($sourceobject to $destobject)" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
rm -rf "$sourceobject" || { log "ERROR: Could not remove ($sourceobject)"; return 1; }
[ -e "$sourceobject" ] && { log "ERROR: Could not remove ($sourceobject)"; return 1; } || log "MOVER: Object removed ($sourceobject)";
}
perm_r() {
uid="$1";
gid="$2";
dmod="$3";
fmod="$4";
dir="$5";
[ -d "$dir" ] || return 0;
chown -R $uid:$gid "$dir" || chown -R $uid.$gid "$dir";
find "$dir" -type d -exec chmod $dmod {} +;
find "$dir" -type f -exec chmod $fmod {} +;
}
case "$1" in
backup)
log " ";
log "Backing up...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$tmpdir/$object";
done;
;;
restore)
log " ";
log "Restoring...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "$tmpdir/$object" "/$sysroot/$object";
done;
;;
post-restore)
log " ";
log "Debloating...";
mount /data;
delete_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$backupdir/$object";
done;
[ -d "$backupdir" ] && { perm_r 1023 1023 775 664 "$backupdir"; chcon -hR "u:object_r:media_rw_data_file:s0" "$backupdir"; }
;;
esac;
';
addond="$addona $addonb";
pre_build_actions() {
return 0;
@ -342,25 +231,6 @@ user_conf() {
";
stuff_arch_sdk="$(echo "$stuff_arch_sdk" | sed 's| |\n|g' | tr -s '\n' | sort -u | sed 's|^| |g')
";
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addond="$addona$addonb";
}
[ "$stuff" ] || [ "$stuff_arch" ] || [ "$stuff_sdk" ] || [ "$stuff_arch_sdk" ] || abort "Nothing left to install after config";

@ -142,117 +142,6 @@ stuff_perm="
/system/priv-app/MicroGGMSCore
";
service='#!/system/bin/sh
# MinMicroG bootup script
{
sleep 30;
gms="$(find /system -name MicroGGMSCore.apk -type f | head -n1)";
for i in 1 2 3; do
# Fixes GMS permission troubles
/system/bin/pm install -r "$gms";
sleep 5;
# Grant permissions
npem;
sleep 5;
done;
}
';
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addonb='
log() { echo "$1"; }
log " ";
log "=== MinMicroG addon.d script ===";
[ -e "/system_root" ] && {
mount -o ro /system_root;
sysroot="system_root";
} || {
mount -o ro /system;
[ -e "/system/system/build.prop" ] && sysroot="system";
}
sdk="$(grep ro.build.version.sdk "/$sysroot/system/build.prop" | head -n1 | cut -d= -f2)";
backupdir="/data/media/0/MinMicroG/backups";
[ "$C" ] && tmpdir="$C" || tmpdir="/tmp/backupdir";
move() {
sourceobject="$1";
destobject="$2";
if [ "$sdk" -lt 21 ]; then
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$(dirname "$sourceobject")")/$(basename "$sourceobject")"; destobject="$(dirname "$(dirname "$destobject")")/$(basename "$destobject")"; }
fi;
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$sourceobject")"; destobject="$(dirname "$destobject")"; }
[ -e "$sourceobject" ] || return 0;
mkdir -p "$(dirname "$destobject")";
cp -rf "$sourceobject" "$(dirname "$destobject")/" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
[ -e "$destobject" ] && log "MOVER: Object moved ($sourceobject to $destobject)" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
rm -rf "$sourceobject" || { log "ERROR: Could not remove ($sourceobject)"; return 1; }
[ -e "$sourceobject" ] && { log "ERROR: Could not remove ($sourceobject)"; return 1; } || log "MOVER: Object removed ($sourceobject)";
}
perm_r() {
uid="$1";
gid="$2";
dmod="$3";
fmod="$4";
dir="$5";
[ -d "$dir" ] || return 0;
chown -R $uid:$gid "$dir" || chown -R $uid.$gid "$dir";
find "$dir" -type d -exec chmod $dmod {} +;
find "$dir" -type f -exec chmod $fmod {} +;
}
case "$1" in
backup)
log " ";
log "Backing up...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$tmpdir/$object";
done;
;;
restore)
log " ";
log "Restoring...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "$tmpdir/$object" "/$sysroot/$object";
done;
;;
post-restore)
log " ";
log "Debloating...";
mount /data;
delete_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$backupdir/$object";
done;
[ -d "$backupdir" ] && { perm_r 1023 1023 775 664 "$backupdir"; chcon -hR "u:object_r:media_rw_data_file:s0" "$backupdir"; }
;;
esac;
';
addond="$addona $addonb";
pre_build_actions() {
return 0;
@ -342,25 +231,6 @@ user_conf() {
";
stuff_arch_sdk="$(echo "$stuff_arch_sdk" | sed 's| |\n|g' | tr -s '\n' | sort -u | sed 's|^| |g')
";
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addond="$addona$addonb";
}
[ "$stuff" ] || [ "$stuff_arch" ] || [ "$stuff_sdk" ] || [ "$stuff_arch_sdk" ] || abort "Nothing left to install after config";

@ -151,117 +151,6 @@ stuff_perm="
/system/priv-app/MicroGGMSCore
";
service='#!/system/bin/sh
# MinMicroG bootup script
{
sleep 30;
gms="$(find /system -name MicroGGMSCore.apk -type f | head -n1)";
for i in 1 2 3; do
# Fixes GMS permission troubles
/system/bin/pm install -r "$gms";
sleep 5;
# Grant permissions
npem;
sleep 5;
done;
}
';
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addonb='
log() { echo "$1"; }
log " ";
log "=== MinMicroG addon.d script ===";
[ -e "/system_root" ] && {
mount -o ro /system_root;
sysroot="system_root";
} || {
mount -o ro /system;
[ -e "/system/system/build.prop" ] && sysroot="system";
}
sdk="$(grep ro.build.version.sdk "/$sysroot/system/build.prop" | head -n1 | cut -d= -f2)";
backupdir="/data/media/0/MinMicroG/backups";
[ "$C" ] && tmpdir="$C" || tmpdir="/tmp/backupdir";
move() {
sourceobject="$1";
destobject="$2";
if [ "$sdk" -lt 21 ]; then
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$(dirname "$sourceobject")")/$(basename "$sourceobject")"; destobject="$(dirname "$(dirname "$destobject")")/$(basename "$destobject")"; }
fi;
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$sourceobject")"; destobject="$(dirname "$destobject")"; }
[ -e "$sourceobject" ] || return 0;
mkdir -p "$(dirname "$destobject")";
cp -rf "$sourceobject" "$(dirname "$destobject")/" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
[ -e "$destobject" ] && log "MOVER: Object moved ($sourceobject to $destobject)" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
rm -rf "$sourceobject" || { log "ERROR: Could not remove ($sourceobject)"; return 1; }
[ -e "$sourceobject" ] && { log "ERROR: Could not remove ($sourceobject)"; return 1; } || log "MOVER: Object removed ($sourceobject)";
}
perm_r() {
uid="$1";
gid="$2";
dmod="$3";
fmod="$4";
dir="$5";
[ -d "$dir" ] || return 0;
chown -R $uid:$gid "$dir" || chown -R $uid.$gid "$dir";
find "$dir" -type d -exec chmod $dmod {} +;
find "$dir" -type f -exec chmod $fmod {} +;
}
case "$1" in
backup)
log " ";
log "Backing up...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$tmpdir/$object";
done;
;;
restore)
log " ";
log "Restoring...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "$tmpdir/$object" "/$sysroot/$object";
done;
;;
post-restore)
log " ";
log "Debloating...";
mount /data;
delete_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$backupdir/$object";
done;
[ -d "$backupdir" ] && { perm_r 1023 1023 775 664 "$backupdir"; chcon -hR "u:object_r:media_rw_data_file:s0" "$backupdir"; }
;;
esac;
';
addond="$addona $addonb";
pre_build_actions() {
return 0;
@ -351,25 +240,6 @@ user_conf() {
";
stuff_arch_sdk="$(echo "$stuff_arch_sdk" | sed 's| |\n|g' | tr -s '\n' | sort -u | sed 's|^| |g')
";
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addond="$addona$addonb";
}
[ "$stuff" ] || [ "$stuff_arch" ] || [ "$stuff_sdk" ] || [ "$stuff_arch_sdk" ] || abort "Nothing left to install after config";

@ -157,117 +157,6 @@ stuff_perm="
/system/lib64/libjni_latinimegoogle.so
";
service='#!/system/bin/sh
# MinMicroG bootup script
{
sleep 30;
gms="$(find /system -name MicroGGMSCore.apk -type f | head -n1)";
for i in 1 2 3; do
# Fixes GMS permission troubles
/system/bin/pm install -r "$gms";
sleep 5;
# Grant permissions
npem;
sleep 5;
done;
}
';
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addonb='
log() { echo "$1"; }
log " ";
log "=== MinMicroG addon.d script ===";
[ -e "/system_root" ] && {
mount -o ro /system_root;
sysroot="system_root";
} || {
mount -o ro /system;
[ -e "/system/system/build.prop" ] && sysroot="system";
}
sdk="$(grep ro.build.version.sdk "/$sysroot/system/build.prop" | head -n1 | cut -d= -f2)";
backupdir="/data/media/0/MinMicroG/backups";
[ "$C" ] && tmpdir="$C" || tmpdir="/tmp/backupdir";
move() {
sourceobject="$1";
destobject="$2";
if [ "$sdk" -lt 21 ]; then
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$(dirname "$sourceobject")")/$(basename "$sourceobject")"; destobject="$(dirname "$(dirname "$destobject")")/$(basename "$destobject")"; }
fi;
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$sourceobject")"; destobject="$(dirname "$destobject")"; }
[ -e "$sourceobject" ] || return 0;
mkdir -p "$(dirname "$destobject")";
cp -rf "$sourceobject" "$(dirname "$destobject")/" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
[ -e "$destobject" ] && log "MOVER: Object moved ($sourceobject to $destobject)" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
rm -rf "$sourceobject" || { log "ERROR: Could not remove ($sourceobject)"; return 1; }
[ -e "$sourceobject" ] && { log "ERROR: Could not remove ($sourceobject)"; return 1; } || log "MOVER: Object removed ($sourceobject)";
}
perm_r() {
uid="$1";
gid="$2";
dmod="$3";
fmod="$4";
dir="$5";
[ -d "$dir" ] || return 0;
chown -R $uid:$gid "$dir" || chown -R $uid.$gid "$dir";
find "$dir" -type d -exec chmod $dmod {} +;
find "$dir" -type f -exec chmod $fmod {} +;
}
case "$1" in
backup)
log " ";
log "Backing up...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$tmpdir/$object";
done;
;;
restore)
log " ";
log "Restoring...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "$tmpdir/$object" "/$sysroot/$object";
done;
;;
post-restore)
log " ";
log "Debloating...";
mount /data;
delete_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$backupdir/$object";
done;
[ -d "$backupdir" ] && { perm_r 1023 1023 775 664 "$backupdir"; chcon -hR "u:object_r:media_rw_data_file:s0" "$backupdir"; }
;;
esac;
';
addond="$addona$addonb";
pre_build_actions() {
return 0;
@ -357,25 +246,6 @@ user_conf() {
";
stuff_arch_sdk="$(echo "$stuff_arch_sdk" | sed 's| |\n|g' | tr -s '\n' | sort -u | sed 's|^| |g')
";
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addond="$addona$addonb";
}
[ "$stuff" ] || [ "$stuff_arch" ] || [ "$stuff_sdk" ] || [ "$stuff_arch_sdk" ] || abort "Nothing left to install after config";

@ -125,101 +125,6 @@ stuff_perm="
/system/priv-app/MicroGUNLP
";
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addonb='
log() { echo "$1"; }
log " ";
log "=== MinMicroG addon.d script ===";
[ -e "/system_root" ] && {
mount -o ro /system_root;
sysroot="system_root";
} || {
mount -o ro /system;
[ -e "/system/system/build.prop" ] && sysroot="system";
}
sdk="$(grep ro.build.version.sdk "/$sysroot/system/build.prop" | head -n1 | cut -d= -f2)";
backupdir="/data/media/0/MinMicroG/backups";
[ "$C" ] && tmpdir="$C" || tmpdir="/tmp/backupdir";
move() {
sourceobject="$1";
destobject="$2";
if [ "$sdk" -lt 21 ]; then
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$(dirname "$sourceobject")")/$(basename "$sourceobject")"; destobject="$(dirname "$(dirname "$destobject")")/$(basename "$destobject")"; }
fi;
[ "$(basename "$(dirname "$sourceobject")").apk" == "$(basename "$sourceobject")" ] && { sourceobject="$(dirname "$sourceobject")"; destobject="$(dirname "$destobject")"; }
[ -e "$sourceobject" ] || return 0;
mkdir -p "$(dirname "$destobject")";
cp -rf "$sourceobject" "$(dirname "$destobject")/" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
[ -e "$destobject" ] && log "MOVER: Object moved ($sourceobject to $destobject)" || { log "ERROR: Could not move ($sourceobject to $destobject)"; return 1; }
rm -rf "$sourceobject" || { log "ERROR: Could not remove ($sourceobject)"; return 1; }
[ -e "$sourceobject" ] && { log "ERROR: Could not remove ($sourceobject)"; return 1; } || log "MOVER: Object removed ($sourceobject)";
}
perm_r() {
uid="$1";
gid="$2";
dmod="$3";
fmod="$4";
dir="$5";
[ -d "$dir" ] || return 0;
chown -R $uid:$gid "$dir" || chown -R $uid.$gid "$dir";
find "$dir" -type d -exec chmod $dmod {} +;
find "$dir" -type f -exec chmod $fmod {} +;
}
case "$1" in
backup)
log " ";
log "Backing up...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$tmpdir/$object";
done;
;;
restore)
log " ";
log "Restoring...";
save_files | while read object dummy; do
[ "$object" ] || continue;
move "$tmpdir/$object" "/$sysroot/$object";
done;
;;
post-restore)
log " ";
log "Debloating...";
mount /data;
delete_files | while read object dummy; do
[ "$object" ] || continue;
move "/$sysroot/$object" "$backupdir/$object";
done;
[ -d "$backupdir" ] && { perm_r 1023 1023 775 664 "$backupdir"; chcon -hR "u:object_r:media_rw_data_file:s0" "$backupdir"; }
;;
esac;
';
addond="$addona $addonb";
pre_build_actions() {
return 0;
@ -309,25 +214,6 @@ user_conf() {
";
stuff_arch_sdk="$(echo "$stuff_arch_sdk" | sed 's| |\n|g' | tr -s '\n' | sort -u | sed 's|^| |g')
";
addona="#!/sbin/sh
#
# MinMicroG addon.d
save_files() {
cat <<EOF
$(echo "$stuff" "$stuff_arch" "$stuff_sdk" "$stuff_arch_sdk" "$initdfile" "$addondfile" "/system/etc/.mmg" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
delete_files() {
cat <<EOF
$(echo "$stuff_debloat" | sed 's| |\n|g' | sort -u | tr -s '\n')
EOF
}
";
addond="$addona$addonb";
}
[ "$stuff" ] || [ "$stuff_arch" ] || [ "$stuff_sdk" ] || [ "$stuff_arch_sdk" ] || abort "Nothing left to install after config";

@ -37,12 +37,6 @@ stuff_debloat="
stuff_perm="
";
addond="
";
service="
";
pre_build_actions() {
return 0;

@ -310,11 +310,9 @@ uninstall_pack() {
if [ "$magisk" = "yes" ]; then
rm -rf "$root" || { log " "; log "Could not delete Magisk root ($root)"; }
elif [ "$magisk" = "no" ]; then
for thing in $stuff_uninstall $initdfile $addondfile; do
for thing in $stuff_uninstall; do
[ "$thing" ] && uninstall "$root/$thing";
done;
uninstall "$initdfile";
uninstall "$addondfile";
fi;
}
@ -339,8 +337,6 @@ chmod +x "$filedir/defconf";
moddir="/data/media/0/$modname";
backupdir="$moddir/Backup";
initdfile="/system/etc/init.d/10-$modname";
addondfile="/system/addon.d/10-$modname.sh";
ui_print " ";
ui_print "Package: $variant";
@ -463,7 +459,6 @@ if [ "$action" = "installation" ]; then
log " ";
log "Executing other actions";
if [ "$magisk" = "yes" ]; then
[ "$service" ] && { echo "$service" > "$root/service.sh" || abort "Could not create service.sh in $root"; }
[ "$modprop" ] && { echo "$modprop" > "$root/module.prop" || abort "Could not create module.prop in $root"; }
touch "$root/auto_mount" || abort "Could not create auto_mount in $root";
if $bootmode && [ "$modulesdir" = "/data/adb/modules_update" ]; then
@ -472,21 +467,16 @@ if [ "$action" = "installation" ]; then
touch "$modmnt/$modname/update" || abort "Could not create update in $modmnt/$modname";
[ "$modprop" ] && { echo "$modprop" > "$modmnt/$modname/module.prop" || abort "Could not create module.prop in $modmnt/$modname"; }
fi;
elif [ "$magisk" = "no" ]; then
[ "$service" ] && { mkdir -p "$(dirname "$root/$initdfile")"; echo "$service" > "$root/$initdfile" || abort "Could not create $initdfile in $root"; }
[ "$addond" ] && { mkdir -p "$(dirname "$root/$addondfile")"; echo "$addond" > "$root/$addondfile" || abort "Could not create $addondfile in $root"; }
fi;
ui_print " ";
ui_print "Setting permissions...";
if [ "$magisk" = "yes" ]; then
find "$root" -maxdepth 1 -exec chmod 0755 {} +;
[ -f "$root/post-fs-data.sh" ] && chmod 0777 "$root/post-fs-data.sh";
[ -f "$root/service.sh" ] && chmod 0777 "$root/service.sh";
fi;
for thing in $stuff_perm $initdfile $addondfile; do
for thing in $stuff_perm; do
case "$thing" in
*/bin*|*/xbin*|*/etc/init.d*)
*/bin*|*/xbin*)
perm 0 2000 0755 0777 "$root/$thing";
;;
*)

Loading…
Cancel
Save