Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'main' into feat/dashboard
  • Loading branch information
wibus-wee committed Mar 10, 2024
commit a83bd038d77b9cd91efdcc3c816d3f369c6111ae
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x

Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Setup
run: npm i -g @antfu/ni

- name: Create Release
id: create_release
run: |
npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install
run: nci

Expand All @@ -30,27 +37,20 @@ jobs:

- name: Rename
run: |
mv dist/main.js dist/activator.js
mv dist/activator.js dist/activator.js

- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: activator.js
path: dist/activator.js

- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: generator.js
path: dist/generator.js

- name: Create Release
id: create_release
run: |
npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
Expand Down
179 changes: 123 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,69 @@
# Activation Script

Activation Script 是一个旨在生成配置文件和激活软件许可证的脚本。这些配置文件和脚本用于拦截和操作各种应用程序提出的网络请求,允许您通过不同服务自动激活软件许可证。基于 [Surge](https://nssurge.com/)

<pre align="center">
🧪 Working in Progress
</pre>
[![Version][package-version-src]][package-version-href]
[![License][license-src]][license-href]

## Features

目前支持激活的应用程序:

- [x] LemonSqueezy
- [x] Screen Studio - [特殊说明](#screen-studio)
- [x] Paddle - [特殊说明](#paddle)
- [x] AlDente Pro
- [x] iStatistica Pro
- [x] One Switch
- [x] com.charliemonroe
- [x] Downie 4
- [x] Permute 3
- [x] Sensei
- [x] Rectangle Pro
- [x] MenubarX
- [x] Gumroad - [特殊说明](#gumroad)
- [x] MediaMate
- [x] ...more
- [x] App Store Restore Purchase *(仅支持仍使用[旧式 verifyReceipt 验证(文档中已被弃用)](https://developer.apple.com/documentation/appstorereceipts/verifyreceipt)的应用)* - [特殊说明](#app-store-restore-purchase)
- [x] iShot Pro
- [ ] ...more
- [ ] [~~Raycast Pro Plan~~]((#raycast-pro-plan))
- [x] Activate the application with MITM
- [ ] ...What else? [Create a new issue](https://github.com/wibus-wee/activation-script/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml)

###### [Our Roadmap](https://github.com/wibus-wee/activation-script/issues/15)

## Modules

目前支持的激活模块有:

- [x] LemonSqueezy <sup>***`📦 Stable`***</sup>
- [x] Paddle <sup>***`📦 Stable`***</sup>
- [x] Gumroad <sup>***`📦 Stable`***</sup>
- [x] App Store Restore Purchase <sup>***`🪄 Beta`***</sup>
- [x] Shottr <sup>***`🪄 Beta`***</sup>
- [x] Basic Tier
- [ ] Friends Club
- [x] Raycast Pro Plan <sup>***`🌊 Partially supported`***</sup>

###### [模块特殊说明](#特殊说明)

## 安装

前往 Surge 的 `Module` 配置页面,添加外部模块链接:`https://github.com/wibus-wee/activation-script/raw/gh-pages/activator.sgmodule`
前往 Surge 的 `Module` 配置页面,添加外部模块链接:

```text
https://github.com/wibus-wee/activation-script/raw/gh-pages/activator.sgmodule
```

或者你希望自行修改配置文件与脚本,你可以使用如下指令:

```bash
# 安装依赖
pnpm i
pnpm build:core # Build core(activator.js)

# 在当前目录下构建 activator.js 脚本
pnpm build:main

# 交互式命令
# 生成 Surge config 应添加的字段
pnpm generate gen

# 生成并移动 activator.js 到 Surge 配置目录
pnpm generate inject
# CLI (When you want to use local module)
pnpm start:generator gen # Generate config
pnpm start:generator inject # Build activator.js and move to directory
pnpm start:generator patch # Patch Surge config file (Beta)
```

###### [项目结构](#项目结构)

## 特殊说明

### Paddle

Paddle 是一个软件许可证管理服务,它的 SDK 会在应用程序启动时验证许可证。你可以使用以下指令查找使用了本机使用了 `Paddle.framework` 的应用程序:
- [x] AlDente Pro
- [x] iStatistica Pro
- [x] One Switch
- [x] Charliemonroe
- [x] Downie 4
- [x] Permute 3
- [x] Sensei
- [x] Rectangle Pro
- [x] MenubarX
- [x] MarginNote 3
- [x] MWeb Pro

Paddle 是一个软件许可证管理服务。你可以使用以下指令查找使用了本机使用了 `Paddle.framework` 的应用程序:

```shell
find /Applications -name "Paddle.framework" -type d -exec sh -c 'echo "应用程序 {} 使用了 Paddle.framework"' \;
Expand All @@ -68,30 +76,37 @@ find /Applications -name "Paddle.framework" -type d -exec sh -c 'echo "应用程
> 尤其针对 `com.charliemonroe` 的程序做了许可证格式的处理,因此你可以使用以下激活码来激活它们。

```
9U2DM70E-ED0RPLF3-6FOCF9UB-3GQ3WPEU-KREMAIUX
D2TMD4AR-3CPQYT42-N6UWNYYA-69REG5QI-T4C7ZSIR
75ZQRI8T-CQ8H46WJ-NFJHNROZ-P0A3PZ2R-SUA6PPYV
JP26HIZ7-BP09SYO8-ER67YRNR-L61JBMJ7-CCZRM7IZ
4JKMBTVI-4QXMR0O7-3WDLW8Z0-80618ZML-0EKK26KW
61WUMZRG-DK4AI5JD-HIYYM3CP-FCFSNKLS-P08UYALJ
F2X9ZBAR-ZO9Y1L4G-19MCAUK1-46358751-340O82BP
8DG6WQ0G-HTEEITAS-89ZYJXMC-MEHW736F-DZFHNXPH
I4QP2745-TBLLELKW-DQ6HRLOG-VPT8CN2V-Z5HDUTPY
D7BC2F5F-E9BC2E9E-B4DA2D3C-E7FF3E9F-D3FA6C7F
A7DF3E8C-C2FD6B6E-E2EA2F6E-E7AD1E2F-B6DD8F2A
D6AE1F1C-E8BE9B3C-E3EC1D5B-B5BB8D4D-C1DC3C3D
F3BF4F2E-D7FE1B5B-E8BF7B6B-D7DA8A7A-F5FC7A4B
F2FC1F4B-F8FF7F8D-D9EE6E7A-D4FA9F2E-D1FA2A9A
B2AE7F7A-D5EE5C5F-F6CC6C6D-D4FF4C1E-C5DF6C9F
B6AA1C9B-E3FC7B8D-F8AE5F4E-A2CC6F9A-F5BE5E6B
D9BA5F4E-B8CA4E4D-B9AC7A1C-D2DA2A1D-E7BF9C2F
D1BC8C4B-E8EE7E4C-E1BD9A6B-A5EF3C3B-D7ED5E4B
C2BF5D3B-F4AC9F5F-A8EB4B9E-B8AA5E8D-E2CC5C8D
```

###### [Alogrithm](./packages/modules/paddle/alogrithm/gen.ts)

### App Store Restore Purchase

> [!WARNING]
> 由于 Apple 的限制,这个功能只能用于仍使用旧式 verifyReceipt 验证(文档中已被弃用)的应用。如果你的应用使用了新的验证方法,那么这个功能将无法正常工作。
> 由于 Apple 的限制,这个功能只能用于仍使用[旧式 verifyReceipt 验证(文档中已被弃用)](https://developer.apple.com/documentation/appstorereceipts/verifyreceipt)的应用。如果你的应用使用了新的验证方法,那么这个功能将无法正常工作。

欢迎提交你发现的使用了旧式验证的应用程序,我会将它们添加到列表中。

### Screen Studio
- [x] iShot Pro

### LemonSqueezy

- [x] Screen Studio
- [x] Alist Desktop <sup>***`401934ec-0a54-433c-a299-2a363501d4be`***</sup>

除了特别说明的激活码外,你可以使用以下激活码来激活 LemonSqueezy 的应用程序:

```
401934ec-0a54-433c-a299-2a363501d4be
d06ad32e-00c2-43fb-a5a7-9bb44b094831
0c903cdd-9ee1-4935-8ad3-88de0ecef496
295aab81-b87e-437c-868a-1f0877216cae
Expand All @@ -109,6 +124,9 @@ f899ec8c-020b-4f8a-a09d-22a978b716a5

> Thanks to @QiuchenlyOpenSource & @Qiuchenly.

- [x] MediaMate
- [x] ...more

理论上,以下的激活码可以用于所有使用 Gumroad 的应用程序。

```
Expand All @@ -132,21 +150,43 @@ IFZONWUNB-OWLYVQKQB-YFNIKSXBS-MCLRA

> Thanks to @zhuozhiyongde.

为了可以正常使用 Raycast Pro Plan,你需要在 `Surge -> HTTP -> 捕获 -> 捕获 MITM 覆写` 中修改 MITM 主机名,将最后一行 `*` 取消勾选。
为了可以正常使用 Raycast Pro Plan,你可能需要在 `Surge -> HTTP -> 捕获 -> 捕获 MITM 覆写` 中修改 MITM 主机名,将最后一行 `*` 取消勾选。

如果后续你需要使用 Surge Dashboard 并正常使用原本的流量捕获功能,您需要重新勾选 `*`

> [!WARNING]
> 由于 Surge 限制,在 Surge 内的 runtime 做脚本无法实现 SSE,这对体验有很大很大的影响,以及还有一些实现上的问题,因此我打算不做内置的 AI 支持了

如果想使用此功能,请以下项目搭建自己的后端服务进行体验: **(它们都是不一样的!)**
如果想使用 AI 功能,请参照以下项目搭建自己的后端服务进行体验: **(它们都是不一样的!)**

- [wibus-wee/raycast-unblock](https://github.com/wibus-wee/raycast-unblock)
- [zhuozhiyongde/Unlocking-Raycast-With-Surge](https://github.com/zhuozhiyongde/Unlocking-Raycast-With-Surge)
- [yufeikang/raycast_api_proxy](https://github.com/yufeikang/raycast_api_proxy)

另外,你可能还需要前往 [./packages/modules/index.ts](./packages/modules/index.ts) 修改 `raycast` 模块替换的 `url` 为你自己的后端服务地址。
目前,Activation Script 仅会将 AI 部分的请求转发到你的后端服务。

> [!NOTE]
> 此部分是因为暂时无法对模块进行配置而导致的问题,在完成 Dashboard 功能后,你可以自行配置模块的启动与关闭,而无需修改代码。

<details>
<summary>如果你需要把 translations 功能也转发给后端服务:</summary>

```diff
$done({
{
base: 'translations',
- func: raycastTranslate,
+ func: unblockRequest,
},
```

对于其他的 Route 你需要转发给后端服务,你也可以这么做。

</details>

另外,你可能还需要前往 [./packages/modules/raycast/universal.ts](./packages/modules/raycast/universal.ts) 或已构建的脚本中,修改替换的 `url` 为你自己的后端服务地址。

```diff
return Done({
url: $request.url.replace(
'https://backend.raycast.com',
- 'http://127.0.0.1:3000',
Expand All @@ -162,13 +202,33 @@ $done({
>
> 除非...除非你给 headers 加点[料](./src/modules/index.ts#L70),让你的后端服务可以正常工作. (同时建议后端服务关闭 SSL 检查 `NODE_TLS_REJECT_UNAUTHORIZED=0`)

## 项目结构

```text
.
├── .github
│ └── workflows
├── .vscode
├── packages
│ ├── core
│ ├── modules
│ ├── generator
│ └── shared
└── ...others
```

- `core`: 核心模块,负责启动与运行时的匹配和运行逻辑
- `modules`: 模块集合,负责修改请求与响应
- `generator`: 生成器,负责生成配置文件与脚本
- `shared`: 共享模块,提供一些共享的工具(例如:储存、解析、类型支持)

## Credits

- [Surge](https://nssurge.com/)
- [QiuChenlyOpenSource/InjectLib](https://github.com/QiuChenlyOpenSource/InjectLib)
- [sooxt98/spotify-crack-chrome-app](https://github.com/sooxt98/spotify-crack-chrome-app)
- ~~[sooxt98/spotify-crack-chrome-app](https://github.com/sooxt98/spotify-crack-chrome-app)~~
- [yufeikang/raycast_api_proxy](https://github.com/yufeikang/raycast_api_proxy)
- [sfc9982/typoraActivator](https://github.com/sfc9982/typoraActivator)
- ~~[sfc9982/typoraActivator](https://github.com/sfc9982/typoraActivator)~~

## License

Expand All @@ -179,3 +239,10 @@ This project is licensed under the AGPLv3 License. See the [LICENSE](LICENSE) fi
Activation Script © Wibus, Released under AGPLv3. Created on Sep 9, 2023

> [Personal Website](http://wibus.ren/) · [Blog](https://blog.wibus.ren/) · GitHub [@wibus-wee](https://github.com/wibus-wee/) · Telegram [@wibus✪](https://t.me/wibus_wee)

<!-- Badges -->

[package-version-src]: https://img.shields.io/github/package-json/v/wibus-wee/activation-script?style=flat&colorA=080f12&colorB=1fa669
[package-version-href]: https://github.com/wibus-wee/activation-script
[license-src]: https://img.shields.io/github/license/wibus-wee/activation-script.svg?style=flat&colorA=080f12&colorB=1fa669
[license-href]: https://github.com/wibus-wee/activation-script/blob/main/LICENSE
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "activation-scripts",
"type": "module",
"version": "1.4.0",
"version": "1.5.0",
"packageManager": "pnpm@8.15.1",
"description": "",
"author": "wibus-wee <wibus@qq.com>",
Expand All @@ -19,7 +19,7 @@
},
"dependencies": {
"@antfu/eslint-config": "^2.6.4",
"commander": "^11.0.0",
"commander": "^12.0.0",
"eslint": "^8.56.0",
"typescript": "^5.2.2"
},
Expand All @@ -31,7 +31,7 @@
"esno": "^0.17.0",
"lint-staged": "^15.2.0",
"rollup": "^3.29.1",
"rollup-plugin-esbuild": "^5.0.0",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-ts": "^3.4.5",
"simple-git-hooks": "^2.9.0",
"toml": "^3.0.0"
Expand Down
7 changes: 7 additions & 0 deletions packages/core/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { execSync } from 'node:child_process'
import fs from 'node:fs'
import { defineConfig } from 'rollup'
import nodeResolve from '@rollup/plugin-node-resolve'
import json from '@rollup/plugin-json'
Expand All @@ -19,6 +20,7 @@ export default defineConfig({
json(),
inject({
COMMIT_HASH: getGitCommitHash(),
CORE_VERSION: getCoreVersion(),
}),
],
})
Expand All @@ -32,3 +34,8 @@ function getGitCommitHash() {
return ''
return execSync('git rev-parse HEAD').toString().trim()
}

function getCoreVersion() {
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
return packageJson.version
}
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.