BootBuddy - Run Boot Scripts from SDcard (a safe alternative to init.d) - Android Software/Hacking General [Developers Only]

INTRODUCTION:
Boot Buddy will allow you to run Linux shell scripts when your Android device is booting up. It will run your scripts early in the boot process, before the home screen appears.
The intended audience is generally intermediate to advanced users, and those who want to play with shell scripting on their device.
FEATURES:
BootBuddy is similar to init.d scripts, but with a core difference that it stores boot scripts on your SDcard instead of the internal system. This allows for several interesting enhancements. Feature listing-
Much more Safe than init.d. If you have a script that is malfunctioning, just boot with the sdcard out, and put the sdcard back in after your device reaches home screen. Your device is Saved, No Problem!
Boot Buddy is designed from the start to run scripts right from your SDcard. Just download any scripts to your boot_buddy_scripts directory and they're ready to run. (No more screwing around with permissions and files in your /system/etc/init.d/*)
SDcard storage allows you to copy a script to another device, or multiple devices easily.
Boot Buddy's author has several years of scripting and programming experience. It is streamlined, fast, and doesn't perform worthless functions like repeatedly logging the authors name and time (*hint to a t-init author*).
Clear goals of making operation simple, intuitive, and clean.
If you're currently using an "init.d" solution, BootBuddy can integrate seamlessly with it.
If you try BootBuddy and you don't like it, the installer also works as an uninstaller for easy clean removal.
BootBuddy is Open Source GNU GPL. Open for anyone to modify and improve upon.
As a developer, I make software to operate the way I would want if I were an end user, because I actually do use it, and I am an end user like you.
REQUIREMENTS:
Android 4.0 and up
Rooted device
An sdcard
Script Manager Free (or any other app that can run scripts as root)
Boot Buddy Installer bb_install.sh
INSTALL:
Start Script Manager, and allow/grant root access.
Navigate to the bb_install.sh file.
Tap on the file to show the menu options.
At the top, highlight the "Su" icon.
On the top-left, tap "Run".
The script will run quickly. It will automatically detect your sdcard location and create a folder on your sdcard named "boot_buddy_scripts". In that folder, you put the scripts you want to run at system boot. A log file will be kept at /data/boot_buddy.log
If you need your scripts to run in order, they are ordered by filename using the busybox "sort" program. They will run in alphabetical order using this format 0-9A-Za-z.
YOUR FIRST SCRIPTS: (OPTIONAL)
Here are a couple example scripts you may use.
The Android /system is normally mounted with read-only permissions by default. We will change that with the first script listed below. It will cause /system to be remounted to read-write permissions during boot.
The second script will create a file at every boot named /mnt/sdcard/sys_mount_info.txt. That txt file will give us information about how /system is currently mounted.
Download the file 00rw_system.sh into your boot_buddy_scripts folder.
Download the file 99sys_mount_info.sh into your boot_buddy_scripts folder.
Reboot your phone.
That's it, you just installed 2 new scripts and had them run at boot. It's Really just that simple to add startup scripts to your system.
To verify they are running, use any text viewer to open the file /mnt/sdcard/sys_mount_info.txt. It may show more than one line of text. There should be a line similar to this:
/dev/block/(device specific text) /system (fstype) rw,(more text)
The rw means that /system was successfully remounted as read-write during boot.
At any time you can delete either script if you choose. Easy!
UNINSTALL:
If for any reason you find you don't want or don't like Boot Buddy, you can cleanly uninstall it using the installer bb_install.sh. These instructions are almost identical to installing. (All match the installation steps, except step 4)
Start Script Manager, and allow/grant root access.
Navigate to the bb_install.sh file.
Tap on the file to show the menu options.
Type --uninstall in the text area labeled Arguments.
At the top, highlight the "Su" icon.
On the top-left, tap "Run".
Boot Buddy will be uninstalled. It will not remove the contents of your boot_buddy_scripts folder. If you have an "init.d" system installed, it will cleanly remove only Boot Buddy parts and leave the rest.
MUST READ
ADVANCED NOTES:
Boot Buddy will Not cause harm to your system, but it may not work on custom roms. Also, it may fail to detect the real location of your SDcard. It requires that /system/etc/install-recovery.sh is run during the boot process, and that file will be created if it does not exist. Also the file /data/boot_buddy.sh will be created. The script /system/etc/install-recovery.sh will run /data/boot_buddy.sh. The script /data/boot_buddy.sh will run the scripts on your sdcard. The file /data/boot_buddy.log will log any script output.
For Windows and Mac users- If you download the installer to your pc first, do not edit the installer with a text editor. Your computer will add hidden markers at the ends of each line that will prevent the installer from running. If you want to edit it, you should do so on a Linux pc or directly on your Android device.
Tell us about your results!!!
BootBuddy source code: http://github.com/Sepero/bootbuddy
NOTE : I AM NOT A DEVELOPER I AM ONLY SHARING THIS. So Try On Your Own Risk. I Can't Help Anything.
Credits :
[email protected]

Script mgr says I'm not root, despite me in a root terminal elsewhere. wtf ?? ...
I'm not root in script mgr., even though I'm showing up as root in terminal.
I've installed Super user (chains sd ), just in case the App doesn't support my other Supersu App or similar.
I've utilised the su icon and run.
I did tick run as executable.
No reboot tried.
What am I missing ??
Please advise.

I give you 5 stars to the thread

Almost first!!! haha.... this is awesome dude this could be HUGE.

Steve Eligoyo said:
I'm not root in script mgr., even though I'm showing up as root in terminal.
I've installed Super user (chains sd ), just in case the App doesn't support my other Supersu App or similar.
I've utilised the su icon and run.
I did tick run as executable.
No reboot tried.
What am I missing ??
Please advise.
Click to expand...
Click to collapse
You must to select root when start on script mgr, you have skull head with crossed bones

Steps to complete failure: Page 96 ?? ...
Here are the steps I've taken to get kicked in the teeth:
Boot phone > menu > script mgr. > start > scroll to file (in this case bb _install.sh ) > open file > tick su ( tried boot and bgr several times, nada amigo ) as instructions state > run > unexpected oper error: your not root > rinse and repeat sixty times > open terminal > su > Works just fine > Post my question on xda in the WTF Thread
Update:
After creating the directories and files needed to make this train wreck into a working setup, (obviously a few are missing here, working on it), I reopened script mgr and browsed the file system, which shows bb _install.sh file (and the other two in this
Thread as well) with the green su skull and crossbones with the boot dot next to those skulls, yet the apps shell /console says oper error - Your not root.
Again, I open terminal, su > enter > Viola!, I'm root.
I've installed the sdcard v. of script mgr as well and I get a message stating /data/system/xbin does not exist.
I'll likely need to tweak the script mgr settings to /sdcard 0/externalsd /directory bind /system /xbin/bb _install.sh - something like that.
Still doesn't explain why the app is putting the brakes on root terminal in the nag screen.
Any ideas ??

MAN THANK YOU !!!! as a noob i couldn´t get init.d to work right. so i tried your script on the xperia z3c with stock 4.4.4
to make it compatible with z3c you need to edit the file /data/boot-buddy.sh after the installation
and replace both
/boot_buddy_scripts/
with
/storage/emulated/legacy/boot_buddy_scripts/
or
/storage/sdcard1/boot_buddy_scripts/
or another prefered location
then make a new folder boot_buddy_scripts in the location.
really it executes the scripts way before the apps are starting , this is so nice and will be on my phones from now on !
edit: i also now changed the log file creation to the sd card for quick access (most filebrowsers open there by default)..
the logfile is major awesome btw if something didn´t go right , its easy to debug , thanx alot again

Won't install says I don't have busybox. I have it but it has to go in system bin instead of xbin. Amy way to get this working?

Related

[TUTORIAL] Jit hack for beginners - please move to G1 General

