(Landroid/content/Context;)V
const-string v1, "UpdateManager"
invoke-virtual {webView, v0, v1}, Landroid/webkit/WebView;->addJavascriptInterface(Ljava/lang/Object;Ljava/lang/String;)V
```
---
## ๐งช Testing
### Test Manifest Parsing
```bash
# Fetch your manifest
curl https://raw.githubusercontent.com/YOUR-ORG/YOUR-REPO/main/versions.json
# Check structure
jq . versions.json
# Verify accessible
curl -I https://raw.githubusercontent.com/YOUR-ORG/YOUR-REPO/main/versions.json
```
### Test Update Flow
1. **Set current version lower** (e.g., 15.0.0)
2. **Add test version to manifest** (e.g., 15.0.1)
3. **Set upgrade_from** to current version
4. **Open app and check for updates**
5. **Verify update is offered**
### Test Download
1. **Create actual GitHub release with APK**
2. **Update manifest download_url**
3. **Test download (WiFi only, then mobile)**
4. **Verify progress tracking works**
5. **Test installation**
---
## ๐ง Customization
### Change Manifest URL
Edit `UpdateManager.java` line ~23:
```java
private static final String UPDATE_API_URL = "YOUR_MANIFEST_URL";
```
### Modify UI
Edit `community_update_checker.html`:
- Change colors (CSS variables at top)
- Modify layout
- Add custom branding
- Change button text
### Add Update Channels
In your manifest:
```json
"channels": {
"stable": { "latest": "15.0.0" },
"beta": { "latest": "15.1.0-beta" },
"legacy-v14": { "latest": "14.5.2" }
}
```
Then add channel selection in your UI.
### Network Preferences
Users can toggle WiFi-only mode:
```javascript
UpdateManager.setWifiOnlyPreference(true); // WiFi only
UpdateManager.setWifiOnlyPreference(false); // WiFi + Mobile
```
---
## ๐ฑ Android Permissions
Add to `AndroidManifest.xml`:
```xml
```
---
## ๐ Security
### APK Verification
**Recommended:** Verify SHA-256 checksum after download
```java
// Add to UpdateManager
public boolean verifyDownload(String expectedSha256) {
// Calculate SHA-256 of downloaded APK
// Compare with manifest value
// Return true if match
}
```
### HTTPS Only
- โ
Manifest URL uses HTTPS (raw.githubusercontent.com)
- โ
Download URLs use HTTPS (github.com)
- โ
No insecure connections
### Code Signing
Always sign your APK with the same keystore for update continuity.
---
## ๐ File Structure
### After Integration
```
your-rr3-apk/
โโโ smali/
โ โโโ com/
โ โโโ community/
โ โโโ UpdateManager.smali โ Add this
โโโ assets/
โ โโโ community_update_checker.html โ Add this
โโโ AndroidManifest.xml โ Add permissions
```
### Your GitHub Release Repo
```
your-releases-repo/
โโโ versions.json โ Version manifest
โโโ README.md โ Usage instructions
```
---
## โ FAQ
### Q: Does this work with EA's official RR3?
**A:** Technically yes, but EA may ban your account for modified APKs. This is designed for community servers where EA's servers are shut down.
### Q: Can users downgrade versions?
**A:** No. The system only offers updates to versions with higher version codes.
### Q: What if GitHub goes down?
**A:** Update checks will fail gracefully. Users can still play, just won't get updates until GitHub is back.
### Q: Can I host the manifest elsewhere?
**A:** Yes! Just change the `UPDATE_API_URL`. Any HTTPS endpoint that returns the JSON works.
### Q: How do I prevent v14 users from updating to v15?
**A:** In your v15 manifest entry, don't include v14.x in `upgrade_from`:
```json
"upgrade_from": ["15.0.0", "15.0.1"] // No 14.x!
```
### Q: Can I have multiple APK variants (arm64, x86)?
**A:** Not currently, but you can extend the manifest:
```json
"variants": [
{"arch": "arm64-v8a", "url": "...-arm64.apk"},
{"arch": "armeabi-v7a", "url": "...-arm.apk"}
]
```
Then update UpdateManager to select based on device architecture.
---
## ๐ค Contributing
Found a bug? Have an improvement?
1. Test your changes thoroughly
2. Update documentation
3. Submit with clear description
---
## ๐ License
This OTA system is part of the RR3 Community Edition project.
**License:** MIT License
**Credits:**
- Project Lead: [@ssfdre38](https://github.com/ssfdre38) (Daniel Elliott)
- AI Assistant: GitHub Copilot CLI
---
## ๐ Links
- **Main Project:** [RR3 Community Edition](https://github.com/project-real-resurrection-3)
- **Releases:** [rr3-releases](https://github.com/project-real-resurrection-3/rr3-releases)
- **Legal:** [LEGAL.md](https://github.com/project-real-resurrection-3/.github/blob/main/LEGAL.md)
---
## ๐ Support
**Need help?**
- ๐ Report issues on GitHub
- ๐ฌ Join community Discord (link TBA)
- ๐ง Contact: [@ssfdre38](https://github.com/ssfdre38)
---
**๐ Keep your RR3 Community Edition up to date! ๐**
Made with โค๏ธ by the RR3 Community