public void listDBProxies(View caller) { TextView textViewTest = new TextView(this); testDBContainer.addView(textViewTest); textViewTest.setTextSize(10); Map<Long, ProxyEntity> savedProxies = App.getDBManager().getAllProxiesWithTAGs(); List<ProxyEntity> list = new ArrayList<ProxyEntity>(savedProxies.values()); for (ProxyEntity p : list) { textViewTest.append(p.toString() + "\n"); } Map<Long, PacEntity> savedPac = App.getDBManager().getAllPac(); List<PacEntity> pacslist = new ArrayList<PacEntity>(savedPac.values()); for (PacEntity p : pacslist) { textViewTest.append(p.toString() + "\n"); } }
private boolean validateBypass() { String value = proxyBypass.getExclusionString(); App.getLogger().d(TAG, "Exclusion list updated: " + value); ProxyStatusItem item = ProxyUtils.isProxyValidExclusionList(value); validationErrors.remove(item.statusCode); if (!item.result) { validationErrors.put(item.statusCode, item.message); return false; } else { selectedProxy.exclusion = value; return true; } }
private boolean validateHost() { String value = proxyHost.getValue(); proxyHost.setError(null); ProxyStatusItem item = ProxyUtils.isProxyValidHostname(value); validationErrors.remove(item.statusCode); if (!item.result) { proxyHost.setError(item.message); validationErrors.put(item.statusCode, item.message); return false; } else { selectedProxy.host = value; return true; } }
private void refreshUI() { if (selectedProxy != null) { proxyInUseBanner.setVisibility(UIUtils.booleanToVisibility(selectedProxy.getInUse())); proxyHost.setValue(selectedProxy.host); if (selectedProxy.port != null && selectedProxy.port != 0) { proxyPort.setValue(selectedProxy.port); } proxyBypass.setExclusionString(selectedProxy.exclusion); // proxyTags.setTags(selectedProxy.getTags()); checkValidation(); } else { // TODO: Add handling here EventReportingUtils.sendException(new Exception("NO PROXY SELECTED")); } }
private boolean validatePort() { Integer value = null; try { value = Integer.parseInt(proxyPort.getValue()); } catch (NumberFormatException e) { value = Integer.MAX_VALUE; } ProxyStatusItem item = ProxyUtils.isProxyValidPort(value); validationErrors.remove(item.statusCode); proxyPort.setError(null); if (!item.result) { proxyPort.setError(item.message); validationErrors.put(item.statusCode, item.message); return false; } else { selectedProxy.port = value; return true; } }