| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 576 * Initializes iptables executable. | 576 * Initializes iptables executable. |
| 577 * | 577 * |
| 578 * @throws FileNotFoundException | 578 * @throws FileNotFoundException |
| 579 * If iptables initialization failed due to provided reasons. | 579 * If iptables initialization failed due to provided reasons. |
| 580 */ | 580 */ |
| 581 private void initIptables() throws IOException, RootToolsException, TimeoutExc eption, FileNotFoundException | 581 private void initIptables() throws IOException, RootToolsException, TimeoutExc eption, FileNotFoundException |
| 582 { | 582 { |
| 583 if (!RootTools.isAccessGiven()) | 583 if (!RootTools.isAccessGiven()) |
| 584 throw new FileNotFoundException("No root access"); | 584 throw new FileNotFoundException("No root access"); |
| 585 | 585 |
| 586 File ipt = getFileStreamPath("iptables"); | 586 File ipt = new File("/system/bin/iptables"); |
|
Felix Dahlke
2015/01/09 18:51:59
It _seems_ like a good idea to always go for iptab
Wladimir Palant
2015/01/13 14:12:33
The concern was mostly that an unknown iptables ve
| |
| 587 if (!ipt.exists()) | |
| 588 { | |
| 589 Log.i(TAG, "iptables not found on the system, using embedded binary"); | |
| 590 ipt = getFileStreamPath("iptables"); | |
| 591 } | |
| 587 | 592 |
| 588 if (!ipt.exists()) | 593 if (!ipt.exists()) |
| 589 { | 594 { |
| 590 Log.e(TAG, "No iptables excutable found"); | 595 Log.e(TAG, "No iptables excutable found"); |
| 591 throw new FileNotFoundException("No iptables executable"); | 596 throw new FileNotFoundException("No iptables executable"); |
| 592 } | 597 } |
| 593 | 598 |
| 594 String path = ipt.getAbsolutePath(); | 599 String path = ipt.getAbsolutePath(); |
| 595 | 600 |
| 596 RootTools.sendShell("chmod 700 " + path, DEFAULT_TIMEOUT); | 601 RootTools.sendShell("chmod 700 " + path, DEFAULT_TIMEOUT); |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 924 @Override | 929 @Override |
| 925 public void log(int level, Object obj, String message) | 930 public void log(int level, Object obj, String message) |
| 926 { | 931 { |
| 927 if (level <= logLevel) | 932 if (level <= logLevel) |
| 928 { | 933 { |
| 929 Log.println(7 - level, obj != null ? obj.toString() : TAG, message); | 934 Log.println(7 - level, obj != null ? obj.toString() : TAG, message); |
| 930 } | 935 } |
| 931 } | 936 } |
| 932 } | 937 } |
| 933 } | 938 } |
| OLD | NEW |