Skip to content

Commit

Permalink
add .version file
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-black-tea committed Dec 23, 2024
1 parent 8ab654d commit cb19176
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 27 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
run: cd agents/frida && npm install && npm run build

# build android-tools.apk
- name: Set up JDK 11
- name: Set up JDK 17
if: ${{ !env.ACT }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
java-version: 17
- name: Setup Android SDK
if: ${{ !env.ACT }}
uses: android-actions/setup-android@v2
uses: android-actions/setup-android@v3
- name: Build android tools
if: ${{ !env.ACT }}
run: cd agents/android && ./gradlew --no-daemon :tools:buildTools
Expand All @@ -56,6 +56,8 @@ jobs:
- name: Get previous tag
id: tag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Save previous tag
run: sh -c "echo ${{ steps.tag.outputs.tag }} > .version"
- name: Build package
run: VERSION=${{ steps.tag.outputs.tag }} RELEASE=true python -m build --sdist --wheel

Expand All @@ -74,6 +76,7 @@ jobs:
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .version
git add src/linktools/assets/frida.js
git add src/linktools/assets/android-tools.json src/linktools/assets/android-tools.apk
git commit -m "Auto commit artifacts (${{ steps.tag.outputs.tag }})"
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ python & pip (3.6及以上): <https://www.python.org/downloads/>
# pip直接安装linktools,按需添加依赖项,推荐使用all添加所有依赖项
python3 -m pip install -U "linktools[all]"
# 也可以用以下命令安装github上的最新版本:
# python3 -m pip install --ignore-installed "linktools@ git+https://github.com/ice-black-tea/linktools.git@master"
# python3 -m pip install --ignore-installed "linktools@ git+https://github.com/linktools-toolkit/linktools.git@master"
```

额外的依赖项以及相应功能可通过[requirements.yml](https://github.com/ice-black-tea/linktools/blob/master/requirements.yml)查看
额外的依赖项以及相应功能可通过[requirements.yml](https://github.com/linktools-toolkit/linktools/blob/master/requirements.yml)查看

### 配置alias(推荐)

Expand Down Expand Up @@ -114,7 +114,7 @@ $ ct-env clean 7
<details>
<summary>类似linux中的grep,正则匹配文件内容 ,额外添加解析zip、elf等格等功能</summary>

![ct-grep](https://raw.githubusercontent.com/ice-black-tea/linktools/master/images/ct-grep.png)
![ct-grep](https://raw.githubusercontent.com/linktools-toolkit/linktools/master/images/ct-grep.png)

</details>

Expand All @@ -125,7 +125,7 @@ $ ct-env clean 7

##### 常用命令

所有声明的工具可通过[配置文件](https://github.com/ice-black-tea/linktools/blob/master/src/linktools/template/tools.yml)查看,此处以apktool举例
所有声明的工具可通过[配置文件](https://github.com/linktools-toolkit/linktools/blob/master/src/linktools/template/tools.yml)查看,此处以apktool举例

```bash
# 初始化并执行apktool命令
Expand Down Expand Up @@ -243,7 +243,7 @@ $ at-app --non-system

##### 输出效果

![at-app](https://raw.githubusercontent.com/ice-black-tea/linktools/master/images/at-app.png)
![at-app](https://raw.githubusercontent.com/linktools-toolkit/linktools/master/images/at-app.png)

</details>

Expand Down Expand Up @@ -298,7 +298,7 @@ $ at-intent browser https://example.com
$ at-frida -l ~/test/frida.js -p me.ele --spawn

# 从远程加载frida脚本,注入到me.ele进程中,并将me.ele流量重定向到本地8080端口
$ at-frida -c https://raw.githubusercontent.com/ice-black-tea/linktools/master/agents/frida/test/android.js -p me.ele --redirect-port 8080
$ at-frida -c https://raw.githubusercontent.com/linktools-toolkit/linktools/master/agents/frida/test/android.js -p me.ele --redirect-port 8080

# 只启动frida-server,不注入脚本
$ at-frida --serve --remote-port 27042 --local-port 27042 -p fake_package
Expand All @@ -309,7 +309,7 @@ $ at-frida --no-serve --remote-port 27042 -p me.ele

**2) 使用python方式调用**

执行如下python脚本即可自动开启frida-server,并将js代码注入到指定进程,参考[src/linktools/cli/commands/android/frida.py](https://github.com/ice-black-tea/linktools/blob/master/src/linktools/cli/commands/android/frida.py)
执行如下python脚本即可自动开启frida-server,并将js代码注入到指定进程,参考[src/linktools/cli/commands/android/frida.py](https://github.com/linktools-toolkit/linktools/blob/master/src/linktools/cli/commands/android/frida.py)

```python
#!/usr/bin/env python3
Expand Down Expand Up @@ -352,7 +352,7 @@ if __name__ == "__main__":

##### 内置接口

e.g. [java相关接口](https://github.com/ice-black-tea/linktools/blob/master/agents/frida/lib/java.ts)
e.g. [java相关接口](https://github.com/linktools-toolkit/linktools/blob/master/agents/frida/lib/java.ts)

```javascript
Java.perform(function () {
Expand Down
2 changes: 1 addition & 1 deletion agents/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ allprojects {
repositories {
google()
mavenCentral()
maven { url "https://github.com/ice-black-tea/maven-repository/raw/release/repository/" }
maven { url "https://github.com/linktools-toolkit/maven-repository/raw/release/repository/" }
}
}

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ license = {text = "Apache 2.0"}
dynamic = ["version", "dependencies", "optional-dependencies", "scripts"]

[project.urls]
Homepage = "https://github.com/ice-black-tea/linktools"
Repository = "https://github.com/ice-black-tea/linktools.git"
Homepage = "https://github.com/linktools-toolkit/linktools"
Repository = "https://github.com/linktools-toolkit/linktools.git"

[tool.setuptools.packages.find]
where = ["src"]
Expand Down
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,19 @@ def append_module(self, path, script_prefix, module_prefix):
if __name__ == '__main__':

release = os.environ.get("RELEASE", "false").lower() == "true"
version = os.environ.get("VERSION", "0.0.1.dev0")
version = os.environ.get("VERSION", None)
if not version:
try:
with open(get_root_path(".version"), "rt", encoding="utf-8") as fd:
version = fd.read().strip()
except:
pass
if not version:
version = "0.0.1"
if version.startswith("v"):
version = version[len("v"):]
if not release and not version.endswith(".dev0"):
version = f"{version}.dev0"

with open(get_src_path("template", "tools.yml"), "rb") as fd_in, \
open(get_src_path("assets", "tools.json"), "wt") as fd_out:
Expand Down
22 changes: 11 additions & 11 deletions src/linktools/template/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ TOOL_BURPSUITE_KEYGEN:
<<: *JAR
version: '2_1_06'
name: 'burpsuite-keygen'
download_url: 'https://github.com/ice-black-tea/archives/releases/download/burp-loader-keygen-{version}/burp-loader-keygen-{version}.jar'
download_url: 'https://github.com/linktools-toolkit/archives/releases/download/burp-loader-keygen-{version}/burp-loader-keygen-{version}.jar'

############################################################################################
# java
Expand Down Expand Up @@ -239,16 +239,16 @@ TOOL_VDEX_EXTRACTOR:
when:
- system: darwin
machine: arm64
then: 'https://github.com/ice-black-tea/archives/releases/download/vdexExtractor-{version}/vdexExtractor-macos-arm64'
then: 'https://github.com/linktools-toolkit/archives/releases/download/vdexExtractor-{version}/vdexExtractor-macos-arm64'
- system: darwin
machine: x86_64
then: 'https://github.com/ice-black-tea/archives/releases/download/vdexExtractor-{version}/vdexExtractor-macos-amd64'
then: 'https://github.com/linktools-toolkit/archives/releases/download/vdexExtractor-{version}/vdexExtractor-macos-amd64'
- system: linux
machine: x86_64
then: 'https://github.com/ice-black-tea/archives/releases/download/vdexExtractor-{version}/vdexExtractor-linux-amd64'
then: 'https://github.com/linktools-toolkit/archives/releases/download/vdexExtractor-{version}/vdexExtractor-linux-amd64'
- system: windows
machine: amd64
then: 'https://github.com/ice-black-tea/archives/releases/download/vdexExtractor-{version}/vdexExtractor-windows-amd64.exe'
then: 'https://github.com/linktools-toolkit/archives/releases/download/vdexExtractor-{version}/vdexExtractor-windows-amd64.exe'
- else: ~

TOOL_COMPACT_DEX_CONVERTER:
Expand All @@ -258,7 +258,7 @@ TOOL_COMPACT_DEX_CONVERTER:
- system: windows
then: 'flinux'
- else: ~
download_url: 'https://github.com/ice-black-tea/archives/releases/download/compact_dex_converter-{version}/compact_dex_converter.zip'
download_url: 'https://github.com/linktools-toolkit/archives/releases/download/compact_dex_converter-{version}/compact_dex_converter.zip'
unpack_path: 'compact_dex_converter-{version}'
target_path:
when:
Expand Down Expand Up @@ -381,16 +381,16 @@ TOOL_HDC:
when:
- system: darwin
machine: arm64
then: 'https://github.com/ice-black-tea/archives/releases/download/harmonyos-toolchains-{version}/toolchains-macos-arm64.zip'
then: 'https://github.com/linktools-toolkit/archives/releases/download/harmonyos-toolchains-{version}/toolchains-macos-arm64.zip'
- system: darwin
machine: x86_64
then: 'https://github.com/ice-black-tea/archives/releases/download/harmonyos-toolchains-{version}/toolchains-macos-x64.zip'
then: 'https://github.com/linktools-toolkit/archives/releases/download/harmonyos-toolchains-{version}/toolchains-macos-x64.zip'
- system: linux
machine: x86_64
then: 'https://github.com/ice-black-tea/archives/releases/download/harmonyos-toolchains-{version}/toolchains-linux-x64.zip'
then: 'https://github.com/linktools-toolkit/archives/releases/download/harmonyos-toolchains-{version}/toolchains-linux-x64.zip'
- system: windows
machine: amd64
then: 'https://github.com/ice-black-tea/archives/releases/download/harmonyos-toolchains-{version}/toolchains-windows-x64.zip'
then: 'https://github.com/linktools-toolkit/archives/releases/download/harmonyos-toolchains-{version}/toolchains-windows-x64.zip'
- else: ~
unpack_path: 'harmony-toolchains-{version}'
target_path:
Expand All @@ -409,7 +409,7 @@ TOOL_FLINUX:
download_url:
when:
- system: windows
then: 'https://github.com/ice-black-tea/archives/releases/download/flinux-{version}/flinux.zip'
then: 'https://github.com/linktools-toolkit/archives/releases/download/flinux-{version}/flinux.zip'
- else: ~
unpack_path: 'flinux-{version}'
target_path:
Expand Down

0 comments on commit cb19176

Please sign in to comment.