Where do I define variables? After the #includes, where I define Hooks or at the MSInitialize? Are they saved automatically in a cache, or how do I save them?
The Meaning of Life, the Universe, and Everything.
Join Date:
7/23/2014
Posts:
62
Member Details
The part below is the footer, so to speak. So the body, or location for variables would go where MSInitialize is. Or optionally define them in a separate file and include them:
Okay, I have now made a little mod to try if it works how I do, but I don´t know how I can build it into a .apk-file. Which progam does that? (I have NDK, JDK and SDK installed.)
If you want to learn native mods, check out my website - I put there some good tutorials from starting to a bit advanced things with explanations. Link: artus9033.weebly.com
I don´t know what a .mod-file is (but I would like to know), I have one folder, including 4 files, and two other folders (jni and res). Do I need AIDE or is there a progam for PC (IDA?) doing the same?
A .mod file is a third kind of mod (there are .mod = patches, addons = native mods, ModPE scripts = .js files). I don't know how they (exactly) are written. To make an addon, you need a compiler. On PC it is eclipse with Android Developer Tools (ADT), SDK (Standard Development Kit) and NDK (Native Development Kit) or Android Studio by Google with NDK installed somewhere. Then, you import the project (in android studio) and in build.gradle generated after importing, this one which has SDK location and add ndk.dir=[your path written like sdk.dir]. Then you just run it. If you have an android device with approx. 260 mb free, you can use the third way to compile the addon (this is the easiest one). Just install AIDE (Android IDE for android) and import the project. When asked after importing, install the Native Dev. Kit Support for AIDE and run the program. It will be installed on your device so you can test it. Hope this helps
P.S: Android Studio has SDK with it so you just need to install NDK.
A .mod file is a third kind of mod (there are .mod = patches, addons = native mods, ModPE scripts = .js files). I don't know how they (exactly) are written. To make an addon, you need a compiler. On PC it is eclipse with Android Developer Tools (ADT), SDK (Standard Development Kit) and NDK (Native Development Kit) or Android Studio by Google with NDK installed somewhere. Then, you import the project (in android studio) and in build.gradle generated after importing, this one which has SDK location and add ndk.dir=[your path written like sdk.dir]. Then you just run it. If you have an android device with approx. 260 mb free, you can use the third way to compile the addon (this is the easiest one). Just install AIDE (Android IDE for android) and import the project. When asked after importing, install the Native Dev. Kit Support for AIDE and run the program. It will be installed on your device so you can test it. Hope this helps
P.S: Android Studio has SDK with it so you just need to install NDK.
Artus9033, I'm confused on making a C++ Native Mod, I looked at your vids and IDK what to do, I need help!
I'm sorry that I don't check it in the moment, could anybody write a little example (at least one hook and one function(like a client Message?)) and give it me as .zip file which I just have to put into AIDE? That would be a big help!
Thanks
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI now understand how native mods are working, but I have problems creating my own.
Could someone give me a example that shows a client message when entering a world?
I would just need the example written as reply or the main.cpp
Thanks
This may help you out a bit.
Client Message function: Gui::displayClientMessage(string).
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumSo I would do it so???:
#include <jni.h>
#include <mcpelauncher.h>
#include <dlfcn.h>
#include <android/log.h>
MSInitialize{
MSHookSymbol(Minecraft$newLevel, "__ZN9Minecraft8newLevelEvv");
}
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved){
void* handle = dlopen("libminecraftpe.so", RTLD_LAZY);
dlerror();
Minecraft::newLevel(){
Gui::displayClientMessage("§7Thanks, §5NijlsYoshi!");
}
const char* error = dlerror();
if(error) __android_log_print(ANDROID_LOG_INFO, TAG, "dlerror: %s", error);
return JNI_VERSION_1_2;
}
Yup. Just like that.
And of course, optionally filling out the log info as-well. That should work.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumOkay, thank you
One more question:
Where do I define variables? After the #includes, where I define Hooks or at the MSInitialize? Are they saved automatically in a cache, or how do I save them?
Not a problem. Just returning the favor.
The part below is the footer, so to speak. So the body, or location for variables would go where MSInitialize is. Or optionally define them in a separate file and include them:
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
void* handle = dlopen("libminecraftpe.so", RTLD_LAZY);
dlerror();
// insert hooks here
const char* error = dlerror();
if(error) __android_log_print(ANDROID_LOG_INFO, TAG, "dlerror: %s", error);
return JNI_VERSION_1_2;
}
It saves to cache, I'm quite sure.
: MCPE Native Mods Wiki
Also, fond this. Might be of some help
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI know the wiki, but I wasn't sure. Thanks again.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumOkay, I have now made a little mod to try if it works how I do, but I don´t know how I can build it into a .apk-file. Which progam does that? (I have NDK, JDK and SDK installed.)
Thanks
If you want to learn native mods, check out my website - I put there some good tutorials from starting to a bit advanced things with explanations. Link: artus9033.weebly.com
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI know your website, but I wanted to know with which program I can turn my Mod into an .apk
Do you mean how to turn a .mod into .apk?
If so, just download a template, import it to AIDE (Android IDE for android devices) as a project, paste your source code and run it.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI don´t know what a .mod-file is (but I would like to know), I have one folder, including 4 files, and two other folders (jni and res). Do I need AIDE or is there a progam for PC (IDA?) doing the same?
A .mod file is a third kind of mod (there are .mod = patches, addons = native mods, ModPE scripts = .js files). I don't know how they (exactly) are written. To make an addon, you need a compiler. On PC it is eclipse with Android Developer Tools (ADT), SDK (Standard Development Kit) and NDK (Native Development Kit) or Android Studio by Google with NDK installed somewhere. Then, you import the project (in android studio) and in build.gradle generated after importing, this one which has SDK location and add ndk.dir=[your path written like sdk.dir]. Then you just run it. If you have an android device with approx. 260 mb free, you can use the third way to compile the addon (this is the easiest one). Just install AIDE (Android IDE for android) and import the project. When asked after importing, install the Native Dev. Kit Support for AIDE and run the program. It will be installed on your device so you can test it. Hope this helps
P.S: Android Studio has SDK with it so you just need to install NDK.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThanks
Artus9033, I'm confused on making a C++ Native Mod, I looked at your vids and IDK what to do, I need help!
I'm using the Dev C++ Application
Dev C++ app is for making PC programs. You need AIDE on an android device or Android Stucio (or Eclipse) on a PC with installed NDK.
If you're using Eclipse, you will need to install an eclipse addon called Cygwin.
ty
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI'm sorry that I don't check it in the moment, could anybody write a little example (at least one hook and one function(like a client Message?)) and give it me as .zip file which I just have to put into AIDE? That would be a big help!
Thanks