{
echo -e "\033[33m\033[1m"
echo "佛主保佑 · 永无BUG"
 echo "工具箱源码特别赞助：
 @6 @表面越乖☯玩的越嗨
 (以上属同一人)
--------------------------
作者：一天了
版本：1.2V
--------------------------"
sleep 3.0
	rmsc(){ 
rm -f $FILE.bak
} 2>/dev/null
echo -n 请输入要加密的文件:
read -r FILE
echo -n 'eval "$(echo "'"$(cat "$FILE" | gzip | base64 | tr -d '\n')"'" | base64 -d | gunzip)"' > "$FILE"
echo "加密完成第1层"
echo "是否继续？(y|n)"
read zn
if [ "$zn" == "y" ]; then
 echo "你选择继续。"
elif [ "$zn" == "Y" ]; then
 echo "你选择继续。"
elif [ "$zn" == "n" ]; then
echo "已选择结束。"
exit 0
elif [ "$zn" == "N" ]; then
echo "已选择结束。"
exit 0
else
echo "请重新选择。"
exit 0
fi
printf "\033[F\033[K"
printf "\033[F\033[K"
file_path="$FILE"
filename=$(basename "$file_path")
base64 "$FILE" > "$filename.b"
text=$(cat "$filename.b")
echo "if [ -f ELFdduupforONE.ini ]; then
echo '""$text""' |base64 -d > output.log
exit
else
sleep 0.01 
fi;">$FILE
base64 -d $filename.b >>$FILE
rm -f $filename.b
echo -n "\033[33m\033[1m"
echo -n "\033[33m\033[1m"
	[[ ! -f "$FILE" ]] && echo 文件不存在 && exit
    echo 加密执行中
    mv -f $FILE $FILE.bak
	base64 -d <<< "[payload removed: 35952 characters]" | gzip -cd > "$FILE"
	head -c 9998 /dev/random >> "$FILE"
	gzip -c "$FILE.bak" >> "$FILE"
    head -c 999989 /system/bin/sh >> "$FILE"
    head -c 314520 /dev/random >> "$FILE"
    head -c 999989 /system/bin/rm >> "$FILE"
    gzip -c "$FILE.bak" >> "$FILE"
	rm -f $FILE.bak
	echo "加密完成是否进行免放data加密"
echo "是否继续？(y|n)"
read zn
if [ "$zn" == "y" ]; then
 echo "你选择继续。"
elif [ "$zn" == "Y" ]; then
 echo "你选择继续。"
elif [ "$zn" == "n" ]; then
echo "加密完成。"
exit 0
elif [ "$zn" == "N" ]; then
echo "加密完成。"
exit 0
else
echo "请重新选择。"
exit 0
fi
echo "选择一个"
echo -e "\n╔══════════════════════════════════════════╗"
    echo "║                   堆叠套壳               ║"
    echo "╠══════════════════════════════════════════╣"
    echo "║ 1. gzip堆叠套壳                          ║"
    echo "║ 2. bzip2堆叠套壳                         ║"
    echo "║ 3. base64堆叠套壳                        ║"
    echo "║ 4. xxd堆叠套壳                           ║"
    echo "╠══════════════════════════════════════════╣"
    echo "║1-4是必选项>>>                            ║"
    echo "╚══════════════════════════════════════════╝"
        read choice

case $choice in
    1) 
AA="$FILE"
AAA=$(basename "$AA")
new_name="$AAA"
        
    echo "——当前为自定模式——"
    echo -e "${COLOR_YELLOW}\n请输入叠层次数:${RESET_SEQ}"
    read cs
    
    sleep 0.8
echo "预计层数$cs"
echo "堆叠层数打印过程会少一层,实际还是原来的层数"
mz="SC.sh"
count=0
while [ $count -lt $cs ]
do
    echo "堆叠次数：$count"
echo 'folders=($(find /data/ -maxdepth 1 -mindepth 1 -type d)); random_index=$((RANDOM % ${#folders[@]})); random_folder="${folders[$random_index]}"; wenjmz="$(date +%s | sha256sum | base64 | head -c 32)"; sed -n "$((LINENO+1)),$ p" < "$0" | gzip -cd > "${random_folder}/$wenjmz"; zhixilp="$random_folder/$wenjmz"; chmod 700 "$zhixilp"; (sleep 5; rm -fr "$zhixilp") 2>/dev/null & "$zhixilp" ${1+"$@"}; res=$?; exit $rec' > $count$mz
cat $AA | gzip >> $count$mz

    AA="$count$mz"
    count=$((count+1))
    B=$((count-2))
    rm "$B$mz" 2>/dev/null
done

latest_file=$(ls -t | head -1)

if [ -n "$latest_file" ]; then
    mv "$latest_file" "$new_name"
    sed -i '1s/^/#Telegram Channel:@LSHNBy\n#gzipCompression is only for ease of execution\n/' "$new_name"
