Skip to content

Commit

Permalink
SoundConnect
Browse files Browse the repository at this point in the history
  • Loading branch information
lzghzr committed Oct 2, 2024
1 parent eb488b4 commit 7c6d3a3
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions security/mdrproxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ if [ ! -f "uber-apk-signer.jar" ];then
fi
# 获取 apk 版本
# get apk version
headphones_version=""
# 下载 Headphones.apk
# download Headphones.apk
if [ ! -f "Headphones.apk" ];then
headphones_url=$(curl -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" https://www.sonystyle.com.cn/minisite/cross/app/headphones_connect.htm | sed "s/'/\n/g" | grep "/minisite/cross/app/download/")
headphones_version=$(echo $headphones_url | awk -F[_/] '{ print $NF }' | sed "s/.apk//")
wget $headphones_url -O Headphones.apk
soundconnect_version=""
# 下载 SoundConnect.apk
# download SoundConnect.apk
if [ ! -f "SoundConnect.apk" ];then
soundconnect_url=$(curl -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0" https://www.sonystyle.com.cn/minisite/cross/appcenter/pa/sound_connect/index.html | sed "s/\"/\n/g" | grep "/minisite/cross/app/download/")
soundconnect_version=$(echo $soundconnect_url | awk -F[t_/] '{ print $NF }' | sed "s/.apk//")
wget $soundconnect_url -O SoundConnect.apk
fi
# 生成证书
# generating a certificate
Expand All @@ -32,31 +32,31 @@ if [ "$1" != "nocert" ];then
fi
# 解包app
# unpacking app
java -jar apktool.jar d --force-all --output Headphones --no-src Headphones.apk
java -jar apktool.jar d --force-all --output SoundConnect --no-src SoundConnect.apk
# 修改app配置
# modifying app configuration
sed 's/android:name="com.sony.songpal.mdr.vim.MdrApplication" /android:name="com.sony.songpal.mdr.vim.MdrApplication" android:networkSecurityConfig="@xml\/network_security_config" /' -i Headphones/AndroidManifest.xml
sed 's/android:name="com.sony.songpal.mdr.vim.MdrApplication" /android:name="com.sony.songpal.mdr.vim.MdrApplication" android:networkSecurityConfig="@xml\/network_security_config" /' -i SoundConnect/AndroidManifest.xml
# 添加网络安全配置
# adding network security configuration
cp network_security_config.xml Headphones/res/xml/network_security_config.xml
cp network_security_config.xml SoundConnect/res/xml/network_security_config.xml
# 添加证书
# adding certificate
cp mdrproxy-cert.pem Headphones/res/raw/mdrproxy_ca.pem
cp mdrproxy-cert.pem SoundConnect/res/raw/mdrproxy_ca.pem
# 重新打包
# repacking app
java -jar apktool.jar b --force-all --output Headphones_new.apk Headphones
java -jar apktool.jar b --force-all --output SoundConnect_new.apk SoundConnect
# 签名
# signing
java -jar uber-apk-signer.jar -a Headphones_new.apk
java -jar uber-apk-signer.jar -a SoundConnect_new.apk
# 重命名
# rename
if [ -z "$headphones_version" ];then
mv Headphones_new-aligned-debugSigned.apk Headphones_unknow_unsafe.apk
if [ -z "$soundconnect_version" ];then
mv SoundConnect_new-aligned-debugSigned.apk SoundConnect_unknow_unsafe.apk
else
mv Headphones_new-aligned-debugSigned.apk Headphones_${headphones_version}_unsafe.apk
mv SoundConnect_new-aligned-debugSigned.apk SoundConnect_${soundconnect_version}_unsafe.apk
fi
# 清除临时文件
# clean
rm -f Headphones_new-aligned-debugSigned.apk.idsig
rm -f Headphones_new.apk
rm -rf Headphones
rm -f SoundConnect_new-aligned-debugSigned.apk.idsig
rm -f SoundConnect_new.apk
rm -rf SoundConnect

0 comments on commit 7c6d3a3

Please sign in to comment.