 Okay, today, we are going to basically use Magisk, the rooting application. So make sure you watch the previous video where we set up root using Magisk. I'm assuming that's how you say it. And basically, we're going to make our own module. You can have modules in Magisk that do a bunch of different things. But I'm going to show you manually how it works. You can also, I guess, package these up to share them or install them. But we're going to do it manually. So let's look here at this Android device. And this is a GIS, a generic system image of Lineage OS installed on a Motorola device. If we go into Magisk, you'll see, if we get back to the main screen here, you'll probably start off here, there's a modules and you'll have a list of modules here. You can say install from storage and you will have a zip file that has a module setup. But I'm going to show you what those modules contain, where they're stored so you can make your own, without having to go through that, may not be advised. But let's go ahead and see. Let's make this full screen. I'm going to ADB into the phone and I am going to become root by typing SU. Now, I am going to put links in the description to notes on how to do all this. But basically, we're going to move into data, ADB modules, okay? And in here, currently, there's nothing because I have no modules installed. But to make a module, you just make a directory. And so I'm going to call this one, I'm going to make a directory. So make dir and I'll just call it my bin, okay? And again, if we go back over to our screen here, let's see if it shows up right away. It does. It shows up. It's not activated. As far as I know, I have to reboot to activate this. But you can see right there, I can turn it on and off and I can remove it. But let's go back to our shell. We have it, but it doesn't do anything. There's nothing in there. But basically, what this is going to do, think about, again, if you have Linux booting off a USB drive or a CD, if you still use CDs, basically it has a system image on there. Just like you have a system image for Android, a non-writeable system image that loads. And it loads the files as you need them. But you can make changes. You can do updates. You can install things. And basically, it's like layering these updates on top of it. So basically, what's going to happen with, if you have Magisk installed, it's going to load the system and then it's going to load our modules over top of it. So for example, if I echo out $0, it tells me currently the application is running, which is my shell. You can see it's in system bin SH. So we know, or we can echo out $path and it shows all our path directories where our executables are. And what I'm going to do is I'm going to want to add. So for example, let me show you. If I was to move into system bin and I was to create a file, try to create a file called touch. So hello, I'm trying to create a file called hello. It's going to give me, you can't do that. It's system read only. And it's not even, even if as root, I can't do that because the system is mounted as root only, read only, sorry, root only. Let's go ahead and go back to our directory here. So my bin. So what I want to do is I want to make a directory called system. And inside that, I'm going to make a directory called bin. Anything I put in this directory, once this system bounds, loads, it's going to load this over top of it. So if I was to go in here and I was say cat just to create a file, I'll call it hello. And again, before I do that, just to remind you, our shell is not just bin.sh or bin bash, unless you have a bash binary, which doing this, you could install bash if you want it. But I'm going to create a file called hello. I'm going to give it a shebang line telling it what interpreter to use. So system bin sh. And I'm just going to echo hello world. And I get to the final line and I'll hit control D. That's just, that's using cat as a poor man's text editor. So now I want to make that executable plus x hello. And now if I dot slash, I can run that file and it says hello world. But it's only working if I give it the full path name, right? If I was to just move into my root directory and say hello, it's not going to work because it doesn't know where it is. I give the full path name to it and run it. But what I'm going to do now is I'm going to reboot. And again, I'm not sure if you have to reboot. I've tried going into Magisk and disable or removing it or disabling it and re-enabling it and that doesn't seem to take effect. So basically you're going to make these changes and reboot your system. If you know otherwise, comment below. And so I'm just waiting for my system reboot. But basically again, it's loading up the system now. It's going to mount your system, your Android system, as read only as always. But it's going to mount over top of that any of the files in this directory. So you're going to have a system bin folder. It's going to still have all your executables in there. But it's going to add my hello executable, my hello script. And if there is already a hello, it's going to trumpet. It's still going trumpet as in trumpet, that's a trombone, trumpet. It's going to trumpet as in it's going to be, yours is going to take over the other one. So that's something to be careful of. You don't want to overwrite something important to the system, which we'll talk about more in a minute. Okay, unlock my system. Let me ADB shell again. And if I was just type hello now, it says hello world. I can run my executable, my script from anywhere in the system. And if I was to go into, actually I haven't tried this yet. Let's go into system bin and list everything that starts with an H. Look, it looks like my hello is there. It's not really there because that partition is read only, but it's loading anything in this in my modules as if it's part of that system. Let's give another example. So if I was to go back onto my desktop. So top screen here, or ADB into my phone, bottom screen here. I am in a directory on my desktop. And I have a copy of busybox. It's actually a real old copy of busybox, but it doesn't matter. If you just Google search busybox binaries, it'll bring you to the official busybox website where they do have a bunch of binaries. But the ARM version, the ARM compiles are pretty old on there. And this is an ARM device. So it still works. You can compile your own or you can go out and find somewhere else. I just grabbed the one from there. But what I'm going to do is I can't push directly to the directory I need to push to because you need to be root. And there's probably a roundabout way to do it. But I'm just going to say ADB push busybox. And I'm going to put it on my SD card, which is actually just your internal storage. OK, now let's see, make that full screen. So we're back on my device. Now let's clear the screen. And what I'm going to do now is move back into my module, right? So ADB or sorry, data ADB modules, the name of my module. And then I made a folder called system bin. Oh, have to be root to do that, right? Let's try again. There's my hello script. But now I'm going to move from my SD card busybox to here. And I'm going to make sure it's executable change mod plus X busybox. And now I can busybox and it will list out all the applications built into the single binary, which is awesome. There's lots of stuff there. So, for example, let's clear the screen. Oops, clear the screen. If I was to type W get, my system doesn't have W get by default. But if I was to busybox and then type W get, it's going to use busybox. So I. Oh, right. I didn't reboot the system. Let's let's try that again. We're going to dot slash busybox W get. And there we go. Busybox is running with W get. Now I can also link W get to busybox. And it will then anytime type busybox it or W get it will run busybox as W get. But real quick, let's reboot here just so I can show you. Again, it will take a moment for it to reboot. So again, we're rebooting. It's going to mount the system as normal. And then it's going to allow me to use busybox from anywhere in my system. And all the tools built in busybox. There's web servers, telnet servers. There's DD. There's all those core tools, grep, octane. Some of them might be a little lighter weight than the official full versions. But for general usage, they're great. Okay. So just give it a moment here to boot. And again, then I'll be able to busybox W get. Now, again, if you were to like use a symbolic link, link W get to the busybox executable. When you run W get busybox is going to go, oh, you're running it as W get. You don't have to type busybox W get. And we'll talk about that in a moment and some issues you might run to that. So almost booted here. AB shell. Once it's done loading, I will unlock the screen. And there we go. Now, if I was to busybox, you can see that it's running. And again, I can clear the screen. Busybox W get and W get works or any of the other executables. So if I was to busybox SH, okay. Now I'm in the busybox shell and all those tools are built. Oh, usually all those tools are built in. What I'm about to show you isn't working. But I am going to show you something you should not do that you may be tempted to do. So let's SU and we will move into our module here. Now, if you were to run busybox, just as is, and you go up to the top of it, you can see there's an install option, right? So I can say this. I can say busybox dash S. I'm in this current direction. So I can say dot and real quick before I do that, let me list out. So I got two binary. I got two files in here, my hello world script and busybox. If I was to run busybox install dash, dash install dash S and give it the directory where I want to install the executables to do that. Now I list out. You can see I have all these executables in there. But if I was to list them out long ways, you can see they're all linked into busybox. Don't do this, at least not in this directory. Because right now if I reboot, what is going to happen is my system is going to load all the way up to the lock screen and then crash and say the system can't boot. Do you want to do a factory reset? I didn't look too much into it, but I'm assuming that one of these links is a binary that it is very specific to Android and it's not working properly for the device. So you can install whatever executables you want in this directory. Just make sure you're not overriding something that's already on the system that is important. Anyway, that is it. You can make a bunch of little scripts like this, run them anywhere on your system. I hope you found this useful. Please visit filmsbychrist.com. That's Chris of the K. There's a link in the description as always. I hope that you have a great day.