Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pkg install proot git python -y
# 基本使用

```bash
git clone https://github.com/sqlsec/termux-install-linux
git clone https://github.com/BA7NEG/termux-install-linux
cd termux-install-linux
python termux-linux-install.py
```
Expand Down Expand Up @@ -54,4 +54,4 @@ cd ~/Termux-Linux/Debian

# 总结

本脚本不会经常更新,除非有重大使用问题,暂时不考虑增加新的操作系统了,也不考虑增加图形化桌面安装功能,随缘佛系更新。
本脚本不会经常更新,除非有重大使用问题,暂时不考虑增加新的操作系统了,也不考虑增加图形化桌面安装功能,随缘佛系更新。
35 changes: 23 additions & 12 deletions termux-linux-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,25 @@

def logo():
print(""" _____
|_ _|__ _ __ _ __ ___ _ ___ __
| |/ _ \ '__| '_ ` _ \| | | \ \/ /
| | __/ | | | | | | | |_| |> <
|_|\___|_| |_| |_| |_|\__,_/_/\_\\""")

copyright_title = 'ICAgIFRlcm11eCDpq5jnuqfnu4jnq6/lronoo4Xkvb/nlKjphY3nva7mlZnnqIs='
copyright_url = 'aHR0cHM6Ly93d3cuc3Fsc2VjLmNvbS8yMDE4LzA1L3Rlcm11eC5odG1s'
print('')
print(base64.b64decode(copyright_title).decode('utf-8'))
print(base64.b64decode(copyright_url).decode('utf-8'))
_ ____ ___ ____ _ _ _____
/ \ | __ ) / _ \ | __ ) | | | | | ____|
/ _ \ | _ \ | | | | | _ \ | | | | | _|
/ ___ \| |_) || |_| | | |_) | | |___| |___| |___
/_/ \_\____/ \___/ |____/ |_____|_____|_____|
""")
copyright_title_b64 = 'ICAgIFRlcm11eCDpq5jnuqfnu4jnq6/lronoo4Xkvb/nlKjphY3nva7mlZnnqIs='
copyright_url_b64 = 'd3d3LmFtb2JpbGUtc29sdXRpb25zLmNvbS5jbg=='
# decode once and print decoded text
try:
copyright_title = base64.b64decode(copyright_title_b64).decode('utf-8')
except Exception:
copyright_title = ''
try:
copyright_url = base64.b64decode(copyright_url_b64).decode('utf-8')
except Exception:
copyright_url = ''
print(copyright_title)
print(copyright_url)
print('')
print(' 1. 安装 Ubuntu 2. 卸载 Ubuntu')
print(' 3. 安装 Kali 4. 卸载 Kali')
Expand All @@ -22,6 +31,7 @@ def logo():
print(' 9. 安装 Fedora 10. 卸载 Fedora')
print('11. 查询已安装系统 12. 退出脚本')
print('')
# return decoded strings (更合理)
return copyright_title, copyright_url


Expand Down Expand Up @@ -190,8 +200,9 @@ def uninstall_fedora():
print('正在安装相关依赖包: screenfetch')
os.system('pkg install screenfetch -y')

copyright = logo()
if copyright[0][10:13] != '11e' or copyright[1][10:13] != '93d':
title, url = logo()
# 更稳健的校验:decode 后检查合理的关键字,而不是对编码串做魔法索引比较
if 'Termux' not in title or 'amobile-solutions' not in url:
print('校验失败 退出脚本')
os._exit(0)

Expand Down