Skip to content
This repository was archived by the owner on Jul 12, 2026. It is now read-only.

Repository files navigation

UnityRP2.0 Header

Kotlin C++ Android ARM64 License

Custom launcher • native code injection • full APK build pipeline


📖 Overview

UnityRP2.0 is a modding project for a Unity-based Android game. It ships a custom launcher with an in-game MOD menu, native code injection, and a complete APK build pipeline.

The build is powered by ApkForge — a toolkit for APK decompilation, modification, and repackaging.

⚠️ Before you use this: this project modifies a third-party game via APK decompilation and native code injection. Make sure you have the right to do so under your jurisdiction and the original game's terms of use.


📁 Project Structure

UnityRP2.0/
│
├── build_config.json          # ApkForge build configuration
├── keystore.json              # APK signing credentials (see Security below)
├── UnityRP.keystore            # Keystore file
│
├── OriginalGame/               # Source APK
│   └── LAC (1.9.4).apk
│
├── src/main/
│   ├── AndroidManifest.xml
│   ├── java/UNITY/ONLINE/      # Kotlin launcher code
│   │   ├── MainActivity.kt
│   │   ├── GameActivity.kt
│   │   ├── RobustDownloadService.kt
│   │   └── ... (12 more files)
│   │
│   ├── cpp/                    # Native C++ injection code
│   │   ├── main.cpp
│   │   ├── CMakeLists.txt
│   │   ├── And64InlineHook/
│   │   ├── Dobby/
│   │   ├── KittyMemory/
│   │   ├── ShadowHook/
│   │   ├── ByteHook/
│   │   └── Il2cpp_Resolver_Android/
│   │
│   └── res/                    # Resources (images, layouts)
│
├── tools/
│   ├── ApkForge/
│   ├── apktool/
│   ├── baksmali/
│   ├── smali/
│   └── Download_Dependencies/
│
└── build.bat / build.sh / build.ps1 / build.py

🚀 Quick Start

Prerequisites

Tool Version
Python 3.8+
Java JDK 8+
Android SDK d8, apksigner, zipalign
CMake + Ninja for native code compilation

Build Instructions

  1. Place the game APK in OriginalGame/:

    OriginalGame/LAC (1.9.4).apk
    
  2. Run the build using any method:

    # Windows
    build.bat
    
    # Linux/macOS
    ./build.sh
    
    # Python (cross-platform)
    python build.py
  3. Get the modded APK from ModdedGame/.


📱 Features

Launcher (MainActivity.kt)

  • ✅ Game start with OBB validation
  • ✅ OBB file download and verification
  • ✅ Internet connection monitoring
  • ✅ Permission management
  • ✅ Error reporting to Telegram (with user consent)
  • ✅ Performance monitoring

Download System

  • ObbManager — validates OBB integrity, manages main.*.obb and UnityBuild4.txt
  • RobustDownloadService — resumable downloads with retry logic (5 attempts), pause/resume, and progress tracking

In-Game MOD Menu (GameActivity.kt)

Overlay with real-time graphics and performance tweaks:

Category Settings
Performance FPS Limit, VSync
Graphics Anti-Aliasing, Anisotropic Filtering
Shadows Distance, Quality, Dynamic Shadows
Render Distance Far Clip Plane
Post Processing Motion Blur, Bloom, Ambient Occlusion, Color Grading, Depth of Field
Scene Lighting, Water
Resolution 720p, 1080p, 1440p

Native Injection (main.cpp)

C++ library loaded by the launcher, built on top of several open-source hooking and reverse-engineering frameworks:

Monitoring & Logging

  • LoggingService — background log capture with smart filtering
  • TelegramLogger — error reporting to Telegram (requires user consent, with rate limiting)
  • PerformanceMonitor / PerformanceOverlay — real-time FPS/memory tracking

🔒 Privacy & User Consent

On first launch, the launcher asks the user for consent before sending any anonymous diagnostic reports. Nothing is sent without consent. If granted, reports may include:

  • device model, Android version, app version
  • crash stack traces
  • app log lines relevant to the error

No personal data is collected. Consent can be reset via ConsentManager.resetConsent().


🔧 Configuration

build_config.json

{
  "version": { "code": 2, "name": "2.0.2" },
  "app": { "name": "UNITY ONLINE", "package_id": "UNITY.ONLINE" },
  "build": { "type": "Debug", "target_dex_index": 13 },
  "abi": { "keep_only": ["arm64-v8a"], "remove_others": true }
}

keystore.json

{
  "keystore_path": "UnityRP.keystore",
  "keystore_alias": "release",
  "keystore_password": "********",
  "key_password": "********"
}

