Technical details for understanding and extending the application
The Android Browser Proxy App follows a modular architecture with clear separation of concerns. The main components are:
Handles launching and controlling browser instances
Manages proxy settings and rotation
Connects browser and proxy components
Provides user interaction
Responsible for launching and managing browser instances using Android's Intent system.
public class BrowserManager {
// Launches a browser with specified URL and proxy configuration
public int launchBrowser(String url, ProxyConfig proxyConfig, String browserPackage);
// Closes a browser instance
public boolean closeBrowser(int instanceId);
// Gets a list of all active browser instances
public List<BrowserInstance> getActiveBrowsers();
// Other methods...
}
Handles proxy configuration, testing, and rotation.
public class ProxyManager {
// Gets a free proxy configuration
public ProxyConfig getFreeProxy();
// Gets multiple free proxy configurations
public List<ProxyConfig> getFreeProxies(int count);
// Rotates the proxy for a browser instance
public ProxyConfig rotateProxy(int instanceId);
// Other methods...
}
Integrates browser automation and proxy management.
public class ProxyConfigurationService {
// Launches multiple browser instances with free proxies
public int launchBrowsersWithFreeProxies(String url, String browserPackage, int count);
// Rotates proxies for all active browser instances
public int rotateAllProxies();
// Other methods...
}
Provides the user interface for interacting with the app.
Represents a browser instance with its configuration and status.
public class BrowserInstance {
private int instanceId;
private String browserPackage;
private String currentUrl;
private ProxyConfig proxyConfig;
private BrowserStatus status;
private long launchTime;
// Getters and setters...
}
Represents a proxy configuration with connection details.
public class ProxyConfig {
private String host;
private int port;
private String username;
private String password;
private ProxyType type;
private String country;
private String city;
private long rotationInterval;
// Getters and setters...
}
On non-rooted devices, the app uses system properties to configure proxies:
// Apply proxy configuration
System.setProperty("http.proxyHost", proxyConfig.getHost());
System.setProperty("http.proxyPort", String.valueOf(proxyConfig.getPort()));
System.setProperty("https.proxyHost", proxyConfig.getHost());
System.setProperty("https.proxyPort", String.valueOf(proxyConfig.getPort()));
This approach requires Android 7.0 (API level 24) or higher.
The app includes a FreeProxyProvider
class that manages free proxy retrieval and testing:
public class FreeProxyProvider {
// Gets a list of free proxies
public List<ProxyConfig> getFreeProxies(int count);
// Gets a list of free proxies from a specific country
public List<ProxyConfig> getFreeProxiesByCountry(String country, int count);
// Tests a proxy configuration
public boolean testProxy(ProxyConfig proxyConfig);
}
The app uses Android's Intent system to launch browser instances:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
intent.setPackage(browserPackage);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
The app includes a comprehensive testing framework:
public class AppFunctionalityTest {
// Tests multiple browser instances
public TestResult testMultipleBrowserInstances(String url, String browserPackage, int instanceCount);
// Tests proxy rotation
public TestResult testProxyRotation(String url, String browserPackage, int instanceCount);
// Other test methods...
}
To add a new proxy provider:
FreeProxyProvider
ProxyManager
classThe app already supports common browsers (Chrome, Firefox, Samsung Internet, etc.). To add support for additional browsers:
BrowserManager
classThis developer documentation provides a comprehensive overview of the Android Browser Proxy App's architecture, components, and implementation details. It serves as a guide for understanding, maintaining, and extending the application.