forked from 17-12-20-ll/googleplay
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
38 lines (36 loc) · 891 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
)
func main() {
_, err := exec.LookPath("frida")
if err != nil {
panic("pip install frida-tools")
}
cache, err := os.UserCacheDir()
if err != nil {
panic(err)
}
cache = filepath.Join(cache, "googleplay")
os.Mkdir(cache, os.ModePerm)
cacheScript := filepath.Join(cache, filepath.Base(script))
if len(os.Args) == 2 {
pack := os.Args[1]
if err := downloadScript(cacheScript); err != nil {
panic(err)
}
server := newServer(version)
cacheServer := filepath.Join(cache, stem(server))
if err := downloadServer(server, cacheServer); err != nil {
panic(err)
}
if err := runCommands(cacheServer, cacheScript, pack); err != nil {
panic(err)
}
} else {
fmt.Println("frida-script [package]")
}
}