Skip to content

Commit

Permalink
fix: SafetyNet pass
Browse files Browse the repository at this point in the history
feat(docker): Docker container for build Magisk module
  • Loading branch information
frnode committed May 17, 2022
1 parent dc3ec64 commit 867f75b
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v2.3.0 (Zygisk)

**This version only supports Zygisk. See v2.1.3 for a Riru version.**

- Fixed fingerprint scanner
- Fixed SafetyNet Pass (now "pass" all verifications)
- Add Docker container for build Magisk module (only Zygisk tested)

# v2.2.1 (Zygisk)

**This version only supports Zygisk. See v2.1.3 for a Riru version.**
Expand Down
55 changes: 55 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM ubuntu:latest

WORKDIR /

SHELL ["/bin/bash", "-c"]

# To avoid "tzdata" asking for geographic area
ARG DEBIAN_FRONTEND=noninteractive

# Version of tools:
# In Code
ARG GRADLE_VERSION=7.0.2
ARG ANDROID_API_LEVEL=32
# https://developer.android.com/studio/releases/build-tools
ARG ANDROID_BUILD_TOOLS_LEVEL=32.0.0
# https://developer.android.com/ndk/downloads
ARG ANDROID_NDK_VERSION=21.4.7075529
# https://developer.android.com/studio/
ARG ANNDROID_CMD_LINE_TOOLS=linux-8512546_latest

# Dependencies and needed tools
RUN apt update -qq && apt install -qq -y cmake zip file openjdk-11-jdk vim git unzip libglu1 libpulse-dev libasound2 libc6 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxi6 libxtst6 libnss3 wget

# Download gradle, install gradle and gradlew
RUN wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp
RUN unzip -q -d /opt/gradle /tmp/gradle-${GRADLE_VERSION}-bin.zip
RUN mkdir /opt/gradlew
RUN touch /opt/gradlew/settings.gradle
RUN /opt/gradle/gradle-${GRADLE_VERSION}/bin/gradle wrapper --gradle-version ${GRADLE_VERSION} --distribution-type all -p /opt/gradlew
RUN /opt/gradle/gradle-${GRADLE_VERSION}/bin/gradle wrapper -p /opt/gradlew

# Download commandlinetools
RUN mkdir /opt/android
RUN mkdir /opt/android/cmdline-tools
RUN wget -q https://dl.google.com/android/repository/commandlinetools-${ANNDROID_CMD_LINE_TOOLS}.zip -P /tmp
RUN unzip -q -d /opt/android/cmdline-tools /tmp/commandlinetools-${ANNDROID_CMD_LINE_TOOLS}.zip

# install packages and accept all licenses
# cmdline-tools/cmdline-tools - the second "cmdline-tools" is the folder in the zip file
RUN yes Y | /opt/android/cmdline-tools/cmdline-tools/bin/sdkmanager --install "build-tools;${ANDROID_BUILD_TOOLS_LEVEL}" "platforms;android-${ANDROID_API_LEVEL}" "platform-tools" "ndk;${ANDROID_NDK_VERSION}" \
&& yes Y | /opt/android/cmdline-tools/cmdline-tools/bin/sdkmanager --licenses

# Environment variables to be used for build
ENV GRADLE_HOME=/opt/gradle/gradle-$GRADLE_VERSION
ENV ANDROID_HOME=/opt/android
ENV ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}
ENV PATH "$PATH:$GRADLE_HOME/bin:/opt/gradlew:$ANDROID_HOME/emulator:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_HOME/platform-tools:${ANDROID_NDK_HOME}"
ENV LD_LIBRARY_PATH "$ANDROID_HOME/emulator/lib64:$ANDROID_HOME/emulator/lib64/qt/lib"

# Clean up
RUN rm /tmp/gradle-${GRADLE_VERSION}-bin.zip \
&& rm /tmp/commandlinetools-${ANNDROID_CMD_LINE_TOOLS}.zip

# Create folder work
RUN mkdir /opt/safetynet-fix
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ debug_mode=1
if [[ "$build_mode" == "release" ]]; then
debug_mode=0
fi
$HOME/code/android/sdk/ndk/21.4.7075529/ndk-build -j48 NDK_DEBUG=$debug_mode
$ANDROID_NDK_HOME/ndk-build -j48 NDK_DEBUG=$debug_mode
popd

pushd java
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.9"

services:
android-build:
build:
context: .
dockerfile: ./Dockerfile

working_dir: /opt/safetynet-fix
command: ['bash', 'build.sh']
# debug
# command: ['bash', '-c', 'while sleep 1000; do :; done']
volumes:
- ./:/opt/safetynet-fix
2 changes: 1 addition & 1 deletion java/gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

#
# Copyright 2015 the original author or authors.
Expand Down
4 changes: 2 additions & 2 deletions magisk/module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=safetynet-fix
name=Universal SafetyNet Fix
version=v2.2.1
versionCode=20201
version=v2.3.0
versionCode=20300
author=kdrag0n, frnode
description=A universal fix for SafetyNet on Android 8–12 devices with hardware attestation and unlocked bootloaders.
updateJson=https://raw.githubusercontent.com/frnode/safetynet-fix/master/update.json
6 changes: 3 additions & 3 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "v2.2.1",
"versionCode": 20201,
"zipUrl": "https://github.com/frnode/safetynet-fix/releases/download/v2.2.1/safetynet-fix-v2.2.1.zip",
"version": "v2.3.0",
"versionCode": 20300,
"zipUrl": "https://github.com/frnode/safetynet-fix/releases/download/v2.3.0/safetynet-fix-v2.3.0.zip",
"changelog": "https://raw.githubusercontent.com/frnode/safetynet-fix/master/CHANGELOG.md"
}
2 changes: 1 addition & 1 deletion zygisk/gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

#
# Copyright 2015 the original author or authors.
Expand Down

0 comments on commit 867f75b

Please sign in to comment.