Skip to content
Permalink
Browse files

Installer: disable SSH and safer continue.sh write

  • Loading branch information
pd0wm committed Jan 20, 2020
1 parent 689d49f commit 6f703eaf4e0de0cbd61d30cb8468004d2949298f
@@ -123,16 +123,23 @@ 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);
if (num != num_written) return 1;

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.

0 comments on commit 6f703ea

Please sign in to comment.
You can’t perform that action at this time.