-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unica: patches: move to new Magisk module-like structure
Change-Id: Ibaed2e15c9cc8a9ea2c353681740d31e3d278d9e
- Loading branch information
1 parent
98b0a40
commit aef1a5a
Showing
32 changed files
with
127 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id=floating_feature | ||
name=floating_feature.xml patches | ||
author=BlackMesa123 | ||
description=Reads target "sff.sh" config and applies all the changes in floating_feature. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
SKIPUNZIP=1 | ||
|
||
REMOVE_FROM_WORK_DIR() | ||
{ | ||
local FILE_PATH="$1" | ||
|
||
if [ -e "$FILE_PATH" ]; then | ||
local FILE | ||
local PARTITION | ||
FILE="$(echo -n "$FILE_PATH" | sed "s.$WORK_DIR/..")" | ||
PARTITION="$(echo -n "$FILE" | cut -d "/" -f 1)" | ||
|
||
rm -rf "$FILE_PATH" | ||
|
||
FILE="$(echo -n "$FILE" | sed 's/\//\\\//g')" | ||
sed -i "/$FILE/d" "$WORK_DIR/configs/fs_config-$PARTITION" | ||
|
||
FILE="$(echo -n "$FILE" | sed 's/\./\\./g')" | ||
sed -i "/$FILE/d" "$WORK_DIR/configs/file_context-$PARTITION" | ||
fi | ||
} | ||
|
||
REMOVE_FROM_WORK_DIR "$WORK_DIR/system/system/etc/permissions/privapp-permissions-com.samsung.android.kgclient.xml" | ||
REMOVE_FROM_WORK_DIR "$WORK_DIR/system/system/priv-app/KnoxGuard" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id=knoxguard | ||
name=Disable KnoxGuard | ||
author=BlackMesa123 | ||
description= |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
SKIPUNZIP=1 | ||
|
||
set -Eeo pipefail | ||
|
||
trap "echo 'Failed to apply'" ERR | ||
|
||
APPLY_PATCHES() | ||
{ | ||
local TARGET="$1" | ||
|
||
local PATCHES="$(find "$SRC_DIR/target/$TARGET_CODENAME/patches/smali$TARGET" -type f -name "*.patch" -printf "%p ")" | ||
|
||
[ ! -d "$APKTOOL_DIR$TARGET" ] && bash "$SRC_DIR/scripts/apktool.sh" d "$TARGET" | ||
|
||
cd "$APKTOOL_DIR$TARGET" | ||
for patch in $PATCHES; do | ||
local OUT | ||
local COMMIT_NAME | ||
COMMIT_NAME="$(grep "^Subject:" "$patch" | sed 's/.*PATCH] //')" | ||
|
||
if [[ "$patch" == *"0000-"* ]]; then | ||
[[ "$patch" == *"AOSP"* ]] && $ROM_IS_OFFICIAL && continue | ||
[[ "$patch" == *"UNICA"* ]] && $ROM_IS_OFFICIAL || continue | ||
fi | ||
|
||
echo "Applying \"$COMMIT_NAME\" to $TARGET" | ||
OUT="$(patch -p1 -s -t -N --dry-run < "$patch")" \ | ||
|| echo "$OUT" | grep -q "Skipping patch" || false | ||
patch -p1 -s -t -N < "$patch" &> /dev/null || true | ||
done | ||
cd - &> /dev/null | ||
} | ||
|
||
FILES_TO_PATCH+="$(find "$SRC_DIR/target/$TARGET_CODENAME/patches/smali" -type d \( -name "*.apk" -o -name "*.jar" \) -printf "\n%p" | sed 's/.*\/smali//')" | ||
for i in $FILES_TO_PATCH; do | ||
APPLY_PATCHES "$i" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id=misc_smali_patches | ||
name=Misc smali patches | ||
author=BlackMesa123 | ||
description= |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id=nfc | ||
name=Stock NFC blobs | ||
author=BlackMesa123 | ||
description=Replaces source NFC blobs with stock ones. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id=props | ||
name=Props patches | ||
author=BlackMesa123 | ||
description=Reads target ".prop" files and applies all the changes in each target prop. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
SKIPUNZIP=1 | ||
|
||
if [[ -d "$SRC_DIR/target/$TARGET_CODENAME/patches/overlay" ]]; then | ||
bash -e "$SRC_DIR/scripts/apktool.sh" d -f "/product/overlay/framework-res__auto_generated_rro_product.apk" | ||
|
||
echo "Applying stock overlay configs" | ||
rm -f "$APKTOOL_DIR/product/overlay/framework-res__auto_generated_rro_product.apk/res/values/public.xml" | ||
cp -a --preserve=all \ | ||
"$SRC_DIR/target/$TARGET_CODENAME/patches/overlay/"* \ | ||
"$APKTOOL_DIR/product/overlay/framework-res__auto_generated_rro_product.apk/res" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id=rro | ||
name=/product RRO configs | ||
author=BlackMesa123 | ||
description=Replaces /product RRO configs with target ones. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id=sak-fix | ||
name=SAK fix | ||
author=BlackMesa123 | ||
description= |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id=sf-fix | ||
name=Secure Folder/Work profile fix | ||
author=BlackMesa123 | ||
description= |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.