commit 6451b45afac5ff6ce104197ef2447f61697bdc5e Author: Daniel Elliott Date: Wed Feb 18 14:37:06 2026 -0800 Initial commit: RR3 APK and documentation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> diff --git a/ADB_TRANSFER_INSTRUCTIONS.md b/ADB_TRANSFER_INSTRUCTIONS.md new file mode 100644 index 000000000..296cd3ead --- /dev/null +++ b/ADB_TRANSFER_INSTRUCTIONS.md @@ -0,0 +1,182 @@ +# ๐Ÿ“ฑ ADB TRANSFER INSTRUCTIONS +**Transfer RR3 Assets from Phone to Your Windows PC, then to OVH Server** + +--- + +## ๐Ÿ”ง STEP 1: Enable USB Debugging on Phone + +1. **Settings โ†’ About Phone** +2. Tap "Build Number" 7 times (enables Developer Mode) +3. **Settings โ†’ Developer Options** +4. Enable **USB Debugging** +5. Connect phone to your Windows PC via USB + +--- + +## ๐Ÿ’ป STEP 2: Install ADB on Your Windows PC + +### Option A: Download Minimal ADB +``` +https://dl.google.com/android/repository/platform-tools-latest-windows.zip +``` +- Extract to `C:\adb\` +- Add `C:\adb\platform-tools` to PATH (optional) + +### Option B: Use Existing Android SDK +- If you have Android Studio, ADB is in: +- `C:\Users\YourName\AppData\Local\Android\Sdk\platform-tools\` + +--- + +## ๐Ÿ“ฅ STEP 3: Pull Assets from Phone (Run on YOUR Windows PC) + +### Open Command Prompt or PowerShell on YOUR PC: + +```powershell +# Navigate to ADB folder (adjust path if different) +cd C:\adb\platform-tools + +# Check if phone is connected +adb devices + +# Should show: List of devices attached +# XXXXXXXX device +``` + +**If you see "unauthorized":** +- Check your phone screen +- Tap "Allow USB Debugging" +- Check "Always allow from this computer" + +--- + +### Pull the RR3 Assets: + +```powershell +# Pull entire RR3 data folder (1.44 GB) +adb pull /sdcard/Android/data/com.ea.games.r3_row/files/ "C:\RR3-Assets\" + +# This will take 5-10 minutes depending on USB speed +# Watch the progress: [100%] /sdcard/Android/data/... +``` + +**Alternative paths if first doesn't work:** +```powershell +# Try OBB folder +adb pull /sdcard/Android/obb/com.ea.games.r3_row/ "C:\RR3-Assets-OBB\" + +# Try alternative data location +adb pull /data/data/com.ea.games.r3_row/files/ "C:\RR3-Assets-Data\" +``` + +--- + +## ๐Ÿ“ค STEP 4: Transfer to OVH Server + +### Option A: Direct RDP File Transfer +1. In your RDP session (connected to OVH server) +2. Open File Explorer on local PC +3. Copy `C:\RR3-Assets\` folder +4. Paste into RDP window at: `E:\rr3\phone-assets-full\` + +### Option B: Upload to Google Drive (You Already Use This) +```powershell +# Compress first to speed up upload +Compress-Archive -Path "C:\RR3-Assets\*" -DestinationPath "C:\RR3-Assets-Full.zip" + +# Upload to Google Drive manually +# Then on OVH server, download from: G:\My Drive\RR3-Assets-Full.zip +``` + +### Option C: Network Share (if on same network) +- Share `C:\RR3-Assets\` on your PC +- Map network drive on OVH server +- Copy directly + +--- + +## ๐ŸŽฏ QUICK REFERENCE COMMANDS (Run on YOUR PC): + +```powershell +# 1. Check connection +adb devices + +# 2. List what's on phone (verify path exists) +adb shell ls /sdcard/Android/data/com.ea.games.r3_row/files/ + +# 3. Check total size before pulling +adb shell du -sh /sdcard/Android/data/com.ea.games.r3_row/files/ + +# 4. Pull everything +adb pull /sdcard/Android/data/com.ea.games.r3_row/files/ "C:\RR3-Assets\" + +# 5. Verify what you got +dir C:\RR3-Assets /s +``` + +--- + +## โš ๏ธ TROUBLESHOOTING: + +**"adb: command not found"** +- Use full path: `C:\adb\platform-tools\adb.exe devices` + +**"device unauthorized"** +- Check phone screen for popup +- Revoke USB debugging authorizations and try again +- Settings โ†’ Developer Options โ†’ Revoke USB debugging authorizations + +**"adb: error: failed to stat remote object"** +- Path doesn't exist on phone +- Try alternative paths listed above +- Or use: `adb shell ls /sdcard/Android/data/` to see what's there + +**"adb: device offline"** +- Unplug and replug USB cable +- Run: `adb kill-server` then `adb start-server` + +**Transfer is slow:** +- Use USB 3.0 port if available +- Close other apps on phone +- Disable phone screen lock during transfer + +--- + +## ๐Ÿ“Š EXPECTED RESULT: + +``` +After successful pull: + +C:\RR3-Assets\ +โ”œโ”€โ”€ pak files (car/track models) +โ”œโ”€โ”€ pka files (asset archives) +โ”œโ”€โ”€ z files (textures) +โ”œโ”€โ”€ audio files +โ”œโ”€โ”€ manifest files +โ””โ”€โ”€ config files + +Total: ~1.4 GB +Files: Thousands +``` + +--- + +## ๐Ÿ NEXT STEPS AFTER TRANSFER: + +1. Verify file count and size +2. Transfer to OVH server: `E:\rr3\phone-assets-full\` +3. Analyze asset structure +4. Extract and catalog all assets +5. Map to CDN URLs +6. Archive for preservation + +--- + +**START HERE:** +1. Enable USB debugging on phone +2. Download ADB: https://dl.google.com/android/repository/platform-tools-latest-windows.zip +3. Extract to C:\adb\ +4. Connect phone via USB +5. Run: `C:\adb\platform-tools\adb.exe devices` + +**Then tell me what you see!** ๐Ÿ“ฑ๐Ÿ’พ diff --git a/APK_DECOMPILATION_METHOD.md b/APK_DECOMPILATION_METHOD.md new file mode 100644 index 000000000..f9a3763c3 --- /dev/null +++ b/APK_DECOMPILATION_METHOD.md @@ -0,0 +1,315 @@ +# ๐Ÿ”ง RR3 APK DECOMPILATION METHOD + +**For Discord User Asking About APK Decompilation** + +--- + +## ๐Ÿ“‹ QUESTIONS ANSWERED + +### A) "jadx to convert it to what?" +**Answer:** JADX converts DEX bytecode โ†’ **Java source code (.java files)** + +### B) "How did you circumvent apktool corrupting textures?" +**Answer:** **I didn't use apktool for textures. I used JADX only, which doesn't reprocess resources.** + +--- + +## ๐Ÿ› ๏ธ THE METHOD I USED + +### Tool: JADX (NOT apktool) +- **Download:** https://github.com/skylot/jadx/releases +- **Version:** Latest release (jadx-1.5.0 or newer) +- **Type:** GUI or CLI + +### What JADX Does: +``` +Input: realracing3.apk (100 MB) + โ””โ”€โ”€ classes.dex (DEX bytecode) + +Output: decompiled/ + โ”œโ”€โ”€ sources/ (Java .java files) + โ”‚ โ””โ”€โ”€ com/ea/... (Readable source code) + โ””โ”€โ”€ resources/ (Extracted AS-IS) + โ”œโ”€โ”€ AndroidManifest.xml + โ”œโ”€โ”€ res/ (Resources) + โ””โ”€โ”€ assets/ (Game assets) +``` + +### Why JADX Doesn't Corrupt Textures: +1. **JADX only decompiles CODE** (DEX โ†’ Java) +2. **Resources are extracted, not converted** +3. **No reprocessing/recompression** of images +4. **Files stay in original format** + +--- + +## โš ๏ธ WHY APKTOOL CORRUPTS TEXTURES + +### The Problem with apktool: +``` +apktool tries to: +โ”œโ”€โ”€ Decode resources.arsc +โ”œโ”€โ”€ Decompile XML files +โ”œโ”€โ”€ Extract PNG/9-patch images +โ””โ”€โ”€ Reprocess drawable resources โŒ + +Result: Textures get corrupted during: +โ”œโ”€โ”€ PNG recompression +โ”œโ”€โ”€ 9-patch processing +โ””โ”€โ”€ Resource table rebuilding +``` + +### When apktool is useful: +- Modifying AndroidManifest.xml +- Changing app resources (icons, strings) +- Rebuilding APK after modifications +- **NOT for preserving original assets!** + +--- + +## โœ… RECOMMENDED APPROACH FOR RR3 + +### For Source Code Analysis: +```bash +# Use JADX (GUI or CLI) +jadx realracing3.apk -d decompiled/ + +# Result: Clean Java source code +# No corruption, just decompiled code +``` + +### For Asset Extraction: +```bash +# Option 1: Unzip APK directly (APK = ZIP file) +unzip realracing3.apk -d extracted/ + +# Option 2: Use JADX to extract resources +jadx realracing3.apk --export-gradle + +# Option 3: Manual extraction from phone (what we did!) +adb pull /sdcard/Android/data/com.ea.games.r3_row/files/ +``` + +### For Texture Preservation: +**DON'T USE:** apktool (corrupts textures) +**DO USE:** +- Direct APK extraction (unzip) +- JADX resource extraction +- ADB pull from phone (gets runtime assets) + +--- + +## ๐Ÿ“ฆ COMPLETE WORKFLOW + +### Step 1: Get the APK +```bash +# From phone +adb pull /system/app/RealRacing3/base.apk + +# Or from installed apps +adb shell pm path com.ea.games.r3_row +adb pull /data/app/com.ea.games.r3_row-[hash]/base.apk + +# Or download from APKMirror/APKPure +``` + +### Step 2: Decompile Code with JADX +```bash +# GUI method (recommended for beginners) +1. Download JADX from: https://github.com/skylot/jadx/releases +2. Run jadx-gui.exe (Windows) or jadx-gui.sh (Linux) +3. File โ†’ Open โ†’ Select realracing3.apk +4. Wait for decompilation (2-5 minutes) +5. Browse source code in GUI +6. File โ†’ Save All โ†’ Choose output folder + +# CLI method (for automation) +jadx realracing3.apk -d decompiled/ +``` + +### Step 3: Extract Resources WITHOUT Corruption +```bash +# Method A: JADX extraction (safe) +jadx realracing3.apk --export-gradle -d output/ + +# Method B: Direct unzip (safest for textures) +unzip realracing3.apk -d apk-contents/ + +# Method C: 7-Zip (Windows) +7z x realracing3.apk -oapk-contents/ +``` + +### Step 4: Get Runtime Assets from Phone +```bash +# This gets assets downloaded from EA CDN +adb pull /sdcard/Android/data/com.ea.games.r3_row/files/ phone-assets/ + +# Also check OBB files +adb pull /sdcard/Android/obb/com.ea.games.r3_row/ obb-assets/ +``` + +--- + +## ๐ŸŽฏ WHAT YOU GET FROM EACH METHOD + +### JADX Output: +``` +decompiled/ +โ”œโ”€โ”€ sources/ +โ”‚ โ””โ”€โ”€ com/ea/nimble/ (Network code) +โ”‚ โ””โ”€โ”€ com/firemonkeys/ (Game logic) +โ”‚ โ””โ”€โ”€ com/ea/games/r3/ (RR3 specific) +โ””โ”€โ”€ resources/ + โ”œโ”€โ”€ AndroidManifest.xml (App config) + โ”œโ”€โ”€ res/ (App resources) + โ”‚ โ”œโ”€โ”€ drawable/ (Icons, UI) + โ”‚ โ”œโ”€โ”€ layout/ (UI layouts) + โ”‚ โ””โ”€โ”€ values/ (Strings, configs) + โ””โ”€โ”€ assets/ (Base game assets) +``` + +### APK Direct Extraction (unzip): +``` +apk-contents/ +โ”œโ”€โ”€ AndroidManifest.xml (Binary XML) +โ”œโ”€โ”€ classes.dex (Bytecode) +โ”œโ”€โ”€ res/ (Resources - intact!) +โ”‚ โ”œโ”€โ”€ drawable/ (PNG files - NOT corrupted) +โ”‚ โ””โ”€โ”€ layout/ (Binary XML) +โ”œโ”€โ”€ assets/ (Game base assets) +โ”‚ โ””โ”€โ”€ (whatever APK contains) +โ”œโ”€โ”€ lib/ (Native libraries) +โ”‚ โ”œโ”€โ”€ armeabi-v7a/ +โ”‚ โ””โ”€โ”€ arm64-v8a/ +โ””โ”€โ”€ META-INF/ (Signatures) +``` + +### Phone Asset Pull (ADB): +``` +phone-assets/ +โ”œโ”€โ”€ pak files (3D models) +โ”œโ”€โ”€ pka files (Archives) +โ”œโ”€โ”€ z files (Compressed textures) +โ”œโ”€โ”€ audio/ (Sound files) +โ””โ”€โ”€ data/ (Game data) + +Size: 1.44 GB (full game content) +``` + +--- + +## ๐Ÿ’ก TELL YOUR DISCORD FRIEND + +### Quick Answer: +``` +Q: How did you decompile without corruption? + +A: I used JADX, not apktool. + +JADX = Decompiles code only, extracts resources AS-IS +apktool = Tries to decode/rebuild everything (corrupts textures) + +For RR3: +1. Use JADX for source code +2. Use unzip/7-zip for APK resources +3. Use ADB to pull runtime assets from phone (best quality) + +DO NOT use apktool if you want intact textures! +``` + +### Detailed Answer: +``` +The "res.zip" I extracted came from: +1. Install RR3 on phone +2. Let it download assets from EA CDN (1.44 GB) +3. ADB pull from phone storage +4. These are the ACTUAL game assets, not APK resources + +For source code analysis: +1. Use JADX to decompile DEX โ†’ Java +2. No corruption, clean code output +3. Resources extracted as-is (no reprocessing) + +apktool is NOT needed for RR3 preservation! +``` + +--- + +## ๐Ÿ”— TOOLS & LINKS + +### JADX (Recommended) +- **GitHub:** https://github.com/skylot/jadx +- **Releases:** https://github.com/skylot/jadx/releases/latest +- **Download:** jadx-1.5.0.zip (Windows/Linux/Mac) +- **GUI:** jadx-gui.exe / jadx-gui.sh +- **CLI:** jadx.bat / jadx.sh + +### Alternative Tools +- **APKTool:** https://apktool.org/ (use only for rebuilding, NOT preservation) +- **7-Zip:** https://www.7-zip.org/ (for direct APK extraction) +- **ADB:** https://developer.android.com/tools/adb (for phone asset pull) + +### APK Sources +- **APKMirror:** https://www.apkmirror.com/ +- **APKPure:** https://apkpure.com/ +- **Your own device:** `adb pull` from phone + +--- + +## ๐Ÿ“Š COMPARISON TABLE + +| Method | Source Code | Resources | Texture Quality | Use Case | +|--------|-------------|-----------|-----------------|----------| +| **JADX** | โœ… Clean Java | โœ… Intact | โœ… Perfect | Analysis | +| **apktool** | โŒ Smali only | โš ๏ธ Decoded | โŒ Corrupted | Modding | +| **unzip/7-zip** | โŒ Bytecode | โœ… Binary | โœ… Perfect | Extraction | +| **ADB pull** | โŒ N/A | โœ… Runtime | โœ… Perfect | Preservation | + +--- + +## โœ… MY FINAL WORKFLOW FOR RR3 + +``` +1. Decompile with JADX: + jadx realracing3.apk -d E:\rr3\decompiled\ + +2. Extract APK resources: + unzip realracing3.apk -d E:\rr3\apk-contents\ + +3. Pull runtime assets from phone: + adb pull /sdcard/Android/data/com.ea.games.r3_row/files/ E:\rr3\phone-assets-full\ + +4. Analyze source code: + - Read decompiled Java in E:\rr3\decompiled\sources\ + - Find network endpoints in com/ea/nimble/ + - Map API calls to server implementation + +5. Preserve assets: + - Use phone-pulled assets (best quality) + - Extract .z files with custom tools + - Archive everything for preservation +``` + +**Result: No corruption, complete preservation, full source access** โœ… + +--- + +## ๐Ÿšจ TL;DR FOR DISCORD + +**Tell them:** + +> "I used **JADX** (not apktool) to decompile the APK. JADX only decompiles the code (DEX โ†’ Java) and extracts resources without reprocessing them, so nothing gets corrupted. +> +> For the actual game assets (textures, models, audio), I pulled them directly from my phone using ADB after letting the game download everything from EA's CDN. That's 1.44 GB of pristine assets. +> +> **Don't use apktool for RR3** - it tries to decode and rebuild resources, which corrupts textures. Use JADX for code analysis and ADB for asset preservation. +> +> Tools: +> - JADX: https://github.com/skylot/jadx/releases +> - ADB: Part of Android SDK platform-tools +> +> Method: `jadx realracing3.apk -d output/` - done!" + +--- + +**This is the RIGHT way to preserve RR3 without corruption.** ๐Ÿโœจ diff --git a/APK_MODIFICATION_GUIDE.md b/APK_MODIFICATION_GUIDE.md new file mode 100644 index 000000000..3b5124d9d --- /dev/null +++ b/APK_MODIFICATION_GUIDE.md @@ -0,0 +1,527 @@ +# Real Racing 3 APK Modification Guide - Community Server Support + +## ๐ŸŽฏ Overview + +This guide shows how to modify the Real Racing 3 APK to support **community server URLs** without breaking the original game. The game already has built-in support for custom servers through its configuration system! + +--- + +## โœจ Good News! + +The app **already supports custom server URLs** via its configuration system! We just need to: +1. Change the configuration from `"live"` to `"custom"` +2. Add a meta-data entry with your community server URL +3. Repackage and re-sign the APK + +**No code changes needed!** Just AndroidManifest.xml modifications. + +--- + +## ๐Ÿ“‹ Prerequisites + +### Tools Required +1. **APKTool** - For decompiling/recompiling APKs +2. **Uber APK Signer** - For signing the modified APK +3. **Java JDK 8+** - Required by APKTool + +### Installation + +**Windows:** +```bash +# Install Chocolatey (if not installed) +Set-ExecutionPolicy Bypass -Scope Process -Force +iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + +# Install Java +choco install openjdk11 + +# Download APKTool +# https://ibotpeaches.github.io/Apktool/ +# Place apktool.bat and apktool.jar in C:\Windows\ + +# Download Uber APK Signer +# https://github.com/patrickfav/uber-apk-signer/releases +``` + +**Linux/macOS:** +```bash +# Install Java +sudo apt install openjdk-11-jdk # Ubuntu/Debian +brew install openjdk@11 # macOS + +# Install APKTool +brew install apktool # macOS +sudo apt install apktool # Ubuntu/Debian + +# Download Uber APK Signer +wget https://github.com/patrickfav/uber-apk-signer/releases/download/v1.3.0/uber-apk-signer-1.3.0.jar +``` + +--- + +## ๐Ÿ”ง Method 1: Simple Configuration Change (Recommended) + +This method uses the game's **built-in custom server support**. + +### Step 1: Decompile the APK + +```bash +# Navigate to APK location +cd E:\rr3 + +# Decompile +apktool d realracing3.apk -o rr3-modded +``` + +### Step 2: Edit AndroidManifest.xml + +Open `rr3-modded\AndroidManifest.xml` and find this section (around line 225): + +**BEFORE:** +```xml + +``` + +**AFTER:** +```xml + + +``` + +**Replace `https://your-server.com` with your actual community server URL!** + +### Step 3: Recompile the APK + +```bash +apktool b rr3-modded -o realracing3-community.apk +``` + +### Step 4: Sign the APK + +```bash +# Using Uber APK Signer +java -jar uber-apk-signer.jar --apks realracing3-community.apk + +# Or using jarsigner (manual) +keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-key-alias +jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore my-release-key.jks realracing3-community.apk my-key-alias +``` + +### Step 5: Install on Device + +```bash +# Uninstall original (if installed) +adb uninstall com.ea.games.r3_row + +# Install modified APK +adb install realracing3-community-signed.apk +``` + +**Done!** The game will now connect to your community server. + +--- + +## ๐Ÿ”ง Method 2: Dynamic Server Switching (Advanced) + +This creates **two separate APK versions** - one for official servers, one for community servers. + +### Create Community APK + +1. Follow Method 1 steps 1-4 +2. Rename the output: `realracing3-community.apk` + +### Create Official APK (Unmodified) + +1. Keep original `realracing3.apk` +2. Re-sign it with the same certificate: + ```bash + java -jar uber-apk-signer.jar --apks realracing3.apk + ``` + +### Usage + +- **Official servers**: Install `realracing3.apk` +- **Community servers**: Install `realracing3-community.apk` + +Switch by uninstalling one and installing the other. + +--- + +## ๐Ÿ”ง Method 3: Shared Preferences Override (Requires Root) + +For advanced users with rooted devices - override server URL at runtime. + +### Create Override Script + +```bash +# Create override script +cat > /data/data/com.ea.games.r3_row/shared_prefs/rr3_community.xml << 'EOF' + + + https://your-server.com + + +EOF + +# Set permissions +chmod 660 /data/data/com.ea.games.r3_row/shared_prefs/rr3_community.xml +chown u0_a123:u0_a123 /data/data/com.ea.games.r3_row/shared_prefs/rr3_community.xml +``` + +### Modify Java Code to Read Preferences + +This requires smali editing - see Advanced section below. + +--- + +## ๐Ÿ› ๏ธ Advanced: Add In-Game Server Switcher + +For maximum flexibility, add a settings UI to switch servers in-game. + +### Step 1: Create Settings Activity + +Create `rr3-modded/smali/com/firemint/realracing/CommunityServerSettings.smali`: + +```smali +.class public Lcom/firemint/realracing/CommunityServerSettings; +.super Landroid/app/Activity; + +.method protected onCreate(Landroid/os/Bundle;)V + .locals 2 + + # Show simple dialog with server URL input + # Implementation details omitted for brevity + + return-void +.end method +``` + +### Step 2: Add Settings Button + +This is complex and requires understanding of the game's UI structure. Alternative: use external app. + +--- + +## ๐Ÿ“ฑ Automated Solution: Community Server Manager App + +The easiest approach for users: Create a separate **Community Server Manager** app. + +### Create Android App + +```kotlin +// MainActivity.kt +class ServerManagerActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + val serverUrlInput = findViewById(R.id.serverUrl) + val applyButton = findViewById