diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1a1ee6..7d7cf37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,14 @@ jobs: submodules: "recursive" fetch-depth: 0 + - name: Write key + if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/master' ) || github.ref_type == 'tag' }} + run: | + if [ ! -z "${{ secrets.PRIVATE_KEY }}" ]; then + echo '${{ secrets.PUBLIC_KEY }}' | base64 --decode > module/public_key + echo '${{ secrets.PRIVATE_KEY }}' | base64 --decode > module/private_key + fi + - name: Setup Java uses: actions/setup-java@v3 with: diff --git a/module/build.gradle.kts b/module/build.gradle.kts index 26397ee..4438bd4 100644 --- a/module/build.gradle.kts +++ b/module/build.gradle.kts @@ -84,6 +84,8 @@ androidComponents.onVariants { variant -> from("${project(":loader").buildDir}/intermediates/stripped_native_libs/$variantLowered/out/lib") } + val root = moduleDir.get() + doLast { if (file("private_key").exists()) { println("=== machikado intergity signing ===") @@ -114,7 +116,6 @@ androidComponents.onVariants { variant -> println("getSign for $name $abi32 $abi64") val set = TreeSet> { o1, o2 -> o1.first.path.replace("\\", "/").compareTo(o2.first.path.replace("\\", "/")) } - val root = moduleDir.get() set.add(Pair(root.file("module.prop").asFile, null)) set.add(Pair(root.file("sepolicy.rule").asFile, null)) set.add(Pair(root.file("post-fs-data.sh").asFile, null)) @@ -171,6 +172,9 @@ androidComponents.onVariants { variant -> getSign("machikado.arm", "armeabi-v7a", "arm64-v8a") getSign("machikado.x86", "x86", "x86_64") + } else { + root.file("machikado.arm").asFile.createNewFile() + root.file("machikado.x86").asFile.createNewFile() } fileTree(moduleDir).visit {