How sjj1024/pakeplus-android works
Purpose and Scope
This repository is the Android packaging template for PakePlus: it produces a native Android wrapper around packaged web content, including optional injected JavaScript and debugging assets. It is intended to be forked and built through GitHub Actions as part of PakePlus’s cloud packaging flow.
Build and Delivery Entry Points
• Gradle defines the Android application build: settings.gradle.kts, build.gradle.kts, app/build.gradle.kts.
• The Android runtime starts from app/src/main/AndroidManifest.xml and app/src/main/java/com/app/pakeplus/MainActivity.kt.
• Node/pnpm scripts provide asset-processing or packaging support: package.json, scripts/ppworker.cjs, scripts/optimize_assets.sh.
• CI/release automation is defined in .github/workflows/build.yml and the reusable back-end workflow files under .github/back/.
Native Android Shell
The app module is a Kotlin/AndroidX application shell built around a drawer/navigation template.
• MainActivity is the native entry point and host for the app’s navigation/UI container: app/src/main/java/com/app/pakeplus/MainActivity.kt.
• The main activity composition is resource-driven: app/src/main/res/layout/activity_main.xml, app/src/main/res/layout/content_main.xml, app/src/main/res/navigation/mobile_navigation.xml.
• Android manifest and resource boundaries separate native lifecycle, permissions/configuration, and UI from packaged web assets: app/src/main/AndroidManifest.xml, app/src/main/res/xml/.
Screen and Navigation Layer
The shell has three Android Fragment/ViewModel screen pairs, likely retained from the standard navigation template and serving as native host surfaces around the packaged experience.
• Home: app/src/main/java/com/app/pakeplus/ui/home/HomeFragment.kt, app/src/main/java/com/app/pakeplus/ui/home/HomeViewModel.kt.
• Gallery: app/src/main/java/com/app/pakeplus/ui/gallery/GalleryFragment.kt, app/src/main/java/com/app/pakeplus/ui/gallery/GalleryViewModel.kt.
• Slideshow: app/src/main/java/com/app/pakeplus/ui/slideshow/SlideshowFragment.kt, app/src/main/java/com/app/pakeplus/ui/slideshow/SlideshowViewModel.kt.
Navigation destinations and drawer menu definitions are decoupled from Kotlin code in app/src/main/res/navigation/mobile_navigation.xml and app/src/main/res/menu/activity_main_drawer.xml.
Web Payload and Customization Boundary
Web content is embedded as Android assets, making the APK self-contained rather than dependent on a hosted frontend.
• Primary configurable assets: app/src/main/assets/app.json, app/src/main/assets/custom.js, app/src/main/assets/pppwd.html.
• custom.js is the explicit application-to-web customization boundary; it supports user-provided JavaScript injection.
• vConsole.js provides an embedded client-side debugging facility: app/src/main/assets/vConsole.js.
• Script-side equivalents suggest assets are assembled or transformed before inclusion: scripts/assets/index.html, scripts/assets/custom.js, scripts/www/pppwd.html.
Packaged Artifacts and Reference Payloads
packages/ contains unpacked Android package contents and a ZIP payload, rather than maintainable application source.
• packages/Payload/ includes a compiled Android resource/assets payload with a static web bundle under packages/Payload/assets/.
• packages/fuap/ is a much larger extracted Android application payload containing Lua projects, templates, native libraries, Firebase metadata, and OkHttp resources; its application-level assets are under packages/fuap/assets/.
• Treat these directories as binary/generated or reference packaging inputs unless build scripts explicitly consume them; source changes should primarily target app/ and scripts/.
Runtime, Infrastructure, and External Services
Runtime is Android/Kotlin with AndroidX Navigation, lifecycle ViewModels, Material UI, and coroutine dependencies evidenced by the Android payload metadata. Build infrastructure is Gradle plus Node/pnpm, with GitHub Actions used for cloud compilation and releases. The product workflow depends on GitHub APIs and a user-provided GitHub token for repository forking, workflow execution, and release publishing; no application backend is represented in the source tree.
Main entry points: app.json App configuration · build.yml GitHub Actions build · app/build.gradle.kts App module build · build.gradle.kts Gradle build
Components 19
Build & automation
- Gradle build
build.gradle.kts - App module build
app/build.gradle.kts - Asset tooling
scripts/ppworker.cjs - GitHub Actions build
.github/workflows/build.yml - Reusable release workflows
.github/back/build.yml
Android shell
- Android manifest · Declares lifecycle, permissions, and application configuration.
app/src/main/AndroidManifest.xml - Main activity
app/src/main/java/com/app/pakeplus/MainActivity.kt - Native UI container
app/src/main/res/layout/activity_main.xml - Drawer navigation
app/src/main/res/navigation/mobile_navigation.xml - Fragment screens · Home, gallery, and slideshow host surfaces.
app/src/main/java/com/app/pakeplus/ui/home/HomeFragment.kt - Screen ViewModels
app/src/main/java/com/app/pakeplus/ui/home/HomeViewModel.kt
Embedded web payload
- App configuration
app/src/main/assets/app.json - Injected JavaScript · User-provided web customization boundary.
app/src/main/assets/custom.js - vConsole debug asset
app/src/main/assets/vConsole.js - Password web page
app/src/main/assets/pppwd.html - Asset source templates
scripts/assets/index.html
Reference payloads
Generated or extracted package contents.
- Compiled payload · Unpacked resource and web-bundle payload.
packages/Payload/AndroidManifest.xml - FUAP extracted package · Extracted Android application payload and native resources.
packages/fuap/AndroidManifest.xml
Other components
- GitHub packaging flow · Forking, workflow execution, and release publishing use a user token.
Connections 19
- Gradle build → App module build: configures
- App module build → Android manifest: packages
- App module build → App configuration: embeds
- Android manifest → Main activity: launches
- Main activity → Native UI container: hosts
- Native UI container → Drawer navigation: uses
- Drawer navigation → Fragment screens: selects destinations
- Fragment screens → Screen ViewModels: uses
- Asset tooling → Asset source templates: processes
- Asset source templates → App configuration: assembles
- Injected JavaScript → App configuration: included with
- vConsole debug asset → App configuration: included with
- Password web page → App configuration: included with
- GitHub Actions build → Gradle build: runs build
- GitHub Actions build → Asset tooling: runs tooling
- Reusable release workflows → GitHub Actions build: reused by
- GitHub packaging flow → GitHub Actions build: triggers and publishes
- Compiled payload → App configuration: reference only
- FUAP extracted package → App configuration: reference only