build: remove docker (#3423)

This commit is contained in:
Connor Tumbleson 2023-11-08 06:44:46 -05:00 committed by GitHub
parent 9e9079d30f
commit 4441648192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 187 deletions

View File

@ -1,3 +0,0 @@
./docker
./github
*.md

View File

@ -1,46 +0,0 @@
name: Build and push docker (beta)
on:
push:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: ibotpeaches/apktool
jobs:
build_and_push:
name: Build and push
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get hash
id: hash
run: echo "APKTOOL_HASH=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
file: ./docker/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.APKTOOL_HASH }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:snapshot

View File

@ -1,48 +0,0 @@
name: Build and push docker (release)
on:
release:
types: [published]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ibotpeaches/apktool
jobs:
build_and_push:
name: Build and push
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get hash
id: hash
run: echo "APKTOOL_HASH=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
- name: Get release tag
id: tag
run: echo "APKTOOL_TAG=$(echo ${GITHUB_REF:-no-tag} |sed 's|refs/tags/||g')" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
file: ./docker/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.APKTOOL_TAG }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

View File

@ -21,7 +21,6 @@ If you discover a security vulnerability within Apktool, please send an e-mail t
- [Downloads Mirror](https://connortumbleson.com/apktool/)
- [How to Build](https://ibotpeaches.github.io/Apktool/build/)
- [Documentation](https://ibotpeaches.github.io/Apktool/documentation/)
- [Use in Docker](./docker/README.md)
- [Bug Reports](https://github.com/iBotPeaches/Apktool/issues)
- [Changelog/Information](https://ibotpeaches.github.io/Apktool/changes/)
- [XDA Post](https://forum.xda-developers.com/t/util-dec-2-2020-apktool-tool-for-reverse-engineering-apk-files.1755243/)

View File

@ -1,62 +0,0 @@
# BUILDER
# =====================================================
FROM ibm-semeru-runtimes:open-17-jdk-jammy AS builder
COPY . /build
WORKDIR /build
RUN \
# Apktool
./gradlew build shadowJar proguard
RUN \
# Relocate for easier copying
JAR=$(find /build/brut.apktool/apktool-cli/build/libs/apktool-*.jar |grep -v cli-all) &&\
mv ${JAR} /build/apktool.jar
# BASE
# =====================================================
FROM ibm-semeru-runtimes:open-17-jre-jammy AS base
# Latest version as of 2023.10.01
# Ref: https://developer.android.com/studio/index.html#command-line-tools-only
ARG COMMAND_LINE_TOOLS_VERSION=10406996
ARG ANDROID_SDK_ROOT=/opt/android-sdk
COPY --from=builder /build/apktool.jar /usr/local/bin/apktool.jar
COPY --from=builder /build/scripts/linux/apktool /usr/local/bin/apktool
RUN \
# Update
apt-get update &&\
\
# Apktool final setup
chmod +x /usr/local/bin/apktool /usr/local/bin/apktool.jar &&\
\
# Android SDK
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
zipalign \
git \
openssl \
wget \
unzip \
sdkmanager &&\
curl -o /tmp/tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${COMMAND_LINE_TOOLS_VERSION}_latest.zip &&\
mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools &&\
unzip -q /tmp/tools.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools &&\
mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/latest &&\
rm -v /tmp/tools.zip &&\
mkdir -p /root/.android/ && touch /root/.android/repositories.cfg &&\
yes | sdkmanager --licenses &&\
export BUILD_TOOLS_VERSION=$(sdkmanager --list |grep build-tools |grep -v rc |awk '{print $1}' |sed 's/build-tools;//g' |sort |tail -n1) &&\
sdkmanager --install "build-tools;${BUILD_TOOLS_VERSION}" &&\
ln -s ${ANDROID_SDK_ROOT}/build-tools/${BUILD_TOOLS_VERSION} /opt/bin &&\
\
# Cleanup
rm -rf /var/lib/apt/lists/*
ENV PATH ${PATH}:/opt/bin
CMD ["/usr/local/bin/apktool"]

View File

@ -1,27 +0,0 @@
# Apktool in Docker
We provide an easy way to leverage `apktool`, along with common Android tools such as `zipalign` and `apksigner`, all from within Docker.
## Building the Docker image
To use the image, pull the pre-built image or build one from the repo root with the included Dockerfile:
```bash
docker pull ghcr.io/ibotpeaches/apktool:latest
# OR
docker build -t apktool:local -f docker/Dockerfile .
```
## Using the Docker image
The best way to use the image is to create aliases to run the internal commands. Replace `ghcr.io/ibotpeaches/apktool:latest` with `apktool:local` if you have built the image locally.
```bash
alias apktool="docker run --rm -ti --name=apktool -v \"${PWD}:${PWD}\" -w \"${PWD}\" ghcr.io/ibotpeaches/apktool:latest apktool"
alias zipalign="docker run --rm -ti --name=zipalign -v \"${PWD}:${PWD}\" -w \"${PWD}\" ghcr.io/ibotpeaches/apktool:latest zipalign"
alias apksigner="docker run --rm -ti --name=apksigner -v \"${PWD}:${PWD}\" -w \"${PWD}\" ghcr.io/ibotpeaches/apktool:latest apksigner"
```
## Running the commands
You can then utilize these commands as you would if they were natively installed:
```bash
apktool d My.apk -o MyFolder
apktool b MyFolder -o MyNew.apk
zipalign -p -f 4 MyNew.apk MyNewAligned.apk
apksigner sign --ks My.keystore MyNewAligned.apk
```