Skip to content

Commit

Permalink
Merge branch 'feature/gh-actions'
Browse files Browse the repository at this point in the history
  • Loading branch information
PurplProto committed Feb 22, 2024
2 parents a6b0512 + 2743769 commit 4b6419d
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build]
rustflags = ["-C", "target-feature=+crt-static"]
target = "aarch64-linux-android"

[profile.release]
strip = true
codegen-units = 1
lto = true
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build release

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to build'
required: true
push:
tags:
- v**

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install cargo-ndk
run: cargo install cargo-ndk

- name: Install Rust targets for Android
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

- name: Build aarch64-linux-android
env:
RUSTFLAGS: -C target-feature=+crt-static
run: cargo ndk -t aarch64-linux-android -p 33 build --release

- name: Build armv7-linux-androideabi
env:
RUSTFLAGS: -C target-feature=+crt-static
run: cargo ndk -t armv7-linux-androideabi -p 33 build --release

- name: Build i686-linux-android
env:
RUSTFLAGS: -C target-feature=+crt-static
run: cargo ndk -t i686-linux-android -p 33 build --release

- name: Build x86_64-linux-android
env:
# Currently unable to build statically for x86_64-linux-android, ensure that the target is built with the correct flags
RUSTFLAGS: ""
run: cargo ndk -t x86_64-linux-android -p 33 build --release

- name: Create release
uses: softprops/action-gh-release@v1
with:
files: |
target/aarch64-linux-android/release/apbf
target/armv7-linux-androideabi/release/apbf
target/i686-linux-android/release/apbf
target/x86_64-linux-android/release/apbf
tag_name: ${{ github.event.inputs.tag || github.ref }}
generate_release_notes: true
88 changes: 48 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "android-pin-brute-force"
name = "apbf"
authors = ["PurplProto"]
version = "0.1.0"
version = "0.1.1"
edition = "2021"
description = "A tool to brute force the PIN of an Android device."

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.4.18", features = ["derive"] }
clap = { version = "4.5.1", features = ["derive"] }
crossterm = "0.27.0"
ctrlc = { version = "3.4.2", features = ["termination"] }
log = "0.4.20"
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,18 @@ Due to some odd dynamic linker issues in the Nethunter chroot while testing, the
1. Install Rust: [https://www.rust-lang.org/tools/install](rustup)
2. Install the Android [https://developer.android.com/tools/sdkmanager](sdkmanager)
3. Install NDK using Android sdkmanager: `sdkmanager "platforms;android-33" "ndk;25.2.9519653"`
4. Export `ANDROID_NDK_HOME` with the path of the NDK folder, you can find more [guidance here](https://github.com/bbqsrc/cargo-ndk). I suggest adding this variable to your `.bashrc`.
4. Export `ANDROID_NDK_HOME` with the path of the NDK install folder, you can find more [guidance here](https://github.com/bbqsrc/cargo-ndk). I suggest adding this variable to your `.bashrc`.
5. Clone this repo
6. Open a shell and cd into the cloned repo
7. Execute `cargo ndk -t arm64-v8a -p 33 build --release`
- Or for a statically linked binary do `export RUSTFLAGS="-C target-feature=+crt-static" cargo ndk -t arm64-v8a -p 33 build --release` instead
8. Locate the built executable at `target/aarch64-linux-android/release/android-pin-brute-force`

## Downloads
I had troubles getting the dynamically linked builds running in the Nethunter chroot environment, therefore all builds are built statically linked appart from x86_64, I could not get this building statically linked, therefore it is a dynamically linked binary.

You can find the built binaries [on the releases page](https://github.com/PurplProto/android-pin-brute-force/releases/latest).

## Attributions

This project was inspired by these projects:
Expand Down

0 comments on commit 4b6419d

Please sign in to comment.