mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-11 04:12:07 +08:00
Installer: disable SSH and safer continue.sh write
old-commit-hash: 6f703eaf4e
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;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0ca0e294eca65b0c787c9f64ff1c05481e56b5ee6a14fd3996d91db96a39d249
|
||||
oid sha256:405521bd1d24415808f724d1f81d2ce0bdaf2db5f844fcba1d9b9b3a3b364429
|
||||
size 538912
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:009e09b2d145e1bbeadf426ad669ae505bb659fa489c9724b288d8458da65819
|
||||
oid sha256:0e17adb56d6fd3e8797360b314a911f4567f27e739e230ccb326049bfa453890
|
||||
size 538912
|
||||
|
||||
Reference in New Issue
Block a user