mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 03:52:11 +08:00
Installer: disable SSH and safer continue.sh write
This commit is contained in:
+10
-3
@@ -123,8 +123,8 @@ static int do_install() {
|
||||
|
||||
|
||||
// Write continue.sh
|
||||
FILE *of = fopen("/data/data/com.termux/files/continue.sh", "wb");
|
||||
assert(of);
|
||||
FILE *of = fopen("/data/data/com.termux/files/continue.sh.new", "wb");
|
||||
if(of == NULL) return 1;
|
||||
|
||||
size_t num = str_continue_end - str_continue;
|
||||
size_t num_written = fwrite(str_continue, 1, num, of);
|
||||
@@ -132,7 +132,14 @@ static int do_install() {
|
||||
|
||||
fclose(of);
|
||||
|
||||
err = system("chmod +x /data/data/com.termux/files/continue.sh");
|
||||
err = system("chmod +x /data/data/com.termux/files/continue.sh.new");
|
||||
if(err) return 1;
|
||||
|
||||
err = rename("/data/data/com.termux/files/continue.sh.new", "/data/data/com.termux/files/continue.sh");
|
||||
if(err == -1) return 1;
|
||||
|
||||
// Disable SSH
|
||||
err = system("setprop persist.neos.ssh 0");
|
||||
if(err) return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user