From cb191765576b2c00d792194985237b0304496f70 Mon Sep 17 00:00:00 2001
From: huji <669898595@qq.com>
Date: Mon, 23 Dec 2024 10:46:49 +0800
Subject: [PATCH] add .version file
---
.github/workflows/python-publish.yml | 11 +++++++----
README.md | 16 ++++++++--------
agents/android/build.gradle | 2 +-
pyproject.toml | 4 ++--
setup.py | 12 +++++++++++-
src/linktools/template/tools.yml | 22 +++++++++++-----------
6 files changed, 40 insertions(+), 27 deletions(-)
diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml
index b9b06d7c..b9f0d824 100644
--- a/.github/workflows/python-publish.yml
+++ b/.github/workflows/python-publish.yml
@@ -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
@@ -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
@@ -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 }})"
diff --git a/README.md b/README.md
index 9a5c36b6..5ec61757 100644
--- a/README.md
+++ b/README.md
@@ -14,10 +14,10 @@ python & pip (3.6及以上):
# 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(推荐)
@@ -114,7 +114,7 @@ $ ct-env clean 7
类似linux中的grep,正则匹配文件内容 ,额外添加解析zip、elf等格等功能
-![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)
@@ -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命令
@@ -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)
@@ -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
@@ -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
@@ -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 () {
diff --git a/agents/android/build.gradle b/agents/android/build.gradle
index c9e41b91..a64bf1ce 100644
--- a/agents/android/build.gradle
+++ b/agents/android/build.gradle
@@ -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/" }
}
}
diff --git a/pyproject.toml b/pyproject.toml
index 6f10b218..57c3bb64 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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"]
diff --git a/setup.py b/setup.py
index 8c5513c7..ecdf049e 100755
--- a/setup.py
+++ b/setup.py
@@ -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:
diff --git a/src/linktools/template/tools.yml b/src/linktools/template/tools.yml
index 44ea0989..172a6b79 100644
--- a/src/linktools/template/tools.yml
+++ b/src/linktools/template/tools.yml
@@ -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
@@ -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:
@@ -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:
@@ -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:
@@ -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: