-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: xiaoxindada <2245062854@qq.com>
- Loading branch information
1 parent
e205cad
commit b8a6663
Showing
44 changed files
with
2,138 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# How to build the bootctl bundled within the Magisk app: | ||
# | ||
# 1. Checkout and sync the AOSP tree: | ||
# https://source.android.com/setup/build/downloading | ||
# 2. Build for arm64: | ||
# lunch aosp_arm64-eng | ||
# 3. Apply patches: | ||
# cd system/extras; patch -p1 < bootctl.patch | ||
# 4. Build the executable: | ||
# m bootctl | ||
|
||
diff --git a/bootctl/Android.bp b/bootctl/Android.bp | ||
index f63871cf..8a551bbe 100644 | ||
--- a/bootctl/Android.bp | ||
+++ b/bootctl/Android.bp | ||
@@ -26,11 +26,15 @@ cc_binary { | ||
"-Werror", | ||
], | ||
|
||
- shared_libs: [ | ||
+ static_libs: [ | ||
"android.hardware.boot@1.0", | ||
"android.hardware.boot@1.1", | ||
"android.hardware.boot@1.2", | ||
+ ], | ||
+ shared_libs: [ | ||
"libhidlbase", | ||
"libutils", | ||
+ "libcutils", | ||
+ "liblog", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "rustup_wrapper" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
home = "0.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use std::env; | ||
use std::process::{Command, Stdio}; | ||
|
||
use home::cargo_home; | ||
|
||
/******************************** | ||
* Why do we need this wrapper? | ||
******************************** | ||
* | ||
* The command `rustup component list` does not work with custom toolchains: | ||
* > error: toolchain 'magisk' does not support components | ||
* | ||
* However, this command is used by several IDEs to determine available | ||
* components that can be used, such as clippy, rustfmt etc. | ||
* In this script, we simply redirect the output when using the nightly | ||
* channel if any `component` command failed. | ||
*/ | ||
|
||
fn main() -> std::io::Result<()> { | ||
let rustup = cargo_home()?.join("bin").join("rustup"); | ||
let argv: Vec<String> = env::args().skip(1).collect(); | ||
|
||
if argv.iter().any(|s| s == "component") { | ||
let status = Command::new(&rustup) | ||
.args(&argv) | ||
.stdout(Stdio::null()) | ||
.stderr(Stdio::null()) | ||
.status()?; | ||
if !status.success() { | ||
let mut cmd = Command::new(&rustup); | ||
cmd.arg("+nightly"); | ||
if argv[0].starts_with('+') { | ||
cmd.args(argv.iter().skip(1)); | ||
} else { | ||
cmd.args(&argv); | ||
} | ||
return cmd.status().map(|_| ()); | ||
} | ||
} | ||
|
||
// Simply pass through | ||
Command::new(&rustup).args(argv.iter()).status().map(|_| ()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily |
36 changes: 36 additions & 0 deletions
36
tools/termux-elf-cleaner/.github/workflows/attach_termux_elf_cleaner_to_release.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Attach CI-built termux-elf-cleaner to release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
attach-program: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TERMUXBOT2_TOKEN }} | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.GITHUB_REF }} | ||
- name: Check version | ||
run: | | ||
RELEASE_VERSION_NAME="${GITHUB_REF/refs\/tags\//}" | ||
if ! printf "%s" "${RELEASE_VERSION_NAME/v/}" | grep -qP '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'; then | ||
echo "The versionName '${RELEASE_VERSION_NAME/v/}' is not a valid version as per semantic version '2.0.0' spec in the format 'major.minor.patch(-prerelease)(+buildmetadata)'. https://semver.org/spec/v2.0.0.html." | ||
exit 1 | ||
fi | ||
- name: Build | ||
run: | | ||
autoreconf -vfi | ||
mkdir build && cd build | ||
../configure | ||
make | ||
- name: Attach termux-elf-cleaner to release | ||
run: >- | ||
hub release edit | ||
-m "" | ||
-a "./build/termux-elf-cleaner" | ||
"${GITHUB_REF/refs\/tags\//}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build and test termux-elf-cleaner | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.GITHUB_REF }} | ||
|
||
- name: Prepare | ||
run: | | ||
autoreconf -vfi | ||
mkdir build | ||
- name: Configure | ||
run: | | ||
cd build | ||
../configure | ||
- name: Make | ||
run: | | ||
cd build | ||
make | ||
- name: Test | ||
run: | | ||
cd build | ||
make check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# In case of in-src build: | ||
elf-cleaner | ||
# In case of out-of-src build in a directory build/: | ||
build/ | ||
|
||
*~ | ||
|
||
Makefile.in | ||
aclocal.m4 | ||
autom4te.cache/ | ||
compile | ||
configure | ||
depcomp | ||
install-sh | ||
missing |
Oops, something went wrong.