How oasisvee/my-plugins works
Project Type and Purpose
• This is a multi‑module Gradle project targeting the Android‑based Aliucord client. It contains two independent Aliucord plugins:
a. Sed – a port of the original Sed command‑line‑style message replacement plugin, enhanced for case‑insensitive matching.
b. CatUITH – a fork of UITH focused on Catbox (and other hosts) upload functionality, with custom settings, JSON config, theme toggle, and album mode support.
File Structure Analysis
• Root Level
• settings.gradle.kts, build.gradle.kts, gradle/ wrapper, gradlew scripts – define a multi‑project Gradle build.
• .github/workflows/build.yml – CI build pipeline.
• Subprojects
• CatUITH/ – Kotlin‑based Aliucord plugin module.
– src/main/AndroidManifest.xml (plugin manifest)
– com.serinova.plugins.UITH.kt (core plugin entry point)
– Settings.kt, Utils.kt – settings UI and helper functions
• Sed/ – Java‑based Aliucord plugin module.
– src/main/AndroidManifest.xml
– Plugin.java (entry point), Command.java (command implementation), ParserState.java (state machine for s///), Settings.java
Key Architectural Insights from README
• Both modules adhere to the Aliucord plugin API: each exposes a manifest, an entry‑point class that registers commands or hooks, and a settings screen.
• CatUITH integrates with external HTTP APIs (Catbox and other hosts) for file uploading; it uses JSON‑based plugin configuration.
• Sed plugin focuses purely on text transformation within the host app, no external services.
a. Main Components
1. Android OS / Runtime – hosts the Aliucord client APK.
2. Aliucord Host App – a modified Discord client that loads plugins. Contains:
– Plugin Manager (discovery, lifecycle)
– UI Shell (message input/output areas)
3. Plugin Modules – two separate modules:
• Sed Plugin
– EntryPoint (Plugin.java)
– Command Processor (Command.java)
– ParserState
– Settings UI
• CatUITH Plugin
– EntryPoint (UITH.kt)
– Upload Manager (Utils.kt)
– Settings UI (Settings.kt)
– JSON Config Handler
4. External Services (CatUITH only)
– Catbox API (upload endpoint)
– Other hosts (as preserved from UITH)
5. CI/CD Pipeline
– GitHub Actions (build.yml)
b. Relationships & Interactions
• Android OS loads Aliucord App → App initializes Plugin Manager → Discovers both plugins via their manifests.
• On user action:
• Sed: user types “/sed ...” → Sed Plugin’s Command Processor intercepts → ParserState transforms message → plugin returns edited text to Aliucord UI.
• CatUITH: user invokes “/cuith” commands → CatUITH’s Upload Manager (Utils.kt) reads JSON config → performs HTTP POST to Catbox → returns URL to UI.
• Settings UI in each plugin writes to local storage (SharedPreferences or JSON) and feeds configuration back to the plugin at runtime.
c. Architectural Patterns & Principles
• Plugin Architecture / Inversion of Control: host app defines interfaces/hooks, plugins implement them.
• Single Responsibility: separate entry‑point, command/parser logic, settings UI, and utilities.
• Modularity: two independent Gradle subprojects, share only the Aliucord API.
• External Integration Layer (CatUITH) encapsulates HTTP calls and JSON handling.
d. Key Technologies & Frameworks
• Kotlin (CatUITH), Java (Sed)
• Android SDK (manifests, UI)
• Aliucord Plugin API
• Gradle Kotlin DSL (build scripts)
• GitHub Actions for CI
• JSON for plugin configuration
• HTTP libraries (OkHttp or similar) for uploads