注意: 这里不是破解Termius服务器,而是破解一些本地termius的功能, 比如隧道跳板机等,xshell也有类似功能,但是xshell没有linux客户端,
参考
https://github.com/h3110w0r1d-y/termius-cracked
https://www.52pojie.cn/thread-1860682-1-1.html
8.11.0下载地址
版本8.12以后有变更不支持,适用8.11.0及之前版本
git clone https://aur.archlinux.org/v.git
|
这里提供一下termius 8.11.0的snap地址
https://api.snapcraft.io/api/v1/snaps/download/WkTBXwoX81rBe3s3OTt3EiiLKBx2QhuS_186.snap
|
只需要termius 8.11.0 的asar文件可以从这里下载,下载后改名为 app.asar即可
不需要解压 不需要解压 不需要解压
https://images.hao.kim/uploads/app.asar-8.11.0.zip
构建文件
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=termius
|
安装squashfs
sudo apt update sudo apt install squashfs-tools
mkdir extracted_snap unsquashfs -d extracted_snap/ WkTBXwoX81rBe3s3OTt3EiiLKBx2QhuS_186.snap
|
安装npm,asar
sudo apt -y install npm
sudo npm config set registry https://registry.npmmirror.com --global sudo npm install -g asar
|
解压app.asar
linux版的目录为 /opt/Termius/resources
Mac版的目录为 /Applications/Termius.app/Contents/Resources/
Windows 目录为 C:\Users\Administrator\AppData\Local\Programs\Termius\resources
cd /opt/Termius/resources sudo asar extract app.asar ./app sudo mv app.asar app.asar.bak sudo rm app-update.yml
|
修改app/js/background-process.js
搜索
await this.api.bulkAccount
|
将下面的进行替换
const e=await this.api.bulkAccount();
|
修改为
var e=await this.api.bulkAccount(); e.account.pro_mode=true; e.account.need_to_update_subscription=false; e.account.current_period={ "from": "2022-01-01T00:00:00", "until": "2099-01-01T00:00:00" }; e.account.plan_type="Premium"; e.account.user_type="Premium"; e.student=null; e.trial=null; e.account.authorized_features.show_trial_section=false; e.account.authorized_features.show_subscription_section=true; e.account.authorized_features.show_github_account_section=false; e.account.expired_screen_type=null; e.personal_subscription={ "now": new Date().toISOString().slice(0, -5), "status": "SUCCESS", "platform": "stripe", "current_period": { "from": "2022-01-01T00:00:00", "until": "2099-01-01T00:00:00" }, "revokable": true, "refunded": false, "cancelable": true, "reactivatable": false, "currency": "usd", "created_at": "2022-01-01T00:00:00", "updated_at": new Date().toISOString().slice(0, -5), "valid_until": "2099-01-01T00:00:00", "auto_renew": true, "price": 12.0, "verbose_plan_name": "Termius Pro Monthly", "plan_type": "SINGLE", "is_expired": false }; e.access_objects=[{ "period": { "start": "2022-01-01T00:00:00", "end": "2099-01-01T00:00:00" }, "title": "Pro" }];
|

保存文件,重新打开Termius 即可, pro功能即可使用,
破解脚本
Python版本
import re
pattern = re.compile(r'const e=await this\.api\.bulkAccount\(\);', re.DOTALL)
replacement = """ var e=await this.api.bulkAccount(); e.account.pro_mode=true; e.account.need_to_update_subscription=false; e.account.current_period={ "from": "2022-01-01T00:00:00", "until": "2099-01-01T00:00:00" }; e.account.plan_type="Premium"; e.account.user_type="Premium"; e.student=null; e.trial=null; e.account.authorized_features.show_trial_section=false; e.account.authorized_features.show_subscription_section=true; e.account.authorized_features.show_github_account_section=false; e.account.expired_screen_type=null; e.personal_subscription={ "now": new Date().toISOString().slice(0, -5), "status": "SUCCESS", "platform": "stripe", "current_period": { "from": "2022-01-01T00:00:00", "until": "2099-01-01T00:00:00" }, "revokable": true, "refunded": false, "cancelable": true, "reactivatable": false, "currency": "usd", "created_at": "2022-01-01T00:00:00", "updated_at": new Date().toISOString().slice(0, -5), "valid_until": "2099-01-01T00:00:00", "auto_renew": true, "price": 12.0, "verbose_plan_name": "Termius Pro Monthly", "plan_type": "SINGLE", "is_expired": false }; e.access_objects=[{ "period": { "start": "2022-01-01T00:00:00", "end": "2099-01-01T00:00:00" }, "title": "Pro" }]; """
file_path = '/opt/Termius/resources/app/js/background-process.js'
with open(file_path, 'r', encoding='utf-8') as file: content = file.read()
new_content = re.sub(pattern, replacement, content)
with open(file_path, 'w', encoding='utf-8') as file: file.write(new_content)
print("替换完成。")
|
GO版本
src.js
const e=await this.api.bulkAccount();
|
dst.js
var e=await this.api.bulkAccount(); e.account.pro_mode=true; e.account.need_to_update_subscription=false; e.account.current_period={ "from": "2022-01-01T00:00:00", "until": "2099-01-01T00:00:00" }; e.account.plan_type="Premium"; e.account.user_type="Premium"; e.student=null; e.trial=null; e.account.authorized_features.show_trial_section=false; e.account.authorized_features.show_subscription_section=true; e.account.authorized_features.show_github_account_section=false; e.account.expired_screen_type=null; e.personal_subscription={ "now": new Date().toISOString().slice(0, -5), "status": "SUCCESS", "platform": "stripe", "current_period": { "from": "2022-01-01T00:00:00", "until": "2099-01-01T00:00:00" }, "revokable": true, "refunded": false, "cancelable": true, "reactivatable": false, "currency": "usd", "created_at": "2022-01-01T00:00:00", "updated_at": new Date().toISOString().slice(0, -5), "valid_until": "2099-01-01T00:00:00", "auto_renew": true, "price": 12.0, "verbose_plan_name": "Termius Pro Monthly", "plan_type": "SINGLE", "is_expired": false }; e.access_objects=[{ "period": { "start": "2022-01-01T00:00:00", "end": "2099-01-01T00:00:00" }, "title": "Pro" }];
|
crack.go
package main
import ( "fmt" "log" "os" "regexp" )
func main() { originalText, err := os.ReadFile("src.js") if err != nil { log.Fatalf("failed reading file: %s", err) } replacementText, err := os.ReadFile("dst.js") if err != nil { log.Fatalf("failed reading file: %s", err) }
targetFileContent, err := os.ReadFile("/opt/Termius/resources/app/js/background-process.js") if err != nil { log.Fatalf("failed reading file: %s", err) }
re := regexp.MustCompile(`(?s)` + regexp.QuoteMeta(string(originalText))) replacedContent := re.ReplaceAll(targetFileContent, replacementText)
if err := os.WriteFile("/opt/Termius/resources/app/js/background-process.js", replacedContent, 0666); err != nil { log.Fatalf("failed writing to file: %s", err) }
fmt.Println("替换完成。") }
|