⚠️ Security: keep your real keystore and passwords out of the public repository. Use .gitignore and a local config — never commit real credentials.

Telegram Logging

The bot token and chat ID are not stored in the repository. See telegram_config.properties.example — copy it to assets/telegram_config.properties and fill in your own values locally.


🔨 Building Native Libraries

The C++ library is built via CMake. All source code is in src/main/cpp/:

cpp/
├── main.cpp                     # Entry point
├── CMakeLists.txt                # Build configuration
├── Dobby/                        # Hooking framework
├── KittyMemory/                  # Memory manipulation
├── And64InlineHook/               # ARM64 inline hooks
├── android-inline-hook/          # ShadowHook
├── bhook/                        # ByteHook
├── GlossHook/                    # Hook utilities
├── Il2cpp_Resolver_Android/        # IL2CPP resolver
└── UnityResolve.hpp/               # Unity resolution

Supported ABI: arm64-v8a only (configured in build_config.json).


📦 Downloading Dependencies

tools/Download_Dependencies/ is a Gradle project for downloading external libraries:

cd tools/Download_Dependencies

# On Windows:
downloadDependencies.bat

# Or manually:
gradlew downloadDependencies

🛠️ Development

Kotlin/Java code — place .kt files in src/main/java/UNITY/ONLINE/

Native code — place .cpp/.hpp files in src/main/cpp/, then add them to CMakeLists.txt:

file(GLOB_RECURSE YOUR_SOURCES "${CMAKE_SOURCE_DIR}/YourFolder/*.cpp")
target_sources(UNITYONLINE PRIVATE ${YOUR_SOURCES})

Resources — images in res/drawable/, layouts in res/layout/

Build pipeline — edit in build_config.json:

"pipeline": [
  "_print_header",
  "_find_files",
  "_run_apktool_decompile",
  // add or remove steps here
  "_sign_apk",
  "_print_final_summary"
]

🔍 Understanding the Build Process

  1. Decompileapktool extracts smali, resources, and manifest from the original APK
  2. Compile — your Kotlin/Java code is compiled to classes, then to DEX, then to smali
  3. Build Native — CMake compiles C++ code to libUNITYONLINE.so
  4. Merge — your smali code, resources, and native library are merged into the decompiled APK
  5. Rebuild — apktool reassembles the APK
  6. Sign — zipalign + apksigner signs the APK
  7. Output — ready-to-install APK in ModdedGame/

📝 File Reference

Launcher Kotlin Files

File Purpose
MainActivity.kt Main launcher activity
GameActivity.kt Game starter with MOD menu overlay
RobustDownloadService.kt OBB download with pause/resume
ObbManager.kt OBB integrity verification
StatusManager.kt Internet/OBB status monitoring
PermissionManager.kt Runtime permission handling
ConsentManager.kt User consent tracking
ConsentDialog.kt Consent dialog UI
TelegramLogger.kt Error reporting to Telegram
TelegramSubscribeDialog.kt Telegram subscription prompt
LoggingService.kt Background log capture
PerformanceMonitor.kt FPS/memory monitoring
PerformanceOverlay.kt Performance overlay in game
MainScreen.kt Launcher UI components

Native Libraries

Component Purpose Source
main.cpp Native entry point, loads hooking frameworks
Dobby/ Hooking library (ARM64 support) jmpews/Dobby
KittyMemory/ Memory reading/writing, pattern scanning MJx0/KittyMemory
And64InlineHook/ ARM64 inline hooking Rprop/And64InlineHook
android-inline-hook/ ByteDance's ShadowHook bytedance/android-inline-hook
bhook/ ByteDance's ByteHook bytedance/bhook
GlossHook/ Hook utilities XMDS/GlossHook
Il2cpp_Resolver_Android/ IL2CPP runtime access KING-UTKARSH/Il2cpp_Resolver_Android
UnityResolve.hpp/ Unity class resolution utilities issuimo/UnityResolve.hpp

Build Toolchain

Tool Purpose Source
ApkForge APK decompile/modify/repack pipeline All1eexx/ApkForge
apktool APK decompilation & rebuilding iBotPeaches/Apktool
smali/baksmali Dex assembler/disassembler JesusFreke/smali

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test the build
  5. Submit a pull request

🙏 Credits

This project wouldn't be possible without these open-source tools and libraries:

Please check each project's license terms before redistributing or building on top of this repository.


📄 License

MIT License — see LICENSE for details.

Footer

Made by the UnityRP Team

Star this project on GitHub!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages