========================================
QUEST GAME PATCHER - USER GUIDE
========================================

REQUIREMENTS
========================================

✓ Windows 10 or Windows 11
✓ Java (for APK signing)
  - Download from: https://www.java.com/download/
  - The tool will detect if missing and guide you
✓ USB cable for Quest connection (for sideloading)
✓ Quest device in Developer Mode (for sideloading)

The tool will check for Java on startup and
help you install it if needed.

========================================
HOW TO USE
========================================

1. Double-click QuestPatcher.exe

2. Connect your Quest via USB (optional - for sideloading)
   - Device info will appear in status bar at top
   - Shows firmware version, storage, battery

3. Click "Browse" button

4. Select your Quest APK file
   (Example: MyGame.apk)

5. The tool will automatically detect the
   CURRENT VERSION in the APK

6. Type the TARGET VERSION you want
   (must be ≤ your Quest firmware version)
   
   Common versions:
   - Quest 1: 57.0.0.166.353
   - Quest 2: 65.0.0.166.353
   - Quest 3: 72.0.0.166.353
   - Quest Pro: 69.0.0.166.353

7. Choose patching method:

   🔧 STANDARD METHOD (Experimental)
   - Quick version string spoofing
   - May not work for all games
   - Some games perform additional validation
   
   🔄 ADVANCED METHOD (Recommended)
   - Uses reverse-engineered components
   - More reliable and stable
   - Based on deep analysis of Quest internals
   - Bypasses most version validation

8. Click "📱 Sideload APK" to install directly to Quest
   - Automatically detects ADB
   - Installs APK to Quest
   - Copies OBB/data files if present

9. Done! Your APK is patched and installed
   Backup created as [name]_backup.apk

========================================
PATCHING METHODS EXPLAINED
========================================

STANDARD METHOD (Experimental):
- Spoofs version string in APK
- Simple string replacement
- Fast but may not work for all games
- Some games validate version in other ways
- Use if Advanced Method fails

ADVANCED METHOD (Recommended):
- Reverse-engineered versions
- Based on deep analysis of Quest's internal structure
- More reliable - bypasses most validation
- Recommended for maximum compatibility

========================================
WHAT THE TOOL DOES
========================================

STANDARD METHOD:
1. Opens your APK file (it's like a ZIP)
2. Finds the version string in binary data
3. Patches the version string
4. Removes old signatures
5. Repacks everything (resources.arsc uncompressed)
6. Signs with v1+v2+v3 signatures
7. Replaces original APK, creates backup

ADVANCED METHOD:
1. Opens your APK file
2. Extracts internal components
3. Replaces with reverse-engineered versions
4. Removes old signatures
5. Repacks everything (resources.arsc uncompressed)
6. Signs with v1+v2+v3 signatures
7. Replaces original APK, creates backup

SIDELOADING:
1. Detects ADB from SideQuest/Rookie/Android SDK
2. Checks for connected Quest device
3. Installs APK to Quest
4. Detects OBB/data folder (same name as package)
5. Copies all files (.obb, .bundle, etc.) to Quest
6. Shows progress with real-time updates

All of this happens automatically!

========================================
OBB FILE STRUCTURE
========================================

For games with OBB/data files:

YourFolder/
├── game.apk
└── com.example.game/          ← Folder named like package
    ├── main.obb
    ├── patch.obb
    └── other.bundle

The tool will automatically:
- Detect the package folder
- Copy ALL files inside to Quest
- Show progress during transfer

========================================
INSTALLING TO YOUR QUEST
========================================

BUILT-IN SIDELOADING (Easiest):
1. Connect Quest to PC with USB cable
2. Enable USB debugging (allow in headset)
3. Click "📱 Sideload APK" button
4. Tool handles everything automatically!

Option 2 - Using SideQuest:
1. Download SideQuest from sidequestvr.com
2. Connect Quest to PC with USB cable
3. Open SideQuest
4. Drag and drop your patched APK

Option 3 - Using ADB:
1. Enable Developer Mode on Quest
2. Connect Quest to PC
3. Open Command Prompt
4. Type: adb install -r "path\to\patched.apk"

========================================
TROUBLESHOOTING
========================================

"Java Required" popup appears?
- Java is needed for APK signing
- Click "Yes" to download Java
- Install Java and restart the tool

"Windows protected your PC" message?
- Click "More info"
- Click "Run anyway"
- This is normal for new EXE files

Device not detected?
- Enable Developer Mode in Quest settings
- Enable USB debugging
- Allow USB debugging prompt in headset
- Try different USB cable or port

APK won't install on Quest?
- Enable Developer Mode in Quest settings
- Enable "Unknown Sources"
- Make sure USB debugging is on
- Try: adb install -r patched.apk

Patched APK crashes on Quest?
- Make sure target version ≤ Quest firmware
- Try Advanced Method instead of Standard
- Some games may have additional protections

OBB files not copying?
- Check folder structure (see above)
- Folder must be named exactly like package
- Must be in same directory as APK

Standard Method not working?
- Try Advanced Method instead
- Advanced Method is more reliable
- Based on reverse engineering, not just spoofing

========================================
TECHNICAL INFO
========================================

File Size: ~10-15 MB (the EXE)
Processing Time: 10 seconds to 2 minutes
           (depends on APK size and method)
Max APK Size: No limit (tested up to 4GB)

The tool uses:
- Built-in ZIP handling
- Embedded uber-apk-signer.jar (v1+v2+v3)
- Reverse-engineered Quest components
- Java for signing (auto-detected)
- ADB for sideloading (auto-detected)
- Handles Android 11+ requirements

========================================
SAFETY & PRIVACY
========================================

✓ Works completely offline (after Java install)
✓ No data sent anywhere
✓ No installation or registry changes
✓ Portable - run from USB drive
✓ Creates automatic backups
✓ Original APK preserved as _backup.apk
✓ Reverse-engineered components are safe

========================================
SUPPORT
========================================

If you have issues:
1. Make sure you selected a valid APK file
2. Check that you have write permissions
   in the folder where the APK is located
3. Try running as administrator
4. Make sure the APK isn't corrupted
5. Verify Java is installed
6. Try Advanced Method if Standard fails
7. Check Quest is in Developer Mode

Contact: u/Pale-Requirement9041 on Reddit

========================================

Enjoy patching your Quest games! 🎮

========================================
