title: Linux下的 Typora 安装和激活
author: taoone
create_date: 2023-10-19

typora作为markdown的编辑器的翘楚不用多介绍了吧,就是收费了,不过收费才能让软件走的更好,更远,所以,所以…所以呢,我目前选择破解

安装typora

方式一

注意:此方式会下载最新版本.

官网教程:https://typoraio.cn/#linux

# or run:  
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE

wget -qO - https://typoraio.cn/linux/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/typora.asc

# add Typora's repository

sudo add-apt-repository 'deb https://typoraio.cn/linux ./'

sudo apt-get update

# install typora

sudo apt-get install typora

方式二

可以下载指定的版本,更改后面的版本号即可

https://download2.typoraio.cn/linux/typora_1.7.5_amd64.deb

下载完成时候安装

sudo dpkg -i typora_1.7.5_amd64.deb

激活typora

以下命令均为绝对路径,只需要复制粘贴即可

下载

git clone https://github.com/muyiacc/NodeInject.git ~/.NodeInject

git clone https://github.com/muyiacc/NodeInject_Hook_example.git ~/.NodeInject_Hook_example

将NodeInject_Hook_example下hook.js 复制到 NodeInject/src下,并改名为hooklog.js

cp ~/.NodeInject_Hook_example/hook.js ~/.NodeInject/src/hooklog.js

安装rust

按照官方教程,需要用到cargo,这是rust所包含的包管理工具,所以还得安装rust
中间选择 1 使用默认推荐安装
安装完成之后,接着刷新环境

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

接着在终端输入,测试安装是否成功,输出如下信息则安装成功

→ cargo -V
cargo 1.73.0 (9c4383fb5 2023-08-26)

进入NodeInject编译

cd ~/.NodeInject && cargo build

将编译后的可执行文件复制到 typora文件夹下,并切换,执行复制的文件

sudo cp ~/.NodeInject/target/debug/node_inject /usr/share/typora/

sudo /usr/share/typora/node_inject

这里出现如下信息,则到目前为止,没有任何问题。

extracting node_modules.asar
adding hook.js
applying patch
packing node_modules.asar
done!

切换回 NodeInject_Hook_example,生成 license

cd ~/.NodeInject_Hook_example/license-gen/

cargo build

~/.NodeInject_Hook_example/license-gen/target/debug/license-gen

接着出现 license

License for you: 5QSW2H-X9GNBU-64F2MZ-YYHJ7W

打开typora,输入邮箱和许可证激活
幸运的话,就可以激活了。

卸载typora

sudo apt purge typora

sudo rm -rf /usr/share/typora