Skip to content

Complete toolkit for Unity Android development: Decompile APKs, build AARs, and generate C# bridges automatically. No Android Studio required!

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

rcgeorge/unity-android-bridge-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

74 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Unity Android Bridge Toolkit

πŸ§™ Step-by-step wizard for APK to Unity integration - No Gradle required!

License: MIT Unity Platform

πŸš€ What is this?

The simplest way to integrate Android functionality into Unity!

A complete Unity editor plugin with a step-by-step wizard that:

  1. πŸ“¦ Extracts APIs from APKs - Learn how existing apps work
  2. πŸ”¨ Builds AARs with pure C# - No Gradle installation needed!
  3. πŸŒ‰ Generates C# bridges automatically - From Java to Unity
  4. πŸ“š Extracts native libraries - Complete integration

Perfect for:

  • Using Viture XR SDK from ghostparty.apk
  • Integrating third-party Android SDKs without documentation
  • Creating standalone Unity apps with native functionality
  • Learning Android APIs by example

✨ Key Features

πŸ§™ Unified Workflow Wizard (NEW!)

  • One window for everything - No jumping between tools
  • Step-by-step guidance - Never get lost
  • Visual progress - See where you are
  • Smart defaults - Just click Next!

πŸ” Native APK Extraction

  • Pure C# DEX parser (no external tools!)
  • Extract class metadata and method signatures
  • Preview native libraries (.so files)
  • Fast and reliable

πŸ”¨ AAR Builder - No Gradle Required!

  • Uses javac + C# ZipArchive
  • No Gradle installation needed
  • Only requirement: JDK (Unity needs this anyway)
  • Builds in seconds

πŸŒ‰ Smart Bridge Generator

  • Automatic Java β†’ C# conversion
  • PascalCase naming
  • Type-safe wrappers
  • XML documentation

πŸ“¦ Installation

Unity Package Manager (Recommended)

1. Window β†’ Package Manager
2. Click '+' β†’ Add package from git URL
3. Enter: https://github.com/rcgeorge/unity-android-bridge-toolkit.git
4. Click 'Add'

🎬 Quick Start

The Wizard Way (Easiest!)

Tools β†’ Android Bridge Toolkit β†’ πŸ§™ Workflow Wizard (START HERE!)

Then follow the steps:
1. Load your APK (e.g., ghostparty.apk)
2. Select classes you want to use
3. Review generated Java wrapper
4. Build AAR (one click!)
5. Generate C# bridge (automatic!)
6. Extract native libraries
7. Done! Use in Unity!

Real Example: Viture SDK Integration

Goal: Use Viture XR hand tracking without needing ghostparty.apk installed

Step 1: Load ghostparty.apk
  β†’ Found 324 classes
  β†’ Found libviture_sdk.so

Step 2: Select IXRHandTracking class
  β†’ enterExclusiveHandTracking()
  β†’ exitExclusiveHandTracking()
  β†’ registerHandTrackingListener()

Step 3: Auto-generated Java wrapper loads the .so

Step 4: Build VitureWrapper.aar (10 seconds!)

Step 5: Generate VitureWrapperBridge.cs

Step 6: Extract libviture_sdk.so to Unity

Step 7: Use in Unity!

Result:

using UnityEngine;

public class HandTracking : MonoBehaviour 
{
    void Start() 
    {
        VitureWrapperBridge.EnterExclusiveHandTracking();
        Debug.Log("Hand tracking enabled!");
    }
}

No ghostparty.apk dependency! βœ…

πŸ› οΈ Requirements

Only JDK required!

  • Unity 2021.3 or newer
  • JDK 8+ (Unity needs this for Android anyway)
  • JAVA_HOME environment variable set

No Gradle, no Android Studio, no external tools!

πŸ“ What Gets Created

Assets/
β”œβ”€β”€ Plugins/Android/
β”‚   β”œβ”€β”€ VitureWrapper.aar        ← Your wrapper (built in Unity!)
β”‚   └── libs/
β”‚       └── arm64-v8a/
β”‚           └── libviture_sdk.so ← Native library
└── Scripts/
    └── VitureWrapperBridge.cs   ← Auto-generated C# bridge

🎯 Complete Workflow

ghostparty.apk
    ↓ Extract & Learn
Classes + Native Libraries
    ↓ Create Wrapper
Your Java wrapper code
    ↓ Build AAR
VitureWrapper.aar
    ↓ Generate Bridge
VitureWrapperBridge.cs
    ↓ Use in Unity
Standalone app! πŸŽ‰

πŸ“– Documentation

πŸ’‘ Advanced Usage

The toolkit also provides individual tools for advanced users:

Tools β†’ Android Bridge Toolkit β†’ Advanced/
  β”œβ”€β”€ 1. Extract APK Classes
  β”œβ”€β”€ 2. Generate Bridge
  └── 3. Build AAR

βš–οΈ Legal & Ethics

Important:

  • βœ… Decompilation for learning and interoperability is generally legal
  • βœ… Creating your own implementations is fine
  • βœ… Extracting native libraries for your own wrapper is fine
  • ❌ Do not copy proprietary code verbatim
  • ❌ Respect licenses and terms of service
  • ❌ Do not redistribute decompiled code

This tool is for educational and interoperability purposes only.

πŸ› Troubleshooting

"javac not found"

# Set JAVA_HOME
export JAVA_HOME=/path/to/jdk
# or on Windows:
setx JAVA_HOME "C:\Program Files\Java\jdk-xx"

"UnsatisfiedLinkError" at runtime

  • Verify .so files are in Assets/Plugins/Android/libs/[arch]/
  • Check library name matches in Java: System.loadLibrary("name")
  • Ensure correct architecture for your device

"Build failed"

  • Check build log in wizard
  • Verify JDK is installed: javac -version
  • Ensure JAVA_HOME is set correctly

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ™ Credits

Developed by Instemic for Viture XR development

πŸ—ΊοΈ Roadmap

v1.0 βœ… (Current)

  • Workflow Wizard
  • Native APK extraction
  • AAR building (no Gradle!)
  • Bridge generation
  • Native library extraction
  • Complete documentation

v1.1 (Next)

  • Support for more Java types
  • Batch processing
  • Custom templates library
  • UI improvements

v2.0 (Future)

  • iOS bridge support
  • Visual scripting integration
  • Cloud build support

πŸ’¬ Support

⭐ Star Us!

If this toolkit helps you, please ⭐ star the repo!


Made with ❀️ by Instemic for the Unity community

"From APK to Unity in 7 easy steps!" πŸ§™

About

Complete toolkit for Unity Android development: Decompile APKs, build AARs, and generate C# bridges automatically. No Android Studio required!

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published