Skip to content

Commit

Permalink
fix: use go cert decode
Browse files Browse the repository at this point in the history
  • Loading branch information
zeromake committed Oct 8, 2023
1 parent c598a84 commit 0ce7c7a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ jobs:
xmake --version
- name: cert
run: |
go build script/cert.go
cd project/android
echo "org.gradle.java.home=$JAVA_HOME_11_X64" >> gradle.properties
../../script/cert.sh "${{ secrets.GITHUB_TOKEN }}" cert.tar.xz
../../cert "${{ secrets.GITHUB_TOKEN }}" cert.tar.xz
tar -xf cert.tar.xz
rm cert.tar.xz
ls -lh keystore.properties release.keystore
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/zeromake/onscripter

go 1.16
29 changes: 29 additions & 0 deletions script/cert.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"encoding/base64"
"log"
"os"
)

func main() {
var cert = os.Args[1]
var out = os.Args[2]
bb, err := base64.StdEncoding.DecodeString(cert)
if err != nil {
log.Fatal(err)
}
f, err := os.OpenFile(out, os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
log.Fatal(err)
}
_, err = f.Write(bb)
if err != nil {
log.Fatal(err)
}
err = f.Close()
if err != nil {
log.Fatal(err)
}
log.Println("done")
}

0 comments on commit 0ce7c7a

Please sign in to comment.