A C++ library focused on the Il2Cpp runtime wrapper.
AURA is a C++ library that provides a simple wrapper for the Il2Cpp runtime, specifically designed for Unity games on Android Platform.
To add AURA to existing projects, run this command below.
git submodule add https://github.com/MrVenumX/AURA.git- Android NDK (latest)
- C++17 or later
To get started, include AURA sources in your project's build configurations. You can build manually or download the prebuilt static library from the releases page.
We provide basic examples of how to use AURA in the example/ directory.
To initialize AURA, call AURA::API::InitializeAPIs() and attach to the Il2Cpp thread.
auto handle = dlopen("libil2cpp.so", RTLD_LAZY);
AURA::API::InitializeAPIs(handle);
AURA::Thread::Attach();
/* your code here... */
AURA::Thread::Detach();
⚠️ Warning: Thread must be attached to Il2Cpp thread before access other AURA functionality to avoid a crash.
To get an Image, use AURA::Image(). It provides easy and simple access to all classes inside the Assembly.
const auto AssemblyCSharp = AURA::Image("Assembly-CSharp");
if(AssemblyCSharp.IsValid()) {
/* Do something if valid... */
}
⚠️ Warning: Ensure the name of Image don't include.dllextension.
To get a Class, use AURA::Class(). It provides easy and simple access to all fields and methods.
const auto AssemblyCSharp = AURA::Image("Assembly-CSharp");
const auto Player = AURA::Class(AssemblyCSharp, "Player");
if(Player.IsValid()) {
/* Do something if valid... */
}To get a Field, use AURA::Field<T>(). It provides easy and simple access to the field.
const auto AssemblyCSharp = AURA::Image("Assembly-CSharp");
const auto Player = AURA::Class(AssemblyCSharp, "Player");
const auto Money = AURA::Field<int>(Player, "Money");
if(Money.IsValid()) {
/* Do something if valid... */
}To modify or access a non-static Field, use this code below.
const auto AssemblyCSharp = AURA::Image("Assembly-CSharp");
const auto Player = AURA::Class(AssemblyCSharp, "Player");
const auto Money = AURA::Field<int>(Player, "Money");
if(Money.IsValid()) {
Money.GetValue(playerInstance);
Money.SetValue(playerInstance, 999999);
}To modify or access a static Field, use this code below.
const auto AssemblyCSharp = AURA::Image("Assembly-CSharp");
const auto Player = AURA::Class(AssemblyCSharp, "Player");
const auto Money = AURA::Field<int>(Player, "Money");
if(Money.IsValid()) {
Money.GetStaticValue()
Money.SetStaticValue(999999);
}
⚠️ Warning: MethodField.SetStaticValue()often cause a crash, we recommended you careful at using it to avoid crash.
To get a Method, use AURA::Method<Ret, Parameters>(). It provides easy and simple access to the method.
const auto AssemblyCSharp = AURA::Image("Assembly-CSharp");
const auto Player = AURA::Class(AssemblyCSharp, "Player");
const auto getHealth = AURA::Method<int>(Player, "get_health");
if(getHealth.IsValid()) {
/* Do something if valid... */
}To invoking a non-static Method, use this code below.
const auto AssemblyCSharp = AURA::Image("Assembly-CSharp");
const auto Player = AURA::Class(AssemblyCSharp, "Player");
const auto getHealth = AURA::Method<int>(Player, "get_health");
if(getHealth.IsValid()) {
auto health = getHealth.Invoke(playerInstance);
}To invoking a static Method, use this code below.
const auto AssemblyCSharp = AURA::Image("Assembly-CSharp");
const auto Player = AURA::Class(AssemblyCSharp, "Player");
const auto getHealth = AURA::Method<int>(Player, "get_health");
if(getHealth.IsValid()) {
auto health = getHealth.InvokeStatic();
}This project is licensed under the MIT license; see LICENSE for more information.