File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ async function updateStatus() {
4141}
4242
4343export function escapeShell ( cmd ) {
44- if ( cmd === '' || cmd === null || cmd === undefined ) return "''" ;
45- return "'" + String ( cmd ) . replace ( / ' / g, " '\\''" ) + "'" ;
44+ if ( cmd === '' || cmd === null || cmd === undefined ) return '""' ;
45+ return '"' + cmd . replace ( / [ \\ " $ ` ' [ \] ] / g, '\\$&' ) + '"' ;
4646}
4747
4848function updateSuperkey ( key ) {
@@ -51,11 +51,10 @@ function updateSuperkey(key) {
5151 field . value = key ;
5252 } ) ;
5353 localStorage . setItem ( 'kp-next_superkey' , key ) ;
54- const safeKey = escapeShell ( key ) ;
5554 exec ( `
56- key=${ safeKey }
55+ key=" ${ btoa ( key ) } "
5756 if [ -n "$key" ]; then
58- printf "%s" " $key" | base64 -w0 > /data/adb/kp-next/key
57+ echo " $key" > /data/adb/kp-next/key
5958 if [ -f "${ modDir } /unresolved" ]; then
6059 rm -f "${ modDir } /unresolved"
6160 busybox nohup sh "${ modDir } /service.sh" &
You can’t perform that action at this time.
0 commit comments