Allow special characters in password
This commit is contained in:
parent
298e7c56da
commit
c0f74a254a
|
@ -3,8 +3,6 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"git.timoxa0.su/timoxa0/lon-tool/image"
|
|
||||||
"git.timoxa0.su/timoxa0/lon-tool/utils"
|
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
@ -12,6 +10,9 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.timoxa0.su/timoxa0/lon-tool/image"
|
||||||
|
"git.timoxa0.su/timoxa0/lon-tool/utils"
|
||||||
|
|
||||||
"github.com/pterm/pterm"
|
"github.com/pterm/pterm"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/timoxa0/goadb/adb"
|
"github.com/timoxa0/goadb/adb"
|
||||||
|
@ -342,9 +343,10 @@ var deployCmd = &cobra.Command{
|
||||||
<-doneChan2
|
<-doneChan2
|
||||||
adbd.KillForwardAll()
|
adbd.KillForwardAll()
|
||||||
|
|
||||||
out, err := adbd.RunCommand(pterm.Sprintf("postinstall %s %s > /dev/null 2>&1; echo $?", username, password))
|
pi_cmd := pterm.Sprintf("postinstall \"%s\" \"%s\" > /dev/null 2>&1; echo $?", username, strings.ReplaceAll(password, "\"", "\\\""))
|
||||||
|
out, err := adbd.RunCommand(pi_cmd)
|
||||||
out = strings.TrimRight(out, "\n")
|
out = strings.TrimRight(out, "\n")
|
||||||
logger.Debug("Postinstall", logger.Args("out", out, "err", err))
|
logger.Debug("Postinstall", logger.Args("cmd", pi_cmd, "out", out, "err", err))
|
||||||
if out != "0" || err != nil {
|
if out != "0" || err != nil {
|
||||||
logger.Error("Postinstall failed. Reflash stock rom and try again", logger.Args("Device error", out, "Go error", err))
|
logger.Error("Postinstall failed. Reflash stock rom and try again", logger.Args("Device error", out, "Go error", err))
|
||||||
} else {
|
} else {
|
||||||
|
|
Reference in a new issue