forked from liusj5257/azurlane_anti_name
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch_baidu.sh
More file actions
40 lines (30 loc) · 1.44 KB
/
patch_baidu.sh
File metadata and controls
40 lines (30 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Download Azur Lane
download_azurlane () {
if [ ! -f "AzurLane.apk" ]; then
#这个链接是百度,百度比较特殊
url="https://signd.bd.duoku.com/service/cloudapk_sign_online/66000/66924/66924_20221111095321_60031_signed.apk"
# 使用curl命令下载apk文件
curl -o blhx.apk $url
fi
}
if [ ! -f "AzurLane.apk" ]; then
echo "Get Azur Lane apk"
download_azurlane
mv *.apk "AzurLane.apk"
fi
echo "Decompile Azur Lane apk"
java -jar apktool.jar -f d AzurLane.apk
echo "Copy libs"
cp -r libs/. AzurLane/lib/
echo "Patching Azur Lane"
oncreate=$(grep -n -m 1 'onCreate' AzurLane/smali_classes2/com/unity3d/player/UnityPlayerActivity.smali | sed 's/[0-9]*\:\(.*\)/\1/')
sed -ir "s#\($oncreate\)#.method private static native init(Landroid/content/Context;)V\n.end method\n\n\1#" AzurLane/smali_classes2/com/unity3d/player/UnityPlayerActivity.smali
sed -ir "s#\($oncreate\)#\1\n const-string v0, \"Dev_Liu\"\n\n\ invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V\n\n invoke-static {p0}, Lcom/unity3d/player/UnityPlayerActivity;->init(Landroid/content/Context;)V\n#" AzurLane/smali_classes2/com/unity3d/player/UnityPlayerActivity.smali
echo "Build Patched Azur Lane apk"
java -jar apktool.jar -f b AzurLane -o AzurLane.patched.apk
echo "Set Github Release version"
echo "PERSEUS_VERSION=$(echo BaiDu)" >> $GITHUB_ENV
mkdir -p build
mv *.patched.apk ./build/
find . -name "*.apk" -print