Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Commit

Permalink
Add GitHub actions integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaudiuGeorgiu committed Sep 1, 2019
1 parent a9a567c commit f688061
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 4 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Build

on: [push, pull_request]

jobs:

build:

name: Build on Python ${{ matrix.python-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: [3.6, 3.7]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:

- uses: actions/checkout@v1

- name: Set up Java
uses: actions/setup-java@v1
with:
version: 8.0.x

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install -r src/requirements.txt
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
env:
APKTOOL_VERSION: 2.4.0
ANDROID_HOME: /android-sdk
BUILD_TOOLS_VERSION: 29.0.2
run: |
# Android SDK (needed for zipalign).
sudo mkdir -p ${ANDROID_HOME} && wget -q https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
sudo unzip -q sdk-tools-linux-4333796.zip -d ${ANDROID_HOME}
sudo bash -c "echo y | '${ANDROID_HOME}/tools/bin/sdkmanager' 'build-tools;${BUILD_TOOLS_VERSION}'" > /dev/null
# Apktool.
sudo wget -q https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -O /usr/local/bin/apktool
sudo chmod a+x /usr/local/bin/apktool
sudo wget -q "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${APKTOOL_VERSION}.jar" -O /usr/local/bin/apktool.jar
sudo chmod a+x /usr/local/bin/apktool.jar
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
env:
APKTOOL_VERSION: 2.4.0
ANDROID_HOME: C:\android-sdk
BUILD_TOOLS_VERSION: 29.0.2
run: |
REM Android SDK (needed for zipalign).
powershell -Command "$ProgressPreference = 'SilentlyContinue'; wget https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip -OutFile sdk-tools-windows-4333796.zip"
7z x sdk-tools-windows-4333796.zip -o%ANDROID_HOME% > nul
yes | %ANDROID_HOME%\tools\bin\sdkmanager.bat "build-tools;%BUILD_TOOLS_VERSION%" > nul
REM Apktool.
powershell -Command "wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/windows/apktool.bat -OutFile C:\Windows\apktool.bat"
powershell -Command "wget "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_$env:APKTOOL_VERSION.jar" -OutFile C:\Windows\apktool.jar"
- name: Install dependencies (MacOS)
if: matrix.os == 'macOS-latest'
env:
APKTOOL_VERSION: 2.4.0
ANDROID_HOME: /android-sdk
BUILD_TOOLS_VERSION: 29.0.2
run: |
# Android SDK (needed for zipalign).
sudo mkdir -p ${ANDROID_HOME} && wget -q https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip
sudo unzip -q sdk-tools-darwin-4333796.zip -d ${ANDROID_HOME}
sudo bash -c "echo y | '${ANDROID_HOME}/tools/bin/sdkmanager' 'build-tools;${BUILD_TOOLS_VERSION}'" > /dev/null
# Apktool.
sudo wget -q https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/osx/apktool -O /usr/local/bin/apktool
sudo chmod a+x /usr/local/bin/apktool
sudo wget -q "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${APKTOOL_VERSION}.jar" -O /usr/local/bin/apktool.jar
sudo chmod a+x /usr/local/bin/apktool.jar
- name: Check installation
if: matrix.os != 'windows-latest'
env:
ANDROID_HOME: /android-sdk
BUILD_TOOLS_VERSION: 29.0.2
run: |
export PATH="${PATH}:${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}"
cd src
python -m obfuscapk.cli --help
- name: Check installation (Windows)
if: matrix.os == 'windows-latest'
env:
ANDROID_HOME: C:\android-sdk
BUILD_TOOLS_VERSION: 29.0.2
run: |
SET PATH=%PATH%;%ANDROID_HOME%\build-tools\%BUILD_TOOLS_VERSION%
cd src
python -m obfuscapk.cli --help
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
> A black-box obfuscation tool for Android apps.
[![Codacy](https://api.codacy.com/project/badge/Grade/076af5e6284541d39679c96d16d83772)](https://www.codacy.com/app/ClaudiuGeorgiu/Obfuscapk)
[![Actions Status](https://github.com/ClaudiuGeorgiu/Obfuscapk/workflows/Build/badge.svg)](https://github.com/ClaudiuGeorgiu/Obfuscapk/actions)
[![Docker Hub](https://img.shields.io/docker/cloud/build/claudiugeorgiu/obfuscapk)](https://hub.docker.com/r/claudiugeorgiu/obfuscapk)
[![Python Version](https://img.shields.io/badge/Python-3.7-green.svg)](https://www.python.org/downloads/release/python-374/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ClaudiuGeorgiu/Obfuscapk/blob/master/LICENSE)
Expand Down
9 changes: 5 additions & 4 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ RUN bash -c 'for i in {1..8}; do mkdir -p "/usr/share/man/man$i"; done' && \
# Java 8 (needed for apktool and jarsigner).
apt update && apt install --no-install-recommends -y openjdk-8-jdk-headless wget unzip && \
# Android SDK (needed for zipalign).
mkdir -p ${ANDROID_HOME} && wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && \
unzip sdk-tools-linux-4333796.zip -d ${ANDROID_HOME} && \
mkdir -p "${ANDROID_HOME}" && \
wget -q "https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip" && \
unzip -q sdk-tools-linux-4333796.zip -d "${ANDROID_HOME}" && \
rm sdk-tools-linux-4333796.zip && \
yes | sdkmanager "build-tools;${BUILD_TOOLS_VERSION}" && \
# Apktool.
wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool \
wget -q "https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool" \
-O /usr/local/bin/apktool && chmod a+x /usr/local/bin/apktool && \
wget "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${APKTOOL_VERSION}.jar" \
wget -q "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${APKTOOL_VERSION}.jar" \
-O /usr/local/bin/apktool.jar && chmod a+x /usr/local/bin/apktool.jar && \
# Clean.
apt remove --purge -y wget unzip && \
Expand Down

0 comments on commit f688061

Please sign in to comment.