1. 需要python环境,没有的话自行安装一下
![Github下载](https://www.z4a.net/images/2021/12/27/typora01.png)
安装依赖:
pip install -r requirements.txt
3. 找到Typora安装目录下的resources目录下的app.asar文件
默认应该是在 C:\Program Files\Typora\resources\app.asar
![Typora安装目录](https://www.z4a.net/images/2021/12/27/typora02.png)
4. 执行解包命名:
Windows下如果路径是有空格的,需要用""包起来,如果提示权限问题,用管理员身份运行命令行,建议后续都用管理员身份执行。
python typora.py "C:\Program Files\Typora\resources\app.asar" workstation\outfile\
![解包](https://www.z4a.net/images/2021/12/27/typora03.png)
5. 使用脚本文件夹example\path\License.js替换掉workstation\outfile\dec_app\License.js文件
![解包后替换](https://www.z4a.net/images/2021/12/27/typora04.png)
6. 打包app.asar文件
python typora.py -u workstation\outfile\dec_app workstation\outappasar
我直接执行会报错:
PS C:\Code\mine\typoraCracker> python typora.py -u workstation/outfile/dec_app workstation/outappasar
2021-12-03 15:25:59.623 | ERROR | __main__:packWenc:103 - plz input Directory for app.asar
Traceback (most recent call last):
File "C:\Code\mine\typoraCracker\typora.py", line 151, in <module>
main()
File "C:\Code\mine\typoraCracker\typora.py", line 146, in main
args.mode(args.asarPath, args.dirPath, args.format)
File "C:\Code\mine\typoraCracker\typora.py", line 104, in packWenc
raise NotADirectoryError
NotADirectoryError
手动在脚本路径下创workstation/outappasar文件夹就行了:
mkdir workstation/outappasar
python typora.py -u workstation\outfile\dec_app workstation\outappasar
7. 将打包回来的app.asar文件重新丢到Typora的resources目录下
8. 授权码生成
node example/keygen.js
9. 激活
授权码输入生成的码,邮箱输入crack@example.com,完事。