Add files via upload

This commit is contained in:
vxunderground
2020-10-11 00:40:44 -05:00
committed by GitHub
parent e1d25298f4
commit ad3ed5a13f
20 changed files with 5942 additions and 0 deletions
@@ -0,0 +1,55 @@
// author: Thatskriptkid (www.orderofsixangles.com)
// You can use my kaitai struct for binary manifest.
// https://github.com/thatskriptkid/Kaitai-Struct-Android-Manifest-binary-XML
package main
import (
"common"
mydex "dex"
"encoding/xml"
"fmt"
"log"
"manifest"
"os"
)
func main() {
//setup logging
logFile, err := os.OpenFile("apkinfector.log", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
if err != nil {
log.Fatal(err)
}
defer logFile.Close()
log.SetOutput(logFile)
manifestPlainFile, err := os.Create(manifest.PlainPath) // create/truncate the file
if err != nil {
log.Panic("Failed to create AndroidManifest plaintext", err)
}
enc := xml.NewEncoder(manifestPlainFile)
enc.Indent("", "\t")
fmt.Println("Parsing APK...")
manifest.ParseApk(os.Args[1], enc)
//close before reading
manifestPlainFile.Close()
fmt.Println("Patching APK")
fmt.Println("\t--Patching manifest...")
manifest.Patch()
fmt.Println("\t--Patching dex...")
mydex.Patch()
fmt.Println("Injecting...")
common.Inject(os.Args[1], os.Args[2])
fmt.Println("Done! Now you should sign your apk")
}