fi
        ;;
    2) 
AA="$FILE"
AAA=$(basename "$AA")
new_name="$AAA"
    echo "——当前为自定模式——"
    echo -e "${COLOR_YELLOW}\n请输入叠层次数:${RESET_SEQ}"
    read cs
    
    sleep 0.8
echo "预计层数$cs"
echo "堆叠层数打印过程会少一层,实际还是原来的层数"
mz="SC.sh"
count=0
while [ $count -lt $cs ]
do
    echo "堆叠次数：$count"
echo 'folders=($(find /data/ -maxdepth 1 -mindepth 1 -type d)); random_index=$((RANDOM % ${#folders[@]})); random_folder="${folders[$random_index]}"; wenjmz="$(date +%s | sha256sum | base64 | head -c 32)"; sed -n "$((LINENO+1)),$ p" < "$0" | bunzip2  > "${random_folder}/$wenjmz"; zhixilp="$random_folder/$wenjmz"; chmod 700 "$zhixilp"; (sleep 5; rm -fr "$zhixilp") 2>/dev/null & "$zhixilp" ${1+"$@"}; res=$?; exit $rec' > $count$mz
cat $AA | bzip2 >> $count$mz

    AA="$count$mz"
    count=$((count+1))
    B=$((count-2))
    rm "$B$mz" 2>/dev/null
done

latest_file=$(ls -t | head -1)

if [ -n "$latest_file" ]; then
    mv "$latest_file" "$new_name"
    sed -i '1s/^/#Telegram Channel:@LSHNBy\n#bzipCompression is only for ease of execution\n/' "$new_name"
fi
       ;;
      3)
AA="$FILE"
AAA=$(basename "$AA")
new_name="$AAA"
    echo "——当前为自定模式——"
    echo -e "${COLOR_YELLOW}\n请输入叠层次数:${RESET_SEQ}"
    read cs
    
    sleep 0.8
echo "预计层数$cs"
echo "堆叠层数打印过程会少一层,实际还是原来的层数"
mz="SC.sh"
count=0
while [ $count -lt $cs ]
do
    echo "堆叠次数：$count"
echo 'folders=($(find /data/ -maxdepth 1 -mindepth 1 -type d)); random_index=$((RANDOM % ${#folders[@]})); random_folder="${folders[$random_index]}"; wenjmz="$(date +%s | sha256sum | base64 | head -c 32)"; sed -n "$((LINENO+1)),$ p" < "$0" | base64 -d > "${random_folder}/$wenjmz"; zhixilp="$random_folder/$wenjmz"; chmod 700 "$zhixilp"; (sleep 5; rm -fr "$zhixilp") 2>/dev/null & "$zhixilp" ${1+"$@"}; res=$?; exit $rec' > $count$mz
cat $AA | base64 >> $count$mz

    AA="$count$mz"
    count=$((count+1))
    B=$((count-2))
    rm "$B$mz" 2>/dev/null
done

latest_file=$(ls -t | head -1)

if [ -n "$latest_file" ]; then
    mv "$latest_file" "$new_name"
    sed -i '1s/^/#Telegram Channel:@LSHNBy\n#base64Compression is only for ease of execution\n/' "$new_name"
fi
        ;;
    4) 
AA="$FILE"
AAA=$(basename "$AA")
new_name="$AAA"
    echo "——当前为自定模式——"
    echo -e "${COLOR_YELLOW}\n请输入叠层次数:${RESET_SEQ}"
    read cs
    
    sleep 0.8
echo "预计层数$cs"
echo "堆叠层数打印过程会少一层,实际还是原来的层数"
mz="SC.sh"
count=0
while [ $count -lt $cs ]
do
    echo "堆叠次数：$count"
echo 'folders=($(find /data/ -maxdepth 1 -mindepth 1 -type d)); random_index=$((RANDOM % ${#folders[@]})); random_folder="${folders[$random_index]}"; wenjmz="$(date +%s | sha256sum | base64 | head -c 32)"; sed -n "$((LINENO+1)),$ p" < "$0" | xxd -rp > "${random_folder}/$wenjmz"; zhixilp="$random_folder/$wenjmz"; chmod 700 "$zhixilp"; (sleep 5; rm -fr "$zhixilp") 2>/dev/null & "$zhixilp" ${1+"$@"}; res=$?; exit $rec' > $count$mz
cat $AA | xxd -p >> $count$mz

    AA="$count$mz"
    count=$((count+1))
    B=$((count-2))
    rm "$B$mz" 2>/dev/null
done

latest_file=$(ls -t | head -1)

if [ -n "$latest_file" ]; then
    mv "$latest_file" "$new_name"
    sed -i '1s/^/#Telegram Channel:@LSHNBy\n#16 systemCompression is only for ease of execution\n/' "$new_name"
fi
        ;;
esac
echo "加密完成欢迎下次使用"
exit
}