 If you enjoy my tutorials and would like to see more, please think about contributing to my Patreon account at patreon.com forward slash metalx1000. Okay, with this whole series of tutorials, I'm assuming that you already have a rooted Android device. You're somewhat familiar with Android debugging bridge ADB, and you're somewhat familiar with Linux command shell. These are somewhat advanced tutorials, and so I'm assuming you understand the basic tools, and I'm just going to show you how to utilize some of these on Android. So I'm already logged into my Android device through USB here, and what we're going to do today is we're going to write to the frame buffer device. Now, a lot of programs look for the frame buffer device by default under your dev folder. So we'll go cd-dev, and the list fb-0 would be the first frame bus for frame buffer device, which is your display basically, your video output here. If I hit enter here, you can see there is one. Some devices, Android devices may not have that right there. I actually have already linked that on my device. So on a lot of Android devices, it will be under dev, and then under graphics, and then you'll have a few, oops, list fb. Let's do this again. Let's go graphics, and then list. There we go. So we got, here it's showing seven. I'm not really sure why. I can take a guess. I mean, there is an HDMI output on this tablet. Maybe one of them is supposed to be that. I'm really not sure, but the default, the main display should be fb-0. So first thing I'm going to do anytime I'm working with a frame buffer device is I'm going to link that to the dev folder, in which case the command would be ln-s device, graphics fb-0, and I'm going to link that to device fb-0, which I've already done on this device. So again, the device, the frame buffer is basically allowing you to write directly to the screen, or retrieve directly from the screen. The way we can test this, make sure that we have it set up and we know what device is, which device, in case you have more than one display, is we can write to it. Now, again, if you're familiar with Linux systems, or Unix systems in general, you should probably be familiar with under your device folder, your dev folder, you're going to have something called u-random. And if we cat that out, you can see it just creates random binary information. It's going to keep spinning that out until I stop. So I'm going to hit Ctrl C to stop that, clear the screen. Okay, so we can write random data. Let's write that random data to our tablet screen here, to our frame buffer device. So same thing, cat out that device, and I'm going to redirect that information into dev.fb-1, or dev-graphic-fb-1, depending on how you want to do it. And as you can see, we get like this staticky, colorful-looking snow on the screen, because we overwrite basically all that data from u-random was writing colors to each pixel. And don't worry, as soon as you move the screen or something on the tablet decides to refresh the screen, it will clear that out. So again, we can do it again, make some random snow on the screen there, but as soon as either one of the programs or I move the screen, it clears it out. So that's how we can write to the device. Another thing we can do is grab an image. So what I'm going to do here is I'm going to grab an image from our frame buffer device. So I'm going to, just like before, we're going to cat out, but we'll cat out what's already on the frame buffer device. And when we hit Enter here, you can see again a bunch of binary data coming out. And this is actually all the different pixels on that screen in a raw format. And once it gets to the end of the screen, it closes out. So I'm going to clear this out. What I'm going to do is I'm going to pipe that into a file. So let me get somewhere where I can save stuff. I'll go to my SD card, which is actually my internal memory, but someplace where you can have storage. And again, I'm going to cat that out. I'm going to put it into, I'll just call it, Screen. And I'll hit Enter. And it wrote all that information to the screen file. Now, what do we do with this? Now, this is not a JPEG. It is not a PNG. It is not a GIF or a Bitmap. It is just raw data, raw image data. So what we're going to do here is I can now cat that back out to the frame buffer device. So let me go here. I'm going to go to another one of my desktops. So there's like nothing on this desktop here, or I can go into my applications here. And what I'm going to do is I'm now going to cat that screen file I just created back out to the frame buffer device. Oops, what did I do wrong here? Oh, I didn't redirect it. There we go. A little greater than symbol there. But boom, now we're looking here and it looks like we're looking at our desktop, but we're actually not, we're still in our applications menu. It's just the device is not constantly refreshing the screen that would take extra power that isn't needed. So once it displays something, if there's no animations on the screen, there's no need to refresh it. And once I go to move anything, you can see it goes back to our application menu here. And let me refocus this and make sure. There we go. That's as good as it's going to get. Okay. Okay, so don't be confused. Again, this is not an image file like a JPEG or a bit mat. I'm not opening it up in an image viewer to view it. I am actually writing all the pixels back to the screen. So that's one thing you can do. What if we did want to create a PNG or a JPEG file from this data that we've grabbed? Well, we can do that too. We can pull this information to our desktop and then use either FFmpeg or AVconvert, which is a fork of FFmpeg to convert it to one of those formats. So let me go ahead and exit out of here. So now I'm back on my desktop here. And what I'm going to do is I'm going to use my ADB. I'm going to use sudo here. Sometimes the permissions get messed up and I don't want to screw up this video. So I am just going to run ADB with sudo, but really you just need to start the daemon in the background with sudo. But anyway, with ADB you should know you can pull and push. Well, I'm going to pull something. What am I going to pull? Well, I'm going to pull this dev. Now remember, in a Unix operating system, in Unix-like operating systems such as Linux, all your hardware is recognized just as any other file on your computer, which is great. So you can just use it like you're pulling a file off the device. So I'm going to pull the frame buffer file, which is our raw data for our screen. Now I'm going to output it into, I'll just call it screen. Okay, so boom. Give it a second. Okay, now if I list out, you can see the folder man has a folder file called screen. If I try to display that and view it in an image viewer such as display, you can see it doesn't work. There's no decoding delegate for this image format screen. It doesn't know what to do it because it's raw information. But FFMpeg does. I'm running a newer version of Debian, which actually has now started using the fork of FFMpeg called AVConv. I'll call it AVConvert because I'm sure that's what it's short for. And what I'm going to do is I'm going to type in AV. Okay, almost forgot an important part. You need to know the exact resolution of the screen that you're grabbing from. So let's go back into our shell here. And how do we get the display resolution? And you may know what it is, and I've seen different ways of looking this up while on the device. But some ways work on some devices now. This I have found has worked on at least this device. I'm going to dump sys, which is a program I'm going to say window. And then I'm going to rep from that. M, U, unrestricted anyway. That didn't work. Why didn't that work? Oh, because that should be an M, not an N. So there we go. I grabbed this and you can see that this screen is 800 by 480. Let me do that again. But instead of doing that in a search screen, I just to show you that there is an unrestricted and a restricted resolution. We want the unrestricted, which in this case is 800 by 480. Again, different for different devices depending on the size of your screen and the resolutions it offers. So using AV convert or FFM peg, I'm going to say dash F and I'm going to say raw video because it's in a raw format. Let's say dash pics FMT. And we're going to say that it's an RGB32 image. And we're going to say its size is 100 by 480 as we just looked up. We're going to say the input file is our screen file. And we'll say we want the output to be screen.png. Now it's going to give you a little message here saying that something about the frame. Don't worry, it did work. Back when I was using FFM peg, I had to do the same command. So it would be FFM peg dash v frames 1 telling it that it's only one frame. With the newer AV convert, that gives me an error. So I don't use that. So if you're using FFM peg, you may need to add that. Anyway, if I now display my screen.png, you can see the screenshot that we took from the device as a png. And I think that is pretty much everything I wanted to go over in this tutorial. I think it is. So I thank you for watching. Oh, also the way we grabbed that raw data from the frame buffer device, we were able to also push it to the frame buffer device. So you can make the screenshot that you took pushing it back to the device, just as we did on the device, but not with the png with the raw data. Just a little tip there. Anyway, I thank you for watching. Please visit filmsbychrist.com. That's Chris of the K. There should be a link in the description. Also, if you enjoy these tutorials, feel free to show your appreciation by becoming a patron of mine on patreon.com. That's patreon.com. forward slash mail x1000. You can help support these videos and also have a little more say on what videos are made. So as always, thank you for watching. And I hope that you have a great day. Also, notes to everything should be in a link in the description. Thank you. And again, have a great day. Today, we're going to be looking at using bootstrap to create arm images for devices such as Bogo plugs or to get Debbie in there. This is like some downloadable file. You could do four connections and speed up your download. Another option would be is sometimes servers have mirrored servers. So even though you have that original server, you may have another server here and here that you can download from. An axle allows you to do that too. You have the same file on multiple servers.