Note: This guide is for beginners who might have barely been able to get a custom rom running on their phone, who might not know how to unzip a file on their android phone, and who are not comfortable navigating a linux file system, but who are daring enough to try a simple hack to get significantly more speed out of their phone. Before reading this, please read the thread in the first reply below this post, and if that works for you - use it! If you want to know more, find out what its doing, or if the other Jit hack technique does not work, you can try this. Or you can tell me I fail. Maybe a moderator could move this thread to the basic G1 subforum?
Hello,
I really enjoy both Super D rom and the Jit hack posted by xda member licknuts in the post called [HACK] JIT enabled Dalvik VM on Android 1.6 (Dusted Donuts) [Hack] - the link to this post can be found in the first reply here, if you scroll down.
So, I thought id post a guide on how to accomplish this hack using Amon_Ra's recovery, Super D or Cyanogen rom (probably works on other roms listed in first post of above thread), and a couple apps available from the android market. I'm not trying to take any credit for this hack - I'm just trying to explain it step-by-step for people who have barely managed to get a rom running on their phone but can't get the hack working using the instructions in the above thread and might not be very experienced with navigating around a linux filesystem.
Please read all of this before beginning - you'll need to write some of it down for when you're in the recovery console doing some file copying/moving/renaming. Especially take note of the instructions at the end for restoring in case of a disaster, although if you're really afraid even after following these instructions, you probably shouldn't try this.
1. Download and install AndroZip File Manager app from android market.
(this is so we can un-zip or decompress a .zip file we will download later containing a modified libdvm.so file, which we will use to replace the original libdvm.so file, enabling Jit)
2. Download and install Linpack For Android app from android market.
(this is so we can benchmark or test our phone to make sure this hack actually works. we can measure the MFLOPS score, or basically how many calculations the cpu is able to perform in a set amount of time)
3. Run Linpack For Android and press "Run Benchmark" - remember the MFLOPS value.
(it should be around 2.5 or so - when we enable Jit, we should get more like 3.5 MFLOPS which means more speed)
4. Download a specific file from the original thread listed above, BUT get the file from alldroid by t3hsteve... its in the first post of the above-mentioned thread about halfway down.
(if this link goes down, the point is that you need to obtain the new modified jit-enabled libdvm.so file from somewhere, either in a zip file or by itself, and download it to your phone so you can use it to replace the original libdvm.so - the instructions that follow apply only to the specific file above. If you get a different file you'll have to navigate through the unzipping process differently based on where the libdvm.so file is inside the zip file, and the result being the modified libdvm.so file in the root directory of your sdcard (/sdcard) - if you download the correct file from that post you can follow the instructions below exactly. I would post the link but I'm not allowed to post outside links.)
5. Run AndroZip app, and navigate to your download folder. This should just require clicking the "download" folder, since you should already be in the ./sdcard folder which will be listed as your current directory when you start AndroZip.
(If you're not in this directory, navigate back as far as you can by scrollng up in the app and tapping the blue/left arrow to go "up" or back a direcory. You aren't done with this step until you see ./sdcard/download/ at the top of AndroZip and you can scroll down to see the file "dusted-donuts.zip" - this is the .zip dile we downloaded that contains the libdvm.so (and some other files). If you downloaded a jit-enabled/hacked/modified libdvm.so from a different source, you don't need to be doing any of these unzipping steps.)
6. In AndroZip, click "dusted-donuts.zip" and click "extract to." Then click the back arrow in AndroZip, which should take you to the ./sdcard directory. Click "extract here."
(you will see ./sdcard at the top of AndroZip indicating this is the directory you changed to. When the "successfully unzipped file" message has appeared, you have extracted the libdvm.so and possibly some other harmless files which can't do any damage since they're just in your download folder and not one of your android system folders.)
7. In AndroZip, click the "dusted-donuts" folder, which will have appeared after you extracted the above zip file, and then click the "lib" folder (this is all part of the zip file you extrated) - this is where the modified libdvm.so file is. Click AND HOLD the libdvm.so file, and a menu will appear. Click "copy." Click the back arrow (scroll up in the AndroZip app if you can't see it) until you have reached ./sdcard again (you will have to click it twice, once to go from /sdcard/dusted-donuts/lib/ to /sdcard/dusted-donuts/, and a second time to go from /sdcard/dusted-donuts/ to /sdcard, which is where we want to paste the libdvm.so file. Click "copy here" in the upper right - the "copy action successful" message should appear. If you scroll down, you should see libdvm.so and at the top of AndroZip you should see that you're in the ./sdcard folder.
8. Reboot into recovery console.
(the place you go to flash a custom rom and do other low-level operations, by rebooting your phone, or powering it off and then starting it back up and holding Home key and Power key at the same time. Don't hold them when your phone is still shutting down or rebooting, wait until the screen has turned black. You only need to hold them until the G1 screen shows up with white text and the phone vibrates briefly. Then you can let go and you will enter recovery. If the system boots normally, pull the battery and try again.
9. Click "go to console"
(Slide your screen so you can use your hardware keyboard if you haven't opened it already. At the console you might see the message "press enter" - if you do, press enter to get a command prompt. Pressing enter even if you don't see this message won't hurt anything. You should see a command prompt, which is a character or set of characters at the start of a line prompting you for or waiting for a command to be entered. It should look like / or # or # / or > or anything like that. It might also have a flashing cursor, or underscore character that looks like _ or something similar.)
Now we are going to back up the old libdvm.so file and put the new modified one in its place, enabling Jit for a speed improvement.
10. Type these commands, pressing enter after each line:
mount /sdcard
mount /system
(You have now enabled access to or "mounted" your sdcard directory (where the new libdvm.so file is) and your system directory (where the current libdvm.so is) so you can do file operations on them such as copying/pasting and moving/renaming.)
11. Type these commands, pressing enter after each line:
cd /system
cd lib
(You have changed directory (cd command) to the system folder you have just mounted in step 11, and then you have changed directory again to the lib subfolder of the system folder which contains various library files like libdvm.so - optionally, you could just type cd /system/lib and press enter.)
12. Type the following command, and press enter:
mv libdvm.so libdvm.old
(You have used the mv command (move) to rename a file, by "moving" it from one file name to another. This command can also be used in linux to move a file to a new directory sort of like cut and paste. Instead, you could choose a different extension at the end of that command, maybe .bak or something (mv libdvm.so libdvm.bak) - the point is you're renaming this file so its still available if you ever need to restore it (if this process doesn't work or you just want to go back to the way it was).)
13. Type the following command, and then press enter:
cd /sdcard
(This changes directory (cd) to the sdcard folder, where your libdvm.so file should be if you followed the steps above. We have to use a leading slash / before sdcard because we are telling linux or the terminal to change to a new main directory and not a subdirecory in the /system/lib directory, because that doesn't (well, shouldn't...) exist.)
14. Type the following command, and press enter (note that the first letter is lower case L):
ls libd*
(This will list (ls) all files (or folders too i think) that start with libd, such as libdvm.so file. I if there are no results, or you just see another command prompt, try typing ls by itself and pressing enter. This will show you all files and folders. Hopefully you see the libdvm.so file as a result of doing this ls command. If not, and you're scared and want to go back to the way things were, type: cd /system/lib ...then type: mv libdvm.old libdvm.so - Do Not do that if you are continuing on, it basically undoes what we did in step 13.)
15. Type the following, then press enter:
cp libdvm.so /system/lib/libdvm.so
(This will copy (cp) the modified/hacked/jit-enabled libdvm.so from the current directory (/sdcard) to /system/lib/ so it is in the correct system folder so Android can see it.
You might also try cp /sdcard/dusted-donuts/lib/libdvm.so /system/lib/libdvm.so if you extracted the zip file correctly in one of the steps above but did not move it to the proper place, if the above command doesn't work.)
16. Type the following, and press enter after each line (note that in the 2nd line, the first character is a lower-case L):
cd /system/lib
ls libdv*
(This will change directory (cd) to /system/lib, the libdvm.so folder which will now contain the libdvm.so file you copied there in the last step as well as the libdvm.old file which is the original libdvm in case you need to remove this hack and restore it. The ls command lists files starting with the letters libdv...)
Now you have finished, you can type reboot and press enter. This time, don't worry about holding home and power, because we just want Android to boot normally. This might take a while, but don't worry. Worst case scenario you can pull the battery and reboot into recovery (hold home + power) after you put the battery back in. Then you could do something like this to restore your original backed-up libdvm.so:
ONLY DO THE FOLLOWING IF... you want to restore your system back to normal and remove the modified libdvm.so file:
mount /system
cd /system/lib
ls libd* (confirm you have both libdvm.so and libdvm.old)
rm libdvm.so (removes libdvm.so, like delete command)
mv libdvm.old libdvm.so (moves libdvm.old to libdvm.so, like rename command)
If this doesn't work to restore, I'm sorry but you'll have to re-flash your custom rom from recovery.
You can check that this hack is working by using Linpack app and clicking the Run Test button, you should see approximately 3.5 MFLOPS. Click Run Test a few times and that number might grow a little if it is less than 3.5.
Thanks to the original poster licknuts mentioned above - all credit goes to him and the original people who figured out this hack in the first place.
[HACK] JIT enabled Dalvik VM on Android 1.6 (Dusted Donuts) [Hack]
the original post by licknuts, it is a more informative read and instructions are a lot more concise
licknuts said:
Primer: Read this about Dalvik VM http://en.wikipedia.org/wiki/Dalvik_virtual_machine
Read this to: Google Groups post about JIT compiler for Dalvik VM from Android-Platform Link
From the post we see that this particular compiled library is ALPHA, so results can vary, but from reading most posts in this thread the results are right near the talked about 3x faster code, stability is going to vary on what apps and or widgets are running. More Widgets = slower performance as these have processes that are eating cycles. When testing with Linpack wait for the advertisement to load first then tap the benchmark button and remove your finger from the touch screen. Background process such that interrupt or having auto-rotate enabled while testing is going to give you slower benchmarks.
In short your apps should load faster and run faster, particularly 3D games. The web browser is faster and you can actually scroll through pages even while graphics are still loading.
The reboot when enabling it is long even appearing to hang at the G1 Screen for 5 minutes or more but once it starts booting past this you will know that your ROM is compatible. The cause is that the dex files are being optimized, after about a third reboot, your ROM should feel pretty snappy and launching apps should be quicker as well as switching apps. The snappiness lasts as well and as some may have said that it's a placebo effect are wrong. Bench mark readings prove it and more importantly a few ROM builders have included this in their 2.1 ROMs as experimental.
The libdvm.so that t3steve cross compiled for the DROID at the time was for Android 2.0, the library works for with newer ROMs Android 1.6 that have some eclair pieces built into the kernel, CyanogenMOD has been using bits and pieces for a while now, if other ROM builders have been using his kernel and framework than a good chance it will work for your phone as well.
I have nothing to do with the compiling of this or the exact functions of enabling JIT except that I had a hunch that the combo might work and it did, so I'm sharing it.
If you aren't good at typing in commands, or don't know how to extract a zip file and understand that a sub folder may or may not exist where you have extracted said zip file to, well.... you may run into some issues, maybe a video tutorial for basic command line on youtube would be a good place to learn.
I wanted to make a very detailed post on www.andoidonroids.com about how to mash the JIT enabled Dalvik VM library into Android 1.6 Donuts I'm calling the hack "Dusted Donuts" and take from the name for what you will. I have been using the JIT enabled Dalvik VM for about two weeks and i runs decent but not perfect. Anyhow a death in the family Sunday has kept me from making a decent post and haven't had the time to get to the website and post and cross post and give credit where due.
No doubt that aaraya1516 broke the news on http://forum.xda-developers.com/showpost.php?p=5703076&postcount=193 as he was first to break the hack on FastTest, not taking anything away from him on that.
My testing goes back two weeks or more even during the 580mhz & 780mhz hack, I was waiting for someone to compile a boot.img with some 2.x stuff and sure enough the carlospants boot.img from ctso worked with enabling JIT for Dalvik VM, but as we know now the overclocking doesn't work at the moment.
Thank Cyanogen and t3hSteve of which may not know that this was entirely possible. Cyanogen mixed in enough Eclair into his Donuts (he's like Willy Wonka) that makes it possible to use the cross compiled JIT enabled Dalvik VM library from 2.1 for the Motorola DROID 2.0.1 libdvm.so that t3hSteve of www.alldroid.com compiled for the custom roms on Droid.
WARNING: Using other methods supplied from other forum members that include replacing the build.prop may cause problems, using the build.prop from the original VMLIBS.ZIP (which is here for reference and original source for libdvm.so) is definitely going to cause ROM and application problems. Hello....use your head here... the VMLIBS.ZIP is for Motorola DROIDS, why would you put the build.prop file for a DROID on your G1 and expect your apps or ROM to work afterwards? It's so simple, you need 1 file, it's called libdvm.so it goes in /system/lib a file by the same name already exists there and it's in your best interest to at least back it up before overwriting it and gives you the ability in the event that your system doesn't boot up you can restore it through recovery console and get your phone to boot past the G1 screen.
FYI: Some ROMs have the option dalvik.vm.execution-mode=int:fast in the /system/build.prop file, this would need to be changed to dalvik.vm.execution-mode=int:jit or commented out or deleted. If you want to play with advanced options create /data/local.prop and fiddle in there with options available from typing dalvikvm -h in your console or terminal app.
Required:
1. Android 1.6 ROMS with a bit Eclair stuff in the Kernel and framework such as Cyanogen ROM 4.2.x, Super D 1.8 - 1.92, WG Y2.6, FastTest, KingKlick Eclair and more.. This libdvm.so works on Android 2.1 as well as it seems it should.. 1 st bootup is slow and I recommend you let it sit even when desktops are up for a couple of minutes and then reboot it, 2nd and 3rd bootups are faster and smoother response overall even for long durations, days.
FIX YOUR FILE SYSTEM FIRST !!!!!! Got to do it from Recovery Console, It's partly the cause of poorly running ROMS and takes seriously longer to type the command than to fix your unknowingly faulty file system. EXT2 is the worst offender and the built in function to repair falls short, even more so when checking EXT4.
Code:
#e2fsck -fcpDC0 /dev/block/mmcblk0p2
#reboot recovery
For the lazy fingers
#e2fsck -fcpDC0 /*/*/*0p2
#reboot recovery
1. Download www.androidonroids.com/dusted-donuts (File has 3 scripts backup, install, restore, 2 folders, 1 libdvm.so)
2. Extract zip to root of /sdcard or where ever you like (the zip has a folder containing the files named dusted-donuts)
3. Open Terminal or go to Recovery Console
FYI when running the install through Terminal your system may freeze or reboot and if it does I highly recommend that you prepare to enter Recovery Mode and check your file system. EXT2 corrupts quickly choosing this for apps2sd to use is not the best option especially if you are using custom ROMs that may lockup or reboot, basically that's a crash.
Code:
$su
#mount -o rw,remount auto /sdcard
#cd /sdcard/dusted-donuts
#sh backup
#sh install
#sync
#reboot
Check the Dalvik VM execution mode. look at the bottom line with_jit means the it is installed , and look at all of those options that can be jammed into your build.prop and local.prop files
Code:
$su
#dalvikvm -h
Phone won't boot past G1 screen? Go to recovery console and restore libdvm.so (give it at least 5 minutes first before giving up)
Code:
#mount -o rw,remount auto /sdcard
#cd /sdcard/dusted-donuts
#sh restore
#sync
#reboot
---------------------------------------------------------------------------------------------------------------------
prefer to use VMLIBS.ZIP from t3hSteve? This is how you can install using that.
Required:
1. Android 1.6 ROMS with a bit Eclair stuff in the Kernel and framework such as Cyanogen ROM 4.2.x, Super D 1.8 - 19.2, WG Y2.6, FastTest, KingKlick Eclair and more.. This libdvm.so works on Android 2.1 as well as it seems it should..
How to install: (easier to go in recovery mode but can be done through terminal)
1. Download the VMLIBS.ZIP from t3hSteve of allroid.com http://alldroid.org/download/file.php?id=1374
2. You only need the libdvm.so file of which appears to be JIT enabled by default.
3. Backup the original libdvm.so #cp /system/lib/libdvm.so /sdcard/libdvm.so
4. Copy the JIT enabled libdvm.so #cp -f /sdcard/vmlibs/libdvm.so /system/lib/libdvm.so
5. Set permissions on the file #chmod 644 /system/lib/libdvm.so
Optional for disabling: (easier to do vi through recovery console, since the back key escapes out of terminal)
To disable JIT MODE but want to keep the libdvm.so create a local.prop in /data and add dalvik.vm.execution-mode=int:fast
#vi /data/local.prop
press the i key to enter vi interactive mode
type dalvik.vm.execution-mode=int:fast
press back key to exit vi interactive mode
to write the file out and quit vi type :wq
or
restore your backed libdvm.so file from the sdcard.
-----------------------------------------------------------------------------------------------------------------------
Enjoi! the dusted donuts,
-Licknuts (me? I'm like Varuca Salt, I want another pony)
Vendor G1 roms around 1.2 Mflops, Custom G1 roms are around 2.4 MFlops/s and with JIT compiled Dalvik VM 3.6 MFlops/s. At most you will see 3.5 MFlops/s fairly consistently with a minimal load on your system and highs at 3.7 Mflops/s. Test before and after using Linpack from the Market, it's free.
The 13.236 Mflops/s is not normal and you will probably not see with your testing, I have seen 5.x & 7.x but these are far and few between and this took a while with tweaked configurations/settings with a persistent app to kill processes, it is attainable and I hope a ROM developer finds the sweet spot to exploit.
Click to expand...
Click to collapse
You fail...
Jerzeeloon said:
You fail...
Click to expand...
Click to collapse
Could you please explain how I fail? The title of this thread specifies it's for beginners, so if it's too detailed or basic for you why don't you just ignore it rather than being insulting. I took the time to elaborate on all the steps hoping this would be helpful to the many people in the original thread who are unable to execute the batch method posted there or don't know how this works or what it's doing (how simple it is). If someone wants to delete it or move it to a different subforum, go ahead, but don't be an asshole.
jeez you kids are a-holes. he's trying his best to help the community and all you have are insults -.-
@OP Good Job dude hopefully someone likes this
Jerzeeloon said:
You fail...
Click to expand...
Click to collapse
seems that you ment yourself...
@wrb123: I also think thats a great guide for beginners =)
Is there any way to get this working with 1.5 hero roms?? That could be a big improvement.
Jerzeeloon said:
You fail...
Click to expand...
Click to collapse
Hey dude don't be a nob - Good going at least you bothered to help beginners out
To make this thread easier to read, it may be worthwile posting all the console commands in quote boxes. This just improves the overall look of the guide. You might want to try making it a bit less wordy, as the length might actually daunt some beginners, but overall, it is a good guide
goofyog said:
Is there any way to get this working with 1.5 hero roms?? That could be a big improvement.
Click to expand...
Click to collapse
I have no idea if this does or does not work on 1.5 Hero roms... from the original post it seems to work on 1.6 roms with "a bit of eclair" so cyanogen, super d, other non-hero types. If you want to try it, I really don't think you'll brick your phone - it probably just either won't do anything or it'll cause a bunch of instability and crashes, in which case you can pull your battery and restore the original libdvo.so file you've backed up, using the steps above. Maybe someone much more knowledgable than me (like, basically anyone...) can answer, or you could try asking in the original thread found in the 2nd post in this thread.
I think i will do that thnx
I personally think those that cant get Dusted-Donuts JIT enabled shouldn't be running it anyways. JIT is experimental, and hasnt been mainstreamed yet.
Maybe those that find it too complicated shouldnt mess around w/ experimental enhancement till they are built into some ROMs first. Will make things easier for everyone........

GUIDES & FAQs [Android]: ADB Workshop by Adrynalyne and Guide by Captainkrtek

DO NOT POST IN THIS THREAD BEFORE READING THE WHOLE POST
PLEASE ADD GUIDES TO COMMON ISSUES YOURSELVES
To my recollection, the previous WM Guides thread was successful.. so we'll be moving on to android as well - from beginner to pro.
I hope this thread will provide answers to a decent percentage of your questions.
Please hold until guide collecting is finished..
In the meanwhile you are ALL invited to send me links or full guides to add to this thread.. remember, we are all about sharing.
COMING SOON! (in the meanwhile, you've got a great battery life guide at http://forum.xda-developers.com/showthread.php?t=471521 - be sure to thank BruceElliot for it!)
also, if you decide to post a guide, please keep the guide as neat as possible, with a title containing the LEVEL ([BEGINNER], [INTERMEDIATE], [PRO]) and the commonly searched words so that people who look for it can find it easily. (if you can, use the same color (dark orange) and same size (4) and Bold.. for the main title.. tho that's not a must )
post #2. [BEGINNERS+INTERMEDIATE] Replacing System Files using Android Commander
post #3. [EVERYONE] ADB Workshop by Adrynalyne and Guide by Captainkrtek
post #4. [QUICK FAQ's] Common QnA's for beginners by Timmymarsh (work in progress)
[BEGINNERS] Replacing system files using Android Commander
Replacing system files using Android Commander:
(This post was formally based in the HD2's RTL support thread and revolved around our need to replace frameworks)
so:
1. Download the android SDK from: http://dl.google.com/android/android...08-windows.zip
2. EXTRACT(!!!) the android-sdk-windows to c:\
(make sure you extract the dir - not run the setup from inside the zip file)
3. install Android Commander from http://androidcommander.com
4. Connect your device and make sure it's set to Debugging mode in /settings/applications/development/
5. You might have to set a dir containing your adb.exe file. set it to c:\android-sdk-windows\tools\
6. You will see a Total Commander-like interface. you can then copy the framework.jar file to the correct directory (there's no difference between SD android builds and androids in ROM - the system dir will be shown the same way)
a. Yes, you can replace/delete system files while android is running.
b. (for androids running from SD) Any file copied to /sdcard/android/root/system/X will be copied to /system/X in the system file. The sdcard/android root dir is JUST LIKE your root in ROM androids.
c. Make sure you either created a backup or verified a match in any other way before replacing files like frameworks, zimage, modules, etc.. your android might not boot afterwards (I keep all system.ext2 files backed up so that i can restore them incase i screw something up.)
enjoy
[EVERYONE] ADB Workshop by Adrynalyne and Guide by Captainkrtek
This following guide was rewritten by Captainkrtek, please make sure to thank him for it
Original Post:
(http://forum.xda-developers.com/showthread.php?t=879701)
This workshop was held in #android-learning on irc.freenode.net by XDA Member Adrynalyne. All credit to him for this guide, I simply am taking it and turning it into a guide. Here we go!
You can find the raw IRC log here
Good evening folks, and welcome to my ADB workshop. This is by no means a full explanation on the subject, but more of a crash course to help folks get up to speed, and get more from their devices. There may be some things you already know here, so please be patient and respect those who do not.
Reference Files
http://adrynalyne.us/files/How to install adb.pdf
http://adrynalyne.us/files/Using ADB.pdf
So, lets just start with the basics.
What is ADB?
ADB stands for the android debugging bridge and is used for testing and debugging purposes by developers.
However, we like to get more out of our devices, and its a great way to fix things.
Knowing adb can mean the difference between a paperweight and a working phone.
So, to start with, we will look at installing ADB.
Generally speaking, the Sun/Oracle JDK is required to run all SDK functions.
ADB is but one tool in the SDK arsenal.
So, we begin by downloading and installing the JDK. This can be found here:
https://cds.sun.com/is-bin/[email protected]_Developer
Choose your OS, download and install. I recommend that 64 bit users use the regular x86/32 bit version as well.
Moving ahead, we download the Windows sdk from here:
http://dl.google.com/android/installer_r08-windows.exe
Due to already installing JDK, you won't be stopped by the install process.
Now, if you notice, I installed it to:
C:\android-sdk-windows
I did this because it makes things easier when setting up path variables.
I encourage everyone to do the same, but obviously it is not required.
So, this SDK is handy, but is only good up to 2.2. We want the latest and greatest! (Well I do)
So, we navigate to:
C:\android-sdk-windows\
and we run SDK Manager.exe
If you notice in your PDF file for installing adb, you will notice that you can update, and I made a choice not to include earlier sdk versions.
I won't go into full detail on that, but depending on the version of SDK you have, 8 or 9, it WILL make a difference in using adb.
By default, for version 8 adb.exe resides in C:\android-sdk-windows\tools
By default, for version 9 adb.exe resides in C:\android-sdk-windows\platform-tools
We will assume version 9 in this guide
Really, the SDK is installed and adb is usable right now, but in my humble opinion, its not enough
I like the ability to use adb in ANY directory on my machine.
To do this, we edit Windows's environment variables.
Specifically, the system path.
To do this, we click on start, or the orb (depending on OS), and right click on Computer, left clicking on properties in the menu.
If its windows XP, I believe it brings you into advanced system properties immediatly. Vista and 7 need a second step.
On the left hand side, as you notice I have highlighted in the pdf, left click advanced system settings.
Under advanced tab, we left click environment variables...
There are two boxes here.
We are concerned with system variables, however.
So we scroll down the list and highlight path and click edit.
Ignoring all the extra stuff in here, make sure you are at the end of the line, and type
Code:
;C:\android-sdk-windows\platform-tools
The semicolon allows us to separate it
from the previous path statement.
Click ok all the way out.
We now have ADB setup globally. We can use cmd.exe (I use powershell) and no matter what directory we are in, adb is recognized.
If it is not, make certain you entered the path into system variables, and made no typos.
If you installed to a different location, you will need to adjust the path accordingly.
This concludes the section on installing the Android SDK to use ADB.
This next section will be on using ADB, so please open that pdf now.
Now, this applies to any OS, not just Windows.
Well, with the exception of the USB drivers.
I will not go too much into that, but if you take a look at the PDF, it goes through installing usb drivers for the sdk, and how to download them.
Fiarly straightforward, in that rspect.
Now, to setup our phones to use with the SDK and ADB, we must change some settings.
First, we go to menu softkey, then settings.
We scroll down to Applications and tap it.
Under Development, we will check Enable USB Debugging. Please note the SGS phones are different in this respect.
The USB cable must be unplugged before enabling or disabling this setting.
Once this is done, we are now ready to play with adb
One quick note: If you get device not found/conencted, please reboot your phone. DJ05 has a quirk in it where ADBD randomly crashes on boot.
A reboot will fix this
ADBD= ADB Daemon
Ok, continuing on.
Lets look at installing applications. This is also known as sideloading.
Unlike installing from the SD card, it does not require unknown sources to be enabled.
The command for this is
Code:
adb install packagename
This assumes that you are working from the directory where the file is located.
This will install the application to /data/app.
It will also show sometimes useful errors if install fails.
That is not something you will see from the Android GUI.
Now, a lot of us have probably deleted files with apps like Root Explorer. While this isn't really a bad thing, it leaves behind databases and data for the application removed.
This is where the 0kb applicaiton entries come from.
If you take that application entry name, you can uninstall the extra data via adb.
First we go to the adb shell which logs into the phone.
Code:
adb shell
If we end up with a $, we will want admin rights, in many cases. This is not one of them, I don't beleive.
To get admin rights, you want to type
Code:
su
Look at your phone if this is the first time, it may prompt you to allow access. Else you will get permission denied.
If you are not rooted, this will not work either.
Ok, now that we are logged in, we will type
Code:
pm uninstall packagename
where packagename is the name of the 0kb listing.
Now this seems like a pain in the a** and I agree.
HOWEVER
There will be a time where Manage applications crashes when you try to uninstall it from the phone. In this case, a factory reset, or this method is the only effective way to fix the problem.
Moving on.
How many of us have removed system applications or renamed them? Did you know that you can simply disable them from the system?
Code:
adb shell
su
pm disable appllicationname
This will disable it, and the system will ignore it.
This can be seen as safer than deleting or renaming things, but your mileage may vary.
On the other hand, you can also re-enable these applications.
Code:
adb shell
su
pm enable applicationname
Please note: Not all applications will properly re-enable. I believe a factory reset or reinstall of said application will fix the issue.
Also, application names are absolutely case sensitive.
*nix based Operating Systems see the letter 'a' and 'A' as two different things.
when you log into adb shell, you are playing by android rules
Ok, a lot of us tweak and mod our phones and turning off the device to get to clockwork recovery, or battery pulls, or multiple button holds to get into Download mode are troublesome and annoying at best.
ADB can help us here.
Here, we do not need to be logged into the shell
If we want to merely reboot the phone:
Code:
adb reboot
If we want to go to recovery (works well with voodoo5)
Code:
adb reboot recovery
If we want to go to Download Mode because we need Odin, heaven forbid:
Code:
adb reboot download
Its instant. No waiting on animations or anything else.
Its also handy if Android has locked up, but yet still works in adb.
I for one hate taking my case off to battery pull.
So now we move on to pushing and pulling files.
Sometimes, I don't feel like mounting my sd card to copy a file over to my phone.
I can use this command to push a file straight to my sd card:
Code:
adb push filename /pathtodirectoryonphone
So for instance, if I have test.txt that I want to send, I would type:
Code:
adb push test.txt /sdcard/
and there it goes.
Ok moving on
Pushing files can be done to any directory, however, some are protected.
For instance, /system is going to give you a permission denied or a read only filesystem error.
To get around this, the easiest thing to do is push the file to your sdcard, then log into the shell:
Code:
adb shell
Code:
su
We will then mount the system as writable
Code:
mount -o rw,remount /dev/block/stl9 /system
Then we can use something like
Code:
cp /sdcard/test.txt /system/app/test.txt
cp stands for copy
and it requires the path of the file and destination path. The name of the file is optional
When you copy it, you can rename it to whatever you like.
For instance, if we wanted to backup a file
Code:
cp /sdcard/test.txt /sdcard/backuptest.txt
Now, lets assume you do not have busybox installed.
You non rooted users will not.
Then you must use a slightly more complicated command called dd
This is used like this:
Code:
dd if=/sdcard/test.txt of=/system/app/test.txt
if is for inputfile
of= output file
Not every user friendly, but probably one of the safer copy commands.
Ok, moving on to pulling files.
Lets say you want to get a file from your phone, to modify, backup, etc.
To do this, we simply use adb in this manner:
Code:
adb pull /pathtofile/filename destinationname
For instance, if I wanted to backup ADW launcher in system/app
I would do this
Code:
adb pull /system/app/ADWLaucnher.apk ADWLauncher.apk
And it will pull the file from the phone and put it in the current directory.
Like above, you can specifcy where it goes.
pushing files to the sdcard, it seems prudent to talk about changing permissions.
sdcards are typically fat32, which destroys permisisons, and Android is heavily permission based.
So if you push an application to your sd card, then try to copy it to /system/app/ bad things are going to happen, or the app may not even show up.
So in that case, we use something called chmod.
This is used in this manner
Code:
adb shell
su
chmod 755 /pathtoapplication/applicationname
Keep in mind
you dont want to do this while its still on your sd card.
an example
Code:
adb shell
su
chmod 755 /system/app/ADWLauncher.apk
755 is good for applications and script files.
Just a couple more topics to cover.
Lets go over deleting files.
This becomes especially handy for removing rogue applications.
To do this, we must be in the adb shell.
Code:
adb shell
su
rm /system/app/ADWLauncher.apk
You may need to remount system as writable with:
Code:
mount -o rw,remount /dev/block/stl9 /system
That applies when using chmod as well.
So what I did above was delete ADW Launcher from system/app
However, what if I wanted to delete the entire contents of a directory?
Same thing as before, except
Code:
adb shell
rm -f /data/dalvik-cache/*.*
I just cleared my dalvik-cache with that command
very quick, very effective.
If you just tried that, please reboot your phone now
Ok....this leaves us with the final topic: logcat
logcat allows us to log what the OS is doing, and possibly delve information for when things are not working
its quite simple Reading it is another.
To use logcat
Code:
adb shell
logcat
To logcat to a certain file do
Code:
adb shell
logcat > /sdcard/logcat.txt
Now we let the log settle down to a reasonable amount of data coming in and not a wall of scrolling, then start the app in question. When it gives an error, we hit ctrl-C and kill the adb shell session.
This should have captured enough data to see the error. Now, I prepared an example. A user came to me on IRC, and Google Maps was force closing. Clearing data didnt fix it, Clearing dalvik-cache, and fix permissions did not fix it. In this case, the user did not know how to use adb So I had him grab an app called alogcat from the market and email me the log. This is also a very valid method.
this file explains what the problem was, and highlights what to look for as an example.
http://adrynalyne.us/files/logcat.pdf
___________________________________________________________________
This concludes the guide from Adrynalyne, there will be more workshops such as this one in irc.freenode.net #android-learning.
Thanks to everyone in #samsung-fascinate !
QUICK FAQ's
sources: Q&A Section, The Weekly Q&A Section by XDA News Writers (thanks guys)
Q: ‘Is there any way to block specific apps from using my data connection?’
A: Try the Droid Wall application.
Q: ‘I read how you can make changes in the build.prop file on my Android device. How exactly do I get to it?’
A: Install ASTRO file manager, browse to /system, long press on build.prop – Edit – Copy. Press on the home icon then Edit icon – Paste. Connect sd card, edit it, and paste it over from where you copied build.prop
Q: What happens if I update my phone? will I need to re-root it and get the ROM again? will all of my applications get erased? If so, is there a way around this?
A: You will lose your root, but not apps if it is just an update.
Q: I just tried to flash a ROM from recovery on my Android phone and got “Verification Failed, Installation Aborted” What happened?
A: Before you can flash a custom ROM the .zip file must be digitally signed in the ROM kitchen, if unzipped and re-zipped it will lose its verification, this happens often using the Safari browser as it likes to decompress .zip’s. Or if your download is corrupted (download the ROM again) it will fail the Verification.
Q - HTC Location Widget shows "map data unavailable"
A - On the widget, click the pin/then click the windows button/click get more/scroll to download maps/download relevant map (care, maybe a big file). Now exit and click onto map, your location should now be visible :)
Q:So, I moved all the apps on the SD, but is still not enough. How can I free some memory? I could delete the cache of the older upgrade or something else?
A:Do you have pictures and videos? If so, check if they are on the SD card and not on your internal memory. Cleaning your cache helps, and try deleting your text messages threads.
Q: ‘What exactly is a kernel and what are the benefits in changing it?’
A: A kernel is a bridge between the applications and the actual data processing done at the hardware level. The kernel’s responsibilities include managing the system’s resources – the communication between hardware and software components. Flashing different kernels gives you different operating speeds, better battery life, the ability to overclock, and more.
Android control other device with IOIO Board.
It use ADB.
http://androidcontrol.blogspot.com/2011/10/ioio-board-for-android-control-io.html
timmymarsh said:
QUICK FAQ's
sources: Q&A Section, The Weekly Q&A Section by XDA News Writers (thanks guys)
Q: ‘Is there any way to block specific apps from using my data connection?’
A: Try the Droid Wall application.
Q: ‘I read how you can make changes in the build.prop file on my Android device. How exactly do I get to it?’
A: Install ASTRO file manager, browse to /system, long press on build.prop – Edit – Copy. Press on the home icon then Edit icon – Paste. Connect sd card, edit it, and paste it over from where you copied build.prop
Q: What happens if I update my phone? will I need to re-root it and get the ROM again? will all of my applications get erased? If so, is there a way around this?
A: You will lose your root, but not apps if it is just an update.
Q: I just tried to flash a ROM from recovery on my Android phone and got “Verification Failed, Installation Aborted” What happened?
A: Before you can flash a custom ROM the .zip file must be digitally signed in the ROM kitchen, if unzipped and re-zipped it will lose its verification, this happens often using the Safari browser as it likes to decompress .zip’s. Or if your download is corrupted (download the ROM again) it will fail the Verification.
Q - HTC Location Widget shows "map data unavailable"
A - On the widget, click the pin/then click the windows button/click get more/scroll to download maps/download relevant map (care, maybe a big file). Now exit and click onto map, your location should now be visible :)
Q:So, I moved all the apps on the SD, but is still not enough. How can I free some memory? I could delete the cache of the older upgrade or something else?
A:Do you have pictures and videos? If so, check if they are on the SD card and not on your internal memory. Cleaning your cache helps, and try deleting your text messages threads.
Q: ‘What exactly is a kernel and what are the benefits in changing it?’
A: A kernel is a bridge between the applications and the actual data processing done at the hardware level. The kernel’s responsibilities include managing the system’s resources – the communication between hardware and software components. Flashing different kernels gives you different operating speeds, better battery life, the ability to overclock, and more.
Click to expand...
Click to collapse
Thank you for your patience and taking the time to answer those questions. I loved your simple and easily digestible format.
There is a note
*nix based Operating Systems see the letter 'a' and 'A' as two different things.
when you log into adb shell, you are playing by android rules
Click to expand...
Click to collapse
this note is all wrong..
1. linNUX is not *NIX.
2. Mac OS-X is a *NIX OS, it is based upon UNIX, they use their own variant called Darwin. Darwin does not require capitolization.
3. The word should be POSIX. Linux is POSIX compliant and POSIX defines the capitolization standardards
soft brick
Taioba said:
Is there any way to use ADB even though I can not enable USB debugging by the android?
I have an Atrix with soft-brick. How can I restore a file (framework-res.apk) knowing that my USB debugging is off?
I can enable ADB via fastboot?
Thanks!
Click to expand...
Click to collapse
I found this for atrix 4g....
http://forum.xda-developers.com/showthread.php?t=965546
hope it helps
knoknot said:
i have a bricked s2 not so sure how to go about reviving it via adb
Click to expand...
Click to collapse
check this thread
http://forum.xda-developers.com/showthread.php?t=1237815
thanks. searched for that
Thanks for it.
Great Guys............ :good:
Thanks for sharing.
Thanks for sharing this guild :d, i am new member for reccod
Great job~ Sometimes could be used this.
I'm using Windows 10 RTM and I've set the path, yet I still get the "unrecognized application" error in the command console. What am I missing?
Nevermind, a restart fixed it. Used to be you didn't have to.... sheesh.
nir36 said:
Replacing system files using Android Commander:
(This post was formally based in the HD2's RTL support thread and revolved around our need to replace frameworks)
so:
1. Download the android SDK from: http://dl.google.com/android/android...08-windows.zip
2. EXTRACT(!!!) the android-sdk-windows to c:\
(make sure you extract the dir - not run the setup from inside the zip file)
3. install Android Commander from http://androidcommander.com
4. Connect your device and make sure it's set to Debugging mode in /settings/applications/development/
5. You might have to set a dir containing your adb.exe file. set it to c:\android-sdk-windows\tools\
6. You will see a Total Commander-like interface. you can then copy the framework.jar file to the correct directory (there's no difference between SD android builds and androids in ROM - the system dir will be shown the same way)
a. Yes, you can replace/delete system files while android is running.
b. (for androids running from SD) Any file copied to /sdcard/android/root/system/X will be copied to /system/X in the system file. The sdcard/android root dir is JUST LIKE your root in ROM androids.
c. Make sure you either created a backup or verified a match in any other way before replacing files like frameworks, zimage, modules, etc.. your android might not boot afterwards (I keep all system.ext2 files backed up so that i can restore them incase i screw something up.)
enjoy
Click to expand...
Click to collapse
Thanks, this Guide is very informative
Help with LG D722
I'm using LG D722 phone and I somehow unlocked bootloader and installed twrp recovery. I backed up Lollipop that's what I'm using and i want to restore custom ROM
I know I need to install Google Apps after installing Custom ROM. But Do I also need to install Modem files on my device ? Because I can't find them on XDA Forums. Please give me a link or something. The help is not just appreciated but seriously needed.
Success. Thanks
Hello, I walk testing one recovery but I'm booting before flashing, the question is, will the recovery feel same when booted vs flashed? I've booted and used to flash a pair of zips but felt very laggy and bugged although did the work right. Thanks
Edit: solved, tried myself
Sent from my SHIELD Tablet K1 using XDA-Developers mobile app
http://forum.xda-developers.com/showthread.php?t=872128&page=2

[SCRIPT]AndroidManager v0.1

AndroidManager v0.1​
by ScumpinatoS​
Screen​There are no screen, the script operates on a command line
What is it?​This script allows you to do anything on your android device even if you don't know anything about adb and/or about scripting
With this script you can:
1. Reboot
2. Go To Recovery Mode
3. Install an APP in /data/app
4. Install an APP in /system/app
5. Pull your framework folder
6. Stop your device (ROOT)
7. Start your device (ROOT)
8. Mount partitions Read-Write (ROOT)
9. Mount partitions Read-Only (ROOT)
10. Backup your /data/app folder (ROOT)
11. Restore your /data/app folder (ROOT and REBOOT)
12. Backup your SMS (ROOT)
13. Restore your SMS (ROOT and REBOOT)
14. Send a file to your SDCARD
15. Pull the build.prop
16. Push the build.prop
17. ADB Shell
18. Exit
Requirements​
- Windows 98 or above
- An Android Device
- Admin rights (Vista/7)
- ROOT where needed
- USB DEBUG ON
How to use?​
1. Download the Link at the end of the post
2. Double click on AndroidManager
3. Now the script is running
4. Choose the option that you want, then choose what do you want to do and the script will do everything
In the guided mode the script guides you trough the script telling you something about the command and how to use them It's good if you want to know how the script work or if you want to learn something about adb scripting
Now the download link:
AndroidManager v0.1
Changelog:
v0.1: Initial release
Enjoy and leave a feedback
Who wants the source code, ask to me in PM
IF YOU LIKE MY WORK, PLEASE THANK ME AND CONSIDER DONATE TO ME, EVEN 1$ IS GOOD, I'M JUST A STUDENT
Very usefull(you are a genius)
Thank you really much =)
I'm not a genius, I'm just a guy who loves making his life easier XD XD
I found a little bug (not very important to fix).
I have tried to shutdown(6) and works but 1 min ago when i tried it the screen just freeze, i have tried to shutdown again and nothing but when i tried poweron(7) the phone powered one whitout problem(theat freeze was funny whit the phone poweredoff but whit screen on ).
That isn't a bug. They are the adb shell stop and the adb shell start command. You need them when you want to modify the /system partition without having problems
Is this scrit useful to You?
What do you think of this script?
there're no option to install font?
Btw thank.
ScumpinatoS said:
Is this scrit useful to You?
What do you think of this script?
Click to expand...
Click to collapse
Very good for persones like me (i have a short cable and was hard to use the phone when was at pc) thease is what every android owner must have.
afifth said:
there're no option to install font?
Btw thank.
Click to expand...
Click to collapse
Based on the number of download and the number of donations [0 so far] I will decide if update this script or leave it as it is.
I have so more ideas in my mind, but I'm waiting to see the appeal of the script
IF there will be a 0.2 version, that option will be available
*bump*
Do you use/like this script? What do you think of it?
I started to use your script it's very usefull, thanks
You're welcome
If the script can reach 500 download by the end of the week will be upgraded to the v0.2
*up*
So? Any feedback?
I will stop developing this script because I found that http://forum.xda-developers.com/showthread.php?t=825934&highlight=androidmanager
I think that it isn't fair from me to steal the name, and btw that script is much much better than mine

[GUIDE/DEV] Microsoft Android "Emulator"

I can't find much of any information on hacking the microsoft android emulator. Ideally, I'd like to get it working with superuser, exposed, etc, so it can be a fully functional way to see how android itself and apps work in different environments, all from my desktop. Also, I can just play around with stuff that I wouldn't touch on my tablet for fear of bricking it. I like playing with things.
Disclaimer: I'm not interested in maintaining anything, but as mentioned above, I can't find any information. Therefore, I'm simply posting what information I have here, in the hopes it will interest someone else enough to take a harder look at it. My original post was over here, but I've expanded beyond simply adding supersu to the image.
Things I can't do:
- Install superuser
- Install Xposed
- Install Google Play for anything more recent than KitKat
- Install recovery scripts
Things I can do:
- Run commands as root.
- Install Google Play Services on KitKat
- Change the screen resolution
- Change the amount of internal disk space
- Change the amount of memory and cpu cores available.
- Install busybox
- Flash simple scripts that don't require recent versions of cwm/twrp/other modern recovery.
----------------------------------------
Background information: The Microsoft Android "Emulator" is actually a HyperV virtual machine. When you install it, it enables the HyperV virtualization service in windows*. The effect of this is that instead of running android by emulating an arm processor, it runs android natively, with far better performance, by using Microsoft's hypervisor that's built into windows (win8+). You can work with it with Visual Studio and with Android Studio, but I don't use either much, so I can't help you with that. You can download it from Visual Studio if you want to (VS 2015 is free), or you can download a standalone version. I don't know if there's a difference between the two.
* I'm not sure if it installs the HyperV GUI as well, as I already use HyperV for other things and had it already installed. If you need to do so, you can install the GUI by going to add-remove windows features in the control panel ('appwiz.cpl' from the control panel).
----------------------------------------
Modifying the properties of the emulated system.
Configuration file location: After you create a device, the .cfg file for it will be located in %localappdata%\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices
To change the resolution: So far, I haven't identified any supported resolutions other than those listed in the device profiles list. So far, supported resolutions that I've used successfully are 480x800, 720x1080. You can edit the .cfg file for the specific device that you want to change the resolution of, and change the `device.screen.resolution=` line to any supported (see previous) resolution.
To change the size of the internal storage, follow the instructions here. You'll need an ubuntu cd; minimal install cd is fine if you have slow internet/computer or low ram.
To change the amount of ram or processors allocated to the virtual machine: Open Hyper-V manager, right-click the appropriate VM and click settings.
- Change the ram allocation by clicking Memory in the list at left. I do not know what happens if you try using Dynamic Memory; if it works, it should be more memory-efficient, but I left that alone. Now update the `device.vm.ram.size=` line in the .cfg file.
- Change the cpu allocation by clicking the Processor field. Please note that if you have hyper-threading, you should only use half your logical processors as cpus; the hyperthreaded 'cores' won't work as well (according to information online; you can check number of logical processors in windows task manager's performance tab). Now update the 'device.vm.cpu.count=' line in the .cfg file
----------------------------------------
Info on "recovery" and "flashing" - Installing google play
So far, I have only managed to get Google Play Services working on KitKat. I can't get it to work on Lollipop or Marshmallow (and haven't tried earlier versions at all); the virtual machine does *not* have a recovery or fastboot because of the way it works, and I haven't figured out any way of installing such. Instead, there's a simple shell file called install_zip.sh. It does not work with modern flashable zips that require TWRP/CWM; it only works with the old style zip designed for a specific architecture. As such, opengapps flashable zips will not work.
To install Google Play Services on KitKat (4.4.4)
1. Inside the emulator, open the browser and go to http://www.teamandroid.com/gapps/ and download the file linked under Gapps CyanogenMod 11.
2. Open the window the the android VM from the Hyper-V Manager to get console access. If you have ADB installed locally, you can use that in the future, but getting the VM's shared IP requires terminal access anyways (run `ip addr` as root inside the emulator to get the list of IPs).
3. Run `adb shell` to get access to the root shell (yes, it's that easy).
4. Run `install_zip.sh /sdcard/Downloads/gapps-kk-20140105-signed.zip` (or whatever the name/path for the downloaded gapps file is).
5. It should complete successfully. Now type exit to exit the adb shell, and close the hyper-v console window (the android emulator will continue running).
6. Click the 'X' at the top right of the Emulator to shut down/close the VM
7. Start the emulator back up. You should now have access to Google Play Services.
----------------------------------------
Busybox
The emulator does not come with a preinstalled copy of busybox. It does come with the android toolbox, but this has only a very minimal amount of commands in it. The instructions below are for installing stericson's busybox.
1. Get a copy of stericson's busybox from somewhere--your personal device, etc, it doesn't matter. The easiest way is to either install it on a real android device and grab it with airdroid (or other), or to use a play store scanner to get it. The file name will probably be something like stericson.busybox.apk.
2. Rename it to .zip so you can access the contents.
3. Extract the busybox-x86.png file from the 'assets' folder inside the zip, and rename it to `busybox`.
4. In the Android Emulator, click the >> button for tools, and click the sdcard header. Choose a folder (a new one on your dekstop will do) and tell it to pull the contents of the sdcard to the folder.
5. Move the busybox file into the Download folder that you just pulled from the sdcard. If you created a folder for this, you can delete it now.
6. Back in the android emulator, push the folder structure back into the sdcard; this will move the busybox onto the emulator.
7. Open the HyperV console for the emulator or open a terminal app in the android emulator (installing it is up to you)
8. Run `adb shell` to get a root prompt.
9. Run `mount -o rw,remount /system` to remount the system partition as writable
10. Run `cp /sdcard/Download/busybox /system/xbin` to copy the busybox binary over
11. Run `chmod 777 /system/xbin/busybox` to make the busybox binary executable.
12. Run `busybox --install /system/xbin` to copy the busybox binary for all the included applets. I think the -s paramter will symlink the applets to the main binary instead, but I'm not sure.
13. Type exit in the adb shell.
14. You can now run busybox commands in the terminal, and use apps that require busybox to be installed.
Now that you have busybox installed, you can use unzip, etc.
----------------------------------------
Hacking the OS itself.
The android emulator uses a VHD file for the disks. I've mounted the vhd file inside an ubuntu server to play with, and discovered several things about the way it works. The first partition is the boot partition, it contains 3 files:
- kernel - the android/linux kernel
- ramdisk - the ramdisk for the root filesystem. gzipped cpio archive.
- cmdline - the kernel parameters(? not sure what to call this)
I've tried modifying the ramdisk to add the init files for the superuser, but this doesn't seem to work properly; when I boot up the vhd file, I can open the console with hyper-v manager (the android emulator machines show up there automatically), and when it gets to the ramdisk, it says so--then the caps/num/scroll lights start flashing and it hangs. I haven't gotten any further than that at this time.

A Beginner’s Guide to Modifying Android Devices

Warning: Even an expert runs the risk of “bricking,” or locking up their Android device when modifying it. Often this is a ‘soft brick’ from which they can recover, but sometimes the device is “hard bricked” from which no recovery is possible, and the device becomes a source of spare parts. Proceed at your own risk. Neither the author, nor XDA is liable if you do “brick” your device.
Note: I have insufficient posts to include outside links. I'll add them when I do. Until then you'll need to search the 'net.
Keeping that in mind, you may wish to acquire an older model device to practice with before attempting to modify leading edge devices. Kijiji and Craig’s List are good sources for low cost, used devices that can be used for practice. I acquired the Samsung Galaxy S5 neo (SM-G903W) with Android 7.0.0 (Nougat) installed, I’m using in this guide for about $20 USD. Although any device will do, try to get one from the same manufacturer as the device you want to modify. If your device is a phone, you do not need a SIM card to follow this guide.
The Android OS is a derivative of Linux, and many, but not all commands are the same. You should refer to Linux or Unix manuals for an explanation of the commands. Search the ‘net for “Linux Commands” to find the latest manuals.
As the boot animation and sound are the most common modifications, changes to those are the goals of this guide. It seems as though there is an app for everything now. Yes, they are handy, but this guide will use the command line for many of the modifications. I use Terminal Emulator on the device for command line access. I also use BusyBox to expand the command set available. Both are available from the Play Store. You need root access to install and use BusyBox.
The first step is to read the manual for your device. Pay particular attention to the method used to enter the download and recovery modes. The Samsung Galaxy S5 neo uses volume up + home + power to enter the recovery mode, and volume down + home + power To enter the download mode from the power off condition. Press the volume and home buttons first, and then press the power button while holding them down. The device will boot into the desired mode. You may also require special USB drivers on your PC for your device.
Next you need to take as complete a backup of your device as possible using the stock options. See your manual for help with this. It’s also a very good idea to download the full firmware, as well as the boot and recovery partitions and any tools needed to re-flash this software. The best way to find these is to consult the manufacturer’s website, then this forum, followed by a ‘net search if nothing else provides results. For my device I need Odin on my PC. I found the full firmware at sammobile.com and firmware.mobi. The boot and recovery images can be extracted from the Samsung file, and then re-compressed using 7-zip on your PC. The firmware.mobi website offers all three files for several versions of Android, as well as a configured Odin package to root my device.
Now that we’re ready, the next few posts in this thread will cover the following sequence:
1. Root Device
2. Install Recovery
3. Install Applications
4. NANDroid backup
5. Make your modifications​
Root Device with Chainfire
Warning: If you have a KNOX enabled device, rooting it will trip the KNOX warranty flag, voiding your warranty. This flag cannot be reset, and will prevent some applications from working.
Warning: Rooting improperly can “Hard Brick” your device, turning it into a source of spare parts.
There are numerous rooting tools out there. I use Chainfire whenever possible. The current website firmware.mobi will generate an easy to use package including Odin for supported devices. Download and extract the package to a new folder on your PC. Start Odin using the root.bat file. Read the warnings. Next:
Ensure Developer Options are enabled on your device. On the SM-G903W, go to Settings/About Phone/Software information/Build number seven times. Other devices may use a different method. Consult your manual.
In Settings / Developer Options ensure OEM Unlock is on and turn on USB Debugging
Note: I also turn “Auto update system” off
Turn the device off, then re-boot into the download mode (Volume Down + Home + Power, and then press Volume Up on my device)
Plug the device into a USB port of your PC
Select AP in Odin, then select the image.tar.md5 file downloaded with your package.
Ensure one of the COM ports is highlighted.
This is your last chance to abort. DO NOT CONTINE if you have any doubts.
Click Start
When your device is rooted successfully you’ll see a green pass in Odin. Congratulations! Your device will re-boot into recovery mode to root the device, and then re-boot normally. Well, that’s how it was supposed to work. When I used the CF Autoroot file for the SM-G903W, I got the error message “Recovery is NOT seandroid enforcing”, and was unable to boot into the recovery mode. I used Odin to re-flash the recovery partition which allowed me to enter the recovery mode again. A little searching on this forum, led me to this post by Neoony. I used the link for the SM-G903F and succeeded in rooting the device.
Now you need a root manager. My preference is Super SU. Install it from Google Play. Run Super SU. It will let you know if you were not successful by reporting that your device is not rooted.
Install Backup/Recovery (TWRP)
As we intend to modify the Android system itself, we need the ability to back it up and restore it. There are several options including Clockwork Mod (CWM), Team Win Recovery Project (TWRP) and Titanium Backup. My personal preference is TWRP.
Installation is as follows:
Install the “Official TWRP App” from Google Play
Run the App, agree to the Terms and Conditions, and enable “Run with root permissions,” then tap OK.
Tap “TWRP FLASH” on the next screen
Select your device from the drop down menu, you will need a network connection for this. You’ll be presented with a series of choices. Choose the latest and greatest. The image will be downloaded to your device.
Select “FLASH TO RECOVERY”, and confirm the image is correct. You will see the message “Flash Completed Successfully!” when installation is complete.
Exit the “Official TWRP App” and re-boot your device into the Download, followed by Recovery, and finally normally to confirm all is well.
Install Applications
The applications to install are those you will use to customize your device. I suggest BusyBox, and Terminal Emulator from the Play Store. BusyBox requires root access for the expanded command set. Terminal Emulator will allow command line access on your device so you won’t need ADB on your computer. You will be able to gain root access through it to modify anything on your device anytime, anywhere.
Other Apps you may find useful are the Jota Text Editor, and Hex Editor. These are also available through the Play Store.
NANDroid backup
Once the device is rooted, and your choice of applications are installed it’s a good idea to fully back up the device. This includes ALL partitions, so you have a baseline that you can re-flash. If your device has minimal memory, you may need an SD card or USB OTG drive to hold your backup. These backups will often be larger than 4GB.
Re-boot your device into the Recovery Mode. In TWRP, select ALL the partitions. Select the desired Storage location, and tap OK. Swipe to backup your device. Note the warning that “Backups of data do not include any files in internal storage such as pictures or downloads.” That is not the purpose of TWRP, and is best accomplished with the native backup utility. This backup will require several minutes.
Make your modifications
With root access, a recovery program and needed applications installed; and a complete backup we are finally ready to modify the Android installation of your device. We’ll start with the boot animation.
Modifying the boot animation:
Most devices use a ZIP file for boot animations. Samsung uses a proprietary QMG file. I tried to convert a boot animation that I put together a few years ago into the QMG format using Samsung’s Theme Designer Version 2.0.4 (Build 3918), as the links I found to newer versions on the XDA forum were broken. Searching through this forum, I found this post by Jertlok. I used the Marshmallow version with Nougat successfully.
Enough of this talking, let the games begin! Find the boot animation you want to use and download it to your device.
I’m using the Terminal Emulator for this installation. Our first step is to find the source and destination folders for this file. The relevant folders for the SM-G903W are:
boot animation: /system/media
downloads: /data/media/0/Download
If you have another device and the boot animation is located elsewhere, do a search of this forum first to find them. Look for your device first, and the other models by the same manufacturer.
Type the following commands using the Terminal Emulator:
Code:
su get super user privileges
mount -o rw,remount /system remount /system with read & write permissions
cd /system/media go to directory with boot media files, may differ
ls verify this is the correct folder
mv /data/media/0/Download/bootanimation.zip . move the file to our current location
ls verify the file was moved
exit leave super user mode
Reboot your device and verify the boot animation works.
Note: Don’t forget the period at the end of the mv command. This is a shortcut meaning the current directory, saving you from typing the full location.
Modifying the boot sound:
Finding the location for the boot sound can be more involved that finding that for the boot animation. If you know the name of the file, you can do a search through Terminal Emulator with the following commands:
Code:
su get super user privileges
cd /system/media choose a starting point for your search
find –name PowerOn.ogg name of the boot sound on the SM-G903W
This shows the file to be located in /system/media/audio/ui. Put the sound you want in the Download folder. I’ve named mine bootsound.ogg to show another use of the mv command. Use the following commands in Terminal Emulator:
Code:
su get super user privileges
mount -o rw,remount /system remount system with read /write permissions
cd /system/media/audio/ui go to the folder containing PowerOn.ogg
ls confirm we’re in the right folder
mv PowerOn.ogg PowerOn.ogg.bak rename PowerOn.ogg
mv /data/media/0/Download/bootsound.ogg . move bootsound.ogg
mv bootsound.ogg PowerOn.ogg rename bootsound.ogg
ls confirm the change has been made
exit leave super user mode
Reboot your device and verify the boot sound works. The shutdown sound is not used in the stock ROM. You can add a shutdown sound in the same manner by placing PowerOff.ogg in /system/media/audio/ui. Note: If PowerOn.ogg or PowerOff.ogg do not play, check your file permissions. Set them to the same values as the remainder of the files in the directory, usually 644.
Wrap up
Everyone needs to start somewhere. My goal in starting this thread was to provide that starting point, and a path forward for those new to modifying an Android device. That is why I started with a stock not-too-old device, and showed how to take it to manually changing the boot animation and sound. Why manually, when there are apps for that? An App can only accomplish a single task, such as changing the boot animation. At the command line you can do almost anything. You won’t be stopped by the lack of an App.
Much of the material covered by this guide is specific for a device. Those with Samsung devices came out far ahead, and those with a Galaxy S5 neo may just have hit the jackpot. The general sequence for all devices is the same. You’ll just need to dig for those devilish details.
There are two things that should stick out:
1. Use a not too old device by the same manufacturer as your target when starting. It’s far cheaper than bricking a bleeding edge device.
2. Backup, backup, backup! This can’t be stressed enough. Losing hours or days of work is very depressing, and often leads to dropping a project.
Good luck modding your device. This forum is one of the best, if not THE best place for resolving those devilish details that you will encounter.
The Next Step: Changing the Boot Logo
First, thanks to Near_07 for his post Galaxy S9 and S9+ Boot logo. I modified his package to make one for the Samsung Galaxy S5 neo. Note that his script is for the same exynos platform. This is critical for packages containing binaries.
I unpacked the pile to a new directory on my PC.
The first thing I did was to verify paths and filenames in the script "update-binary". I opened the file using WordPad on my PC for ease of reading. The file contains references to "/dev/block/platform/11120000.ufs/by-name/UP_PARAM", which does not exist on the S5 neo. I used Terminal Emulator to check for something close and found "/dev/block/platform/13540000.dwmmc0/by-name/PARAM ". I copied the file to the Download directory, and from there to my PC. Opening the archive, I found that it contained the file "logo.jpg". Bingo! I was in the right place. I copied the "update-binary" back to the Download directory on the S5 neo, and used Jota Text Editor to change ALL the references from 11120000.ufs to 13540000.dwmmc0; and UP_PARAM to PARAM. I then copied the modified "update-binary" back to replace the original on my PC. Why did I use Jota Text Editor on the S5 neo, instead of notepad on my PC? Unix, Linux, and Android use different end of line sequences than the PC. There are programs for the PC capable of generating Android compatible files, but I'm sticking with software already mentioned in this tutorial.
Choosing or Creating a New Boot Logo:
Choose or create a new .jpg image, the same size as your screen for your new boot logo. I've attached the original logo.jpg from my S5 neo to this post. I used that as a starting point, moving and adding elements to mate with my boot animation. I've included a demo copy in the zipped package. I've also attached a copy of the first image in my boot animation sequence. The powered by Android Nougat element fades in as the animation runs.
How to Change the Boot Logo:
You are rooted and have TWRP installed if you've been following along. These are pre-requisites. STOP NOW if they are not installed.
Download the file S5neo_Boot_Logo_Changer
Unzip the file to an empty directory
Replace logo.jpg with your desired logo. Note the name MUST be exactly the same.
Use 7-Zip to compress the contents of your working folder, with 'Store' as the compression method
Copy the resulting archive to the Download folder on your S5 neo
Re-boot your S5 neo into the Recovery mode
Install the package, re-boot, and enjoy!
Removing Bloatware (or fun with scripts)
Bloatware consists of the unwanted apps generously added to your phone by Google, the manufacturer, and your carrier. There can literally be a hundred or more of these apps on your phone. So how do you get rid of them? You can use a package found on this site, but that can be problematical. You may have a different view of bloatware than the package’s author. You may not know what each APK deleted by the package does, and delete one you actually want on your phone. If this happens you’ll need to restore from backup, factory reset the phone, or even re-flash the firmware. My preference is to archive the APK on my desktop so that hopefully I can restore the APks with the package manager.
To start, grab one of the packages to delete bloatware for your version of Android, for as close to your phone as possible. I used this one by Windforce. The contents of updater-script may include a section that looks like this:
Code:
run_program("/sbin/rm", "-rf", "system/app/AASAservice");
run_program("/sbin/rm", "-rf", "system/app/BluetoothMidiService");
run_program("/sbin/rm", "-rf", "system/app/CloudGateway2017");
run_program("/sbin/rm", "-rf", "system/app/GooglePrintRecommendationService");
There are many tools such as word processors, and text editors that you can use to strip out the unwanted bits so that you end up with something like this:
Code:
AASAservice
BluetoothMidiService
CloudGateway2017
GooglePrintRecommendationService
Save it as a file, ensuring that you have an Android (Unix) end of line character. We end up with a list of folders containing the unwanted APKs. Next we need a script to archive the APKs.
The following script has been designed to run in the ‘Download’ folder, from the Terminal Emulator, or ADB (Android Debugging Bridge). It was written on my desktop using Notepad++, to ensure the proper end-of-line character was used. The script, and APK lists must be copied to the Download folder from the desktop. To access the Download folder from the Terminal Emulator or ADB, Super User or root permissions are required. File permissions allowing root to execute the script must be set. Finally the script must be run from within a shell.
Code:
mount -o rw,remount /system # mount /system for read/write
tempdir=/system/app/app # temporary folder for APKs to be archived
mkdir $tempdir
while read apkname # loop parses file for APK names to archive
do
mv /system/app/$apkname $tempdir/$apkname
done < sysapp.txt # supplied list of APKs to be archived
tar -czvf sysapp.tar.gz $tempdir # archive APKs
rm -rf $tempdir # remove temporary folder recursively
rm -rf /cache/* # clear cache contents
rm -rf /data/dalvik-cache/* # clear dalvik-cache contents
reboot
exit 0
After the script has executed, you’ll note the icons for the archived APKs remain on the apps screen, and are still listed under Apps. The must be manually removed. You’ll find that ‘Uninstall’ is now available in both places for the archived apps.
Attached is a .zip file containing the script, and data files I used on a Samsung Galaxy S5 neo (SM-G903W).

Categories

Resources