Expand FAQ with complete code location reference

Added comprehensive 'Code Location Reference' section:
- Network communication files with exact line numbers
- Encryption/security code locations
- Server URL configuration logic
- All game features and managers
- EA Nimble SDK components
- CloudCell API structure
- Android components
- Third-party SDKs
- Search tips and code flow diagrams

Now people can find EXACTLY where code is instead of asking!
This commit is contained in:
2026-02-22 16:55:37 -08:00
parent 83d1f8ff61
commit 07075d0777

328
FAQ.md
View File

@@ -451,6 +451,334 @@ appsettings.json - Server configuration
--- ---
## 📂 Complete Code Location Reference
**"Where is [feature] in the code?"** - Here's EVERYTHING:
### 🌐 Network Communication
**HTTP/HTTPS Clients:**
- `smali_classes2/com/firemint/realracing/Http.smali` (189 lines)
- Main HTTP client (POST-only)
- Lines 179-181: ALLOW_ALL_HOSTNAME_VERIFIER (disables SSL validation)
- Lines 38-42: Empty TrustManager (no certificate validation)
- Line 120: URL connection setup
- Lines 158-165: POST data writing
- `smali_classes2/com/firemonkeys/cloudcellapi/HttpRequest.smali` (116 lines)
- CloudCell HTTP client (GET/POST)
- Lines 108-111: SSL context setup with custom TrustManager
- Line 111: ALLOW_ALL_HOSTNAME_VERIFIER enabled
- Lines 45-70: Request execution
- `smali_classes2/com/firemonkeys/cloudcellapi/HttpThread.smali`
- Async HTTP execution
- Chunk-based streaming callbacks
**SSL/TLS Configuration:**
- `smali_classes2/com/firemonkeys/cloudcellapi/CloudcellTrustManager.smali`
- Lines 24: `m_bSSLCheck` flag (default: false)
- Lines 56-76: `checkServerTrusted()` - validation logic (disabled by default)
- Lines 78-89: Certificate chain validation (when enabled)
### 🔐 Encryption & Security
**Data Encryption (Local Storage):**
- `smali_classes2/com/ea/nimble/Encryptor.smali` (286 lines)
- Lines 7-10: Encryption constants (256-bit key, 997 rounds)
- Lines 36-50: Version headers (NEV1, NEV2)
- Lines 62-160: Legacy decryption (PBEWithMD5AndDES)
- Lines 200-270: Modern decryption (AES/CBC/PKCS5Padding)
- Lines 246-260: AES cipher initialization
- Lines 286-320: Key derivation (PBKDF2WithHmacSHA1)
**Persistence:**
- `smali_classes2/com/ea/nimble/PersistenceServiceImpl.smali`
- Uses Encryptor for save data
- Lines 150-200: Save file encryption
- Lines 250-300: Load file decryption
### 🌍 Server URL Configuration
**URL Priority System:**
- `smali_classes2/com/ea/nimble/SynergyEnvironmentImpl.smali` (1800+ lines)
- Lines 953-1049: `getSynergyDirectorServerUrl()` - MAIN URL LOGIC
- Lines 959-985: SharedPreferences check (Priority 1)
- Lines 990-1048: Configuration mode switch
- Lines 1008: EA Integration URL (unreachable with CUSTOMIZED)
- Lines 1041: EA Staging URL (unreachable with CUSTOMIZED)
- Lines 1046: EA Production URL (unreachable with CUSTOMIZED)
**Community Server Manager:**
- `smali_classes2/com/firemint/realracing/CommunityServerManager.smali` (136 lines)
- Lines 24-58: `checkServerUrl()` - returns boolean if URL exists
- Lines 60-96: `getServerUrl()` - retrieves URL from SharedPreferences
- Lines 98-136: `saveServerUrl()` - saves URL to SharedPreferences
- SharedPreferences file: `"rr3_community_server"`
- SharedPreferences key: `"server_url"`
**Server Setup Dialog:**
- `smali_classes2/com/firemint/realracing/ServerSetupActivity.smali`
- First-launch UI for server URL input
- Test connection button logic
- Save and continue functionality
### ⚙️ Configuration Files
**App Manifest:**
- `AndroidManifest.xml`
- Line 126: `com.ea.nimble.configuration` - **"customized"** (was "live")
- Lines 127-128: `NimbleCustomizedSynergyServerEndpointUrl` - fallback URL
- Lines 32-35: Permissions (INTERNET, NETWORK_STATE, etc.)
- Lines 45-120: EA Nimble SDK meta-data
- Line 210: `networkSecurityConfig` reference
- Line 215: `usesCleartextTraffic="false"` (HTTPS enforced)
**Network Security Config:**
- `res/xml/network_security_config.xml`
- Trust settings for HTTPS
- Certificate configuration
### 🎮 Game Features
**Offline Mode:**
- `smali_classes2/com/firemint/realracing/OfflineModeManager.smali` (131 lines)
- Lines 36-77: `init()` - loads preference on startup
- Lines 79-86: `isOfflineMode()` - getter
- Lines 88-131: `setOfflineMode()` - setter with persistence
- SharedPreferences file: `"rr3_offline_settings"`
- SharedPreferences key: `"offline_mode_enabled"`
**Settings Activity:**
- `smali_classes2/com/firemint/realracing/SettingsActivity.smali`
- Offline mode toggle UI
- Server URL change option
- Game settings management
### 🚗 EA Nimble SDK (Core Services)
**Synergy (Authentication/Backend):**
- `smali_classes2/com/ea/nimble/SynergyEnvironmentImpl.smali`
- Main Synergy implementation
- Lines 1-100: Constants and initialization
- Lines 953-1049: Server URL selection logic
- Lines 1100-1200: Director API calls
- `smali_classes2/com/ea/nimble/SynergyIdManager.smali`
- Synergy ID generation/storage
- User identification system
- `smali_classes2/com/ea/nimble/SynergyNetwork.smali`
- Network request handling
- API endpoint calls
**Application Environment:**
- `smali_classes2/com/ea/nimble/ApplicationEnvironmentImpl.smali`
- App bundle ID
- Version information
- Device info
**Tracking/Analytics:**
- `smali_classes2/com/ea/nimble/Tracking*.smali`
- Analytics event tracking
- Synergy event logging
### 💰 CloudCell API (Billing/Social)
**Billing:**
- `smali_classes2/com/firemonkeys/cloudcellapi/GooglePlayWorker.smali`
- Google Play IAB integration
- Purchase handling
- Inventory management
- `smali_classes2/com/firemonkeys/cloudcellapi/AmazonStoreWorker.smali`
- Amazon Appstore integration
- `smali_classes2/com/firemonkeys/cloudcellapi/FacebookWorker.smali`
- Facebook payments
**Inventory/Purchases:**
- `smali_classes2/com/firemonkeys/cloudcellapi/util/Inventory.smali`
- IAB inventory management
- `smali_classes2/com/firemonkeys/cloudcellapi/util/Purchase.smali`
- Purchase data handling
**Security:**
- `smali_classes2/com/firemonkeys/cloudcellapi/Security.smali`
- Signature verification (Google Play)
- Base64 encoding/decoding
### 📱 Android Components
**Main Activity:**
- `smali_classes2/com/firemint/realracing/MainActivity.smali`
- App entry point
- Launches ServerSetupActivity on first run
**Splash Screen:**
- `smali_classes2/com/firemint/realracing/SplashActivity.smali`
- Initial loading screen
- Asset check trigger
**JNI Bridge:**
- `smali_classes2/com/firemint/realracing/JNI*.smali`
- Native code bridge
- C++ game engine communication
### 🗂️ Assets & Resources
**Asset Locations:**
- `assets/`
- Game data files
- Car models, tracks, textures
- Configuration files
- Audio files
**Resources:**
- `res/layout/` - UI layouts
- `res/drawable/` - Images
- `res/values/strings.xml` - String resources
- `res/xml/network_security_config.xml` - Network config
### 📊 Third-Party SDKs
**Firebase:**
- `smali_classes2/com/google/firebase/`
- Analytics
- Crashlytics
- Performance monitoring
**Facebook SDK:**
- `smali_classes2/com/facebook/`
- Login integration
- Graph API
- Share functionality
**Ad Networks:**
- `smali_classes2/com/ironsource/` - IronSource ads
- `smali_classes2/com/vungle/` - Vungle ads
- `smali_classes2/com/fyber/` - Fyber ads
- `smali_classes2/com/tapjoy/` - Tapjoy reward ads
### 🔧 Build Files
**Build Configuration:**
- `apktool.yml` - APK metadata
- Version info
- SDK versions
- Compression settings
**Native Libraries:**
- `lib/armeabi-v7a/` - 32-bit ARM libraries
- `lib/arm64-v8a/` - 64-bit ARM libraries
- `lib/x86/` - x86 libraries (if present)
### 📝 Documentation Files
**Security & Network:**
- `NETWORK-SECURITY-ANALYSIS.md` (16 KB)
- Complete security audit
- SSL/TLS analysis
- Attack vectors
- Mitigation strategies
- `EA-URL-ELIMINATION.md` (11 KB)
- URL priority system
- Code flow analysis
- EA URL removal proof
- `RR3-NETWORK-ANALYSIS-AND-CONFIG-SYSTEM.md` (16 KB)
- Network stack architecture
- CloudCell API docs
- Config system design
**Build & Testing:**
- `APK-BUILD-AND-TESTING-GUIDE.md` (10 KB)
- Build instructions
- Testing procedures
- Troubleshooting
**Implementation Status:**
- `SERVER-ENDPOINTS-ANALYSIS.md` (12.7 KB)
- All 73 endpoints mapped
- Implementation status
- Priority assignments
---
## 🗺️ Code Navigation Tips
### Finding Specific Features:
**1. Search by functionality:**
```bash
# Find network-related code
grep -r "http\|Http\|network" smali_classes2/com/firemint/realracing/
# Find encryption code
grep -r "encrypt\|Encrypt\|cipher\|Cipher" smali_classes2/com/ea/nimble/
# Find server URL logic
grep -r "server.*url\|ServerUrl" smali_classes2/
```
**2. Search by string:**
```bash
# Find EA URLs
grep -r "eamobile.com" smali_classes2/
# Find configuration keys
grep -r "rr3_community_server\|offline_mode" smali_classes2/
# Find SharedPreferences usage
grep -r "SharedPreferences" smali_classes2/
```
**3. Search by method name:**
```bash
# Find URL getter
grep -r "getSynergyDirectorServerUrl" smali_classes2/
# Find encryption methods
grep -r "checkServerTrusted\|init.*Cipher" smali_classes2/
```
### Understanding Code Flow:
**Server URL Resolution:**
```
1. Game starts → MainActivity.smali
2. Check config → CommunityServerManager.checkServerUrl()
3. Get URL → SynergyEnvironmentImpl.getSynergyDirectorServerUrl()
├─ Priority 1: SharedPreferences ("rr3_community_server.xml")
├─ Priority 2: AndroidManifest.xml (NimbleCustomizedSynergyServerEndpointUrl)
└─ Priority 3: EA URLs (UNREACHABLE with configuration="customized")
4. Make API call → Http.smali or HttpRequest.smali
```
**First Launch Flow:**
```
1. MainActivity.smali → onCreate()
2. Check if first launch (no SharedPreferences)
3. Launch → ServerSetupActivity.smali
4. User inputs server URL
5. Save → CommunityServerManager.saveServerUrl()
6. Restart → MainActivty with URL configured
```
**Network Request Flow:**
```
1. Game needs data → SynergyNetwork.smali
2. Build request → URL + parameters
3. Send via → Http.smali (POST) or HttpRequest.smali (GET/POST)
4. TLS handshake → CloudcellTrustManager (accepts all certs)
5. Receive response → Parse JSON
6. If save needed → Encryptor.smali (AES-256)
```
---
### Quick Commands ### Quick Commands
**Build APK:** **Build APK:**