Skip to content

Commit 27d2efd

Browse files
committed
Feat: ThemeManager: Unlock AI Dynamic Theme
1 parent 97a2646 commit 27d2efd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

port.sh

+10
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,16 @@ if [[ -f $targetFrameworkExtRes ]] && [[ ${port_android_version} != "15" ]]; the
900900
java -jar bin/apktool/APKEditor.jar b -i tmp/framework-ext-res -o tmp/$filename -f> /dev/null 2>&1 || error "apktool 打包失败" "apktool mod failed"
901901
cp -rf tmp/$filename $targetFrameworkExtRes
902902
fi
903+
targetMIUIThemeManagerAPK=$(find build/portrom -type f -name "MIUIThemeManager.apk")
904+
if [[ -f $targetMIUIThemeManagerAPK ]];then
905+
cp -rf $targetMIUIThemeManagerAPK tmp/$(basename $targetMIUIThemeManagerAPK).bak
906+
java -jar bin/apktool/APKEditor.jar d -i $targetMIUIThemeManagerAPK -o tmp/MIUIThemeManager -f > /dev/null 2>&1
907+
targetsmali=$(find tmp/ -name "o1t.smali" -path "*/basemodule/utils/*")
908+
python3 bin/patchmethod.py $targetsmali mcp -return true
909+
java -jar bin/apktool/APKEditor.jar b -i tmp/MIUIThemeManager -o $targetMIUIThemeManagerAPK -f > /dev/null 2>&1
910+
911+
fi
912+
903913
targetSettingsAPK=$(find build/portrom -type f -name "Settings.apk")
904914
if [[ -f $targetSettingsAPK ]];then
905915
cp -rf $targetSettingsAPK tmp/$(basename $targetSettingsAPK).bak

0 commit comments

Comments
 (0)