How trianguloy/urlcheck works
Main Components
• Android Application Framework – Representing the overall Android runtime and app lifecycle (managed via Gradle, AndroidManifest.xml, etc.).
• Presentation Layer – This includes all the Activities (such as MainActivity, AboutActivity, AutomationActivity, SettingsActivity, etc.), Fragments (like BrowserButtonsFragment), and Dialogs (e.g., MainDialog). All UI elements and layouts (from app/src/main/res/layout, menu, drawable, XML resources) fall under this category.
• Module/Business Logic Layer – Represented by the “modules” package, which encompasses a wide range of modules (both in “list” and “companions” packages). The ModuleManager and individual module components (like ClearUrlModule, DebugModule, UnshortenModule, etc.) encapsulate the core logic for URL manipulation, tracker removal, affiliate cleaning, and additional features.
• Service and Helper Layer – This covers background or cross-cutting concerns such as services (“services” package, e.g., CustomTabs) and utility classes (in the “utilities” package and its nested packages like methods, wrappers, generics). These classes provide common functionality like HTTP requests (HttpUtils), URL processing (UrlUtils), or file and preference handling.
• Assets and Configuration – Include the assets folder (with JSON data files like data.minify.json for configurations or backup info) and Gradle build files (build.gradle, settings.gradle, gradle properties, and other configuration scripts in GitHub/workflows).
• External/Integration Services – Technologies like VirusTotal (referenced in modules/companions/VirusTotalUtility) and possibly external APIs or system services are involved in verifying or modifying URLs.
Relationships and Interactions
• The Android runtime initializes the app’s lifecycle components (Activities, Fragments, Dialogs) using configuration provided in the AndroidManifest.xml.
• In the Presentation Layer, when a user interacts (or a URL is captured), the relevant Activity employs the ModuleManager to dispatch the URL into the appropriate business logic modules.
• The ModuleManager controls different individual modules. Each module (e.g., ClearUrlModule, PatternModule, etc.) processes the URL according to its specific functionality (e.g., removing parts of URLs or checking against patterns/hosts).
• Utility classes are used by both the UI and modules to carry out tasks such as HTTP request handling, string manipulation, or interfacing with the Android settings.
• Services like CustomTabs help integrate with external web browsers or APIs (like fetching results from VirusTotal) thereby ensuring that the URL is transformed and verified before routing to external apps.
Architectural Patterns and Design Principles
• Modular Design – Each feature is isolated in its own module package (the “modules” folder and its subdirectories), facilitating plug-and-play capabilities.
• Separation of Concerns – Clear distinction between the UI (activities, fragments, dialogs), the business logic modules (ModuleManager and individual modules), and shared utilities.
• Dependency Inversion – The application likely uses dependency injection or a centralized management (via ModuleManager) to orchestrate operations among modules.
• Use of Standard Android Architectural Patterns – Even if not using a formal MVVM or MVP framework, the project design still conceptually separates view (activities and fragments) from business logic (modules and utilities).