一个功能完整的 VS Code 扩展,为 Logos 语言提供全面的开发支持。Logos 是用于 iOS 越狱插件(Tweak)开发的预处理器语言,基于 Theos 开发框架。
Logos 是一种建立在 Objective-C 之上的预处理器语言,它简化了 iOS 越狱插件的开发过程。通过 Logos,开发者可以轻松地:
- Hook(钩住) 系统类和方法,修改其行为
- 添加新方法 到现有类
- 创建新的子类
- Hook C 函数
Logos 代码会被 Theos 预处理器转换为标准的 Objective-C 代码,然后编译成动态库注入到目标进程中。
为所有 Logos 指令提供精确的语法高亮:
%hook/%end- 类钩子%group/%init- 分组和初始化%ctor/%dtor- 构造/析构函数%new/%property- 新方法和属性%subclass- 子类创建%hookf- C 函数钩子%orig/%log/%c- 其他指令
快速插入常用代码模板,提高开发效率:
| 前缀 | 描述 |
|---|---|
hook |
创建 %hook/%end 块 |
hooks |
创建简单的 %hook 块(无方法模板) |
hookm |
创建包含多个方法的 %hook 块 |
group |
创建 %group/%init/%end 块 |
groupios |
创建 iOS 版本条件分组 |
ctor / ctori / ctorf |
创建 %ctor 构造函数 |
dtor |
创建 %dtor 析构函数 |
new / newr / newc |
使用 %new 添加新方法 |
subclass / subview |
创建 %subclass 子类 |
hookf / hookfv |
使用 %hookf 钩住 C 函数 |
property / props / propw / propa |
添加属性 |
orig / origr |
调用原始方法 |
tweak / tweakp |
完整的 Tweak 模板 |
dispatch / dispatchm / dispatchb |
GCD 异步执行 |
nslog / nslogf |
NSLog 日志 |
alert |
UIAlertController 弹窗 |
weakself / strongself |
弱/强引用 self |
输入 % 时自动显示所有可用的 Logos 指令,包含指令名称、描述和使用示例。
将鼠标悬停在任何 Logos 指令上,即可查看指令说明、语法格式、使用示例和详细文档。
自动检测常见错误:
- 未闭合的块 -
%hook、%group、%subclass缺少对应的%end - 未初始化的组 -
%group定义后未调用%init - 无效的 %orig - 在
%hook块外使用%orig
按 Shift+Option+F(Mac)或 Shift+Alt+F(Windows/Linux)格式化 Logos 指令缩进。
| 扩展名 | 描述 |
|---|---|
.x |
Logos 文件(C 语法) |
.xm |
Logos 文件(Objective-C/C++ 语法) |
.xi |
可包含的 Logos 文件(C 语法) |
.xmi |
可包含的 Logos 文件(Objective-C/C++ 语法) |
- 下载 Releases 页面的
.vsix文件 - 打开 VS Code,按
Cmd+Shift+P(Mac)或Ctrl+Shift+P(Windows/Linux) - 输入
Install from VSIX,选择下载的文件
git clone https://github.com/user/repo.git
cd repo
npm install
npm run compile复制到 VS Code 扩展目录:
- macOS/Linux:
~/.vscode/extensions/logos-language - Windows:
%USERPROFILE%\.vscode\extensions\logos-language
# 安装依赖
npm install
# 编译
npm run compile
# 打包为 VSIX
npx @vscode/vsce package%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)app {
%orig;
NSLog(@"SpringBoard 已启动!");
}
%end
%ctor {
%init;
}A full-featured VS Code extension providing comprehensive development support for the Logos language. Logos is a preprocessor language used for iOS jailbreak tweak development, based on the Theos framework.
Logos is a preprocessor language built on top of Objective-C that simplifies iOS jailbreak tweak development. With Logos, developers can easily:
- Hook system classes and methods to modify their behavior
- Add new methods to existing classes
- Create new subclasses
- Hook C functions
Logos code is transformed by the Theos preprocessor into standard Objective-C code, then compiled into dynamic libraries that are injected into target processes.
Precise syntax highlighting for all Logos directives:
%hook/%end- Class hooks%group/%init- Grouping and initialization%ctor/%dtor- Constructor/destructor%new/%property- New methods and properties%subclass- Subclass creation%hookf- C function hooks%orig/%log/%c- Other directives
Quickly insert common code templates:
| Prefix | Description |
|---|---|
hook |
Create %hook/%end block |
hooks |
Create simple %hook block (no method template) |
hookm |
Create %hook block with multiple methods |
group |
Create %group/%init/%end block |
groupios |
Create iOS version conditional group |
ctor / ctori / ctorf |
Create %ctor constructor |
dtor |
Create %dtor destructor |
new / newr / newc |
Add new method with %new |
subclass / subview |
Create %subclass |
hookf / hookfv |
Hook C function with %hookf |
property / props / propw / propa |
Add properties |
orig / origr |
Call original method |
tweak / tweakp |
Complete tweak templates |
dispatch / dispatchm / dispatchb |
GCD async execution |
nslog / nslogf |
NSLog statements |
alert |
UIAlertController |
weakself / strongself |
Weak/strong self references |
Auto-completion for all Logos directives when typing %, with names, descriptions, and usage examples.
Hover over any Logos directive to see documentation, syntax, examples, and detailed explanations.
Automatic error detection:
- Unclosed blocks -
%hook,%group,%subclassmissing%end - Uninitialized groups -
%groupdefined without%init - Invalid %orig -
%origused outside%hookblock
Press Shift+Option+F (Mac) or Shift+Alt+F (Windows/Linux) to format Logos directive indentation.
| Extension | Description |
|---|---|
.x |
Logos file (C syntax) |
.xm |
Logos file (Objective-C/C++ syntax) |
.xi |
Includable Logos file (C syntax) |
.xmi |
Includable Logos file (Objective-C/C++ syntax) |
- Download the
.vsixfile from Releases - Open VS Code, press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Windows/Linux) - Type
Install from VSIXand select the downloaded file
git clone https://github.com/user/repo.git
cd repo
npm install
npm run compileCopy to VS Code extensions directory:
- macOS/Linux:
~/.vscode/extensions/logos-language - Windows:
%USERPROFILE%\.vscode\extensions\logos-language
# Install dependencies
npm install
# Compile
npm run compile
# Package as VSIX
npx @vscode/vsce package%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)app {
%orig;
NSLog(@"SpringBoard launched!");
}
%end
%ctor {
%init;
}MIT License
Issues and Pull Requests are welcome!
Happy Tweaking! 🎉
