sets the install chmod perms to 700 properly

This commit is contained in:
Nathan Freitas 2012-01-15 10:43:49 -05:00
parent 675afee9d2
commit 2600519c4d
1 changed files with 4 additions and 13 deletions

View File

@ -34,6 +34,7 @@ public class TorBinaryInstaller implements TorServiceConstants {
Context context; Context context;
private static int isARMv6 = -1; private static int isARMv6 = -1;
private static String CHMOD_EXEC = "700";
public TorBinaryInstaller (Context context, File installFolder) public TorBinaryInstaller (Context context, File installFolder)
{ {
@ -116,7 +117,6 @@ public class TorBinaryInstaller implements TorServiceConstants {
} }
while ((bytecount = stm.read(buffer)) > 0) while ((bytecount = stm.read(buffer)) > 0)
{ {
stmOut.write(buffer, 0, bytecount); stmOut.write(buffer, 0, bytecount);
@ -229,26 +229,17 @@ public class TorBinaryInstaller implements TorServiceConstants {
File file = new File(ctx.getDir("bin",0), "iptables"); File file = new File(ctx.getDir("bin",0), "iptables");
if ((!file.exists()) && isARMv6()) { if ((!file.exists()) && isARMv6()) {
copyRawFile(ctx, R.raw.iptables_g1, file, "755"); copyRawFile(ctx, R.raw.iptables_g1, file, CHMOD_EXEC);
changed = true; changed = true;
} }
// Check iptables_n1 // Check iptables_n1
file = new File(ctx.getDir("bin",0), "iptables"); file = new File(ctx.getDir("bin",0), "iptables");
if ((!file.exists()) && (!isARMv6())) { if ((!file.exists()) && (!isARMv6())) {
copyRawFile(ctx, R.raw.iptables_n1, file, "755"); copyRawFile(ctx, R.raw.iptables_n1, file, CHMOD_EXEC);
changed = true; changed = true;
} }
// Check busybox
/*
file = new File(ctx.getDir("bin",0), "busybox_g1");
if (!file.exists()) {
copyRawFile(ctx, R.raw.busybox_g1, file, "755");
changed = true;
}
*/
return true; return true;
} }