Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: src/org/adblockplus/android/AdvancedPreferences.java

Issue 4705284891082752: Proxy configurators (Closed)
Left Patch Set: FIXME removed Created Aug. 19, 2014, 12:58 p.m.
Right Patch Set: Last batch of review issues Created Aug. 24, 2014, 11:52 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/org/adblockplus/android/AdblockPlus.java ('k') | src/org/adblockplus/android/ConfigurationActivity.java » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 package org.adblockplus.android; 18 package org.adblockplus.android;
19 19
20 import java.util.ArrayList; 20 import java.util.ArrayList;
21 import java.util.List; 21 import java.util.List;
22 22
23 import org.adblockplus.android.compat.ProxyProperties; 23 import org.adblockplus.android.compat.ProxyProperties;
24 import org.adblockplus.android.configurators.IptablesProxyConfigurator; 24 import org.adblockplus.android.configurators.IptablesProxyConfigurator;
25 import org.adblockplus.android.configurators.ProxyRegistrationType;
26 import org.apache.commons.lang.StringUtils; 25 import org.apache.commons.lang.StringUtils;
27 26
28 import android.app.AlertDialog; 27 import android.app.AlertDialog;
29 import android.app.Dialog; 28 import android.app.Dialog;
30 import android.content.DialogInterface; 29 import android.content.DialogInterface;
31 import android.content.Intent; 30 import android.content.Intent;
32 import android.content.SharedPreferences; 31 import android.content.SharedPreferences;
33 import android.os.Build; 32 import android.os.Build;
34 import android.os.Bundle; 33 import android.os.Bundle;
35 import android.preference.Preference; 34 import android.preference.Preference;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 case CONFIGURATION_DIALOG: 175 case CONFIGURATION_DIALOG:
177 final List<String> items = new ArrayList<String>(); 176 final List<String> items = new ArrayList<String>();
178 items.add(AdblockPlus.getDeviceName()); 177 items.add(AdblockPlus.getDeviceName());
179 items.add(String.format("API: %d Build: %d", Build.VERSION.SDK_INT, Adbl ockPlus.getApplication().getBuildNumber())); 178 items.add(String.format("API: %d Build: %d", Build.VERSION.SDK_INT, Adbl ockPlus.getApplication().getBuildNumber()));
180 179
181 final ProxyService proxyService = this.serviceBinder.get(); 180 final ProxyService proxyService = this.serviceBinder.get();
182 181
183 if (proxyService != null) 182 if (proxyService != null)
184 { 183 {
185 items.add(String.format("Local port: %d", proxyService.port)); 184 items.add(String.format("Local port: %d", proxyService.port));
186 if (proxyService.getProxyRegistrationType() == ProxyRegistrationType.I PTABLES) 185 if (proxyService.isIptables())
187 { 186 {
188 items.add("Running in root mode"); 187 items.add("Running in root mode");
189 items.add("iptables output:"); 188 items.add("iptables output:");
190 final List<String> output = IptablesProxyConfigurator.getIptablesOut put(getApplicationContext()); 189 final List<String> output = IptablesProxyConfigurator.getIptablesOut put(getApplicationContext());
191 if (output != null) 190 if (output != null)
192 { 191 {
193 for (final String line : output) 192 for (final String line : output)
194 { 193 {
195 if (StringUtils.isNotEmpty(line)) 194 if (StringUtils.isNotEmpty(line))
196 items.add(line); 195 items.add(line);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 { 249 {
251 dialog.cancel(); 250 dialog.cancel();
252 } 251 }
253 }); 252 });
254 dialog = builder.create(); 253 dialog = builder.create();
255 break; 254 break;
256 } 255 }
257 return dialog; 256 return dialog;
258 } 257 }
259 } 258 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld