FIX Sensei Helper Error

ADD: Sensei helper handle
This commit is contained in:
秋城落叶
2024-02-22 19:01:12 +08:00
committed by GitHub
4 changed files with 42 additions and 1 deletions

View File

@@ -434,7 +434,8 @@
"packageName": "org.cindori.Sensei",
"needCopyToAppDir": true,
"deepSignApp": true,
"injectFile": "Sparkle.framework/Versions/B/Sparkle"
"injectFile": "Sparkle.framework/Versions/B/Sparkle",
"extraShell": "senseiAgent.sh"
},
{
"packageName": "com.skylum.luminarneomas",

View File

@@ -42,5 +42,12 @@
"replaceIntel": "{{==intel==}}",
"replaceARM": "{{==arm64==}}",
"fixPlist": true
},
"sensei": {
"locate": [
"/Applications/Sensei.app/Contents/Library/LaunchServices/org.cindori.SenseiHelper"
],
"out": "sensei.sh",
"fixPlist": true
}
}

18
tool/senseiAgent.sh Normal file
View File

@@ -0,0 +1,18 @@
tccutil reset All org.cindori.Sensei
helper="/Applications/Sensei.app/Contents/Library/LaunchServices/org.cindori.SenseiHelper"
backup="${helper}_backup"
if [ -e "$backup" ];
then
echo "检测到helper备份文件存在可能是二次注入删除已注入的helper"
rm "$helper"
cp "$backup" "$helper"
else
echo "未检测到helper备份文件首次注入已备份helper文件"
cp "$helper" "$backup"
fi
echo "准备自动计算Helper偏移参数..."
cp ./tool/sensei_x.sh ./tool/sensei.sh
chmod +x ./tool/SearchParttenCode
./tool/SearchParttenCode sensei
sh ./tool/sensei.sh
rm ./tool/sensei.sh

15
tool/sensei_x.sh Normal file
View File

@@ -0,0 +1,15 @@
sudo /bin/launchctl unload /Library/LaunchDaemons/org.cindori.SenseiDaemon.plist
sudo /bin/launchctl unload /Library/LaunchDaemons/org.cindori.SenseiHelper.plist
sudo /usr/bin/killall -u root -9 org.cindori.SenseiHelper
sudo /bin/rm /Library/LaunchDaemons/org.cindori.SenseiDaemon.plist
sudo /bin/rm /Library/LaunchDaemons/org.cindori.SenseiHelper.plist
sudo /bin/rm /Library/PrivilegedHelperTools/org.cindori.SenseiHelper
helper='/Applications/Sensei.app/Contents/Library/LaunchServices/org.cindori.SenseiHelper'
xattr -c '/Applications/Sensei.app'
src_info='/Applications/Sensei.app/Contents/Info.plist'
/usr/libexec/PlistBuddy -c "Set :SMPrivilegedExecutables:org.cindori.SenseiHelper \"identifier \\\"org.cindori.SenseiHelper\\\"\"" "$src_info"
codesign -f -s - --all-architectures --deep /Applications/Sensei.app/Contents/Library/LaunchServices/org.cindori.SenseiHelper
codesign -f -s - --all-architectures --deep /Applications/Sensei.app