mirror of
https://github.com/vxunderground/VXUG-Papers.git
synced 2026-06-17 00:09:29 +00:00
30 lines
467 B
Go
30 lines
467 B
Go
package common
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
var ManifestBinaryPath, _ = filepath.Abs("AndroidManifest.xml")
|
|
|
|
func WriteChanges(raw []byte, path string) {
|
|
//Open a new file for writing only
|
|
file, err := os.OpenFile(
|
|
path,
|
|
os.O_WRONLY|os.O_TRUNC|os.O_CREATE,
|
|
0666,
|
|
)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
defer file.Close()
|
|
|
|
// Write bytes to file
|
|
_, err = file.Write(raw)
|
|
if err != nil {
|
|
log.Panic("Failed to write changes to disk", err)
|
|
}
|
|
}
|
|
|