[BETA][TOOL] adb_bak2computer [MAC & LINUX][UPDATED: 11/15/2012] - Verizon Samsung Galaxy S III

BETA TESTERS NEEDED!!
DESCRIPTION: adb_bak2computer.sh
- tool (set of scripts) to backup d2vzw (SCH-I535) partitions directly to a users computer.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
PROGRESS:
- Beta5 - Now in two flavors, Mac and Linux!!
- Fully functioning tarballs are attached to the OP (as always)
TO-DO/KNOWN BUGS
- Re-wrote the code so it actually works on Linux now. (See the _Linux tar)
- All known bugs fixed. Unless someone points one out.
- To Do: Add functionality to wrap backups into a flashable zip (it'll be a big zip, but its one file to keep track of instead of blobs or sets of img files) This should be the first restore option I explore.
- To Do: Automate a standard backup (include: System, Boot, Data)
- To Do: Automate a set of backups that are compatible with TWRP. Why TWRP, cause I like it, and the differential backups that CWM does will be problematic for this tool. (I may need some help on this one.)
WARNING USE AT YOUR OWN RISK
I am not responsible if this tool destroys your soul, or your phone, or it makes a rainbow rhinoceros shoot out your bum.
NOTE: We all know the risks of doing stuff like this by now right? But the warning is still par for the course I guess. Is there a standard warning file I could link to, and make it all fancy and legal? Kinda like creative commons license only creative warning instead? Moving on...
PREREQUISITES
YOUR DEVICE MUST BE ROOTED
Linux or Mac operating system (maybe Cygwin might work, but I haven't tested it)
If you are on Linux you must have xterm installed (gnome-terminal or konsole alone won't work)
Must have the android SDK installed, and "platform-tools" must be in your $PATH
Process Viewer, "pv", must be installed
NOTE: To check if you have Process Viewer installed run pv --version in your terminal, if its not there download from here and install.
INSTRUCTIONS:
Download the appropriate tar for your OS
Extract it to a folder named "adb_bak2computer" in your $HOME directory.
Chmod everything so its all executable (chmod -Rf 777 ~/adb_bak2computer ).
Make sure your SGS3 is plugged into your machine via USB, and that you have USB debugging enabled.
If you are on CM10 or some other AOSP based ROM check the preference that keeps the screen on while plugged in.
If you are on a TouchWiz ROM use something like Wake Lock - PowerManager and force a full wakelock so your device doesn't go to sleep and or lock out adb debugging.
Run adb_bak2computer.sh from the terminal.
Pick a number
ALL CREDIT GOES TO:
das7982 - for ODIN guide here:
http://forum.xda-developers.com/showpost.php?p=28876440&postcount=1
scandiun - for "nandroid" backup directly to computer guide here:
http://forum.xda-developers.com/showpost.php?p=29862574&postcount=1
(and whomever they credited in their guides as well)
Feel free to fork, download, mod, make it all pretty, whatever you want. Its all open for sharing.
REPOS:
http://github.com/ALQI/adb_bak2computer-Mac
http://github.com/ALQI/adb_bak2computer-Linux
PM me if you want to help me with this tool, or just want to have a nice cup a tea.
Ta,
ALQI
REFERENCE THREADS:
El Grande Partition Table Reference -- E.V.A
Unlock Bootloaders -- AdamOutler
Android Kitchen -- dsixda

Look's kinda cool. Can't wait till this is finished!

Why not just use "rsync for android" from the market?
Sent from my Galaxy Note 10.1 using Tapatalk 2

blulite said:
Why not just use "rsync for android" from the market?
Sent from my Galaxy Note 10.1 using Tapatalk 2
Click to expand...
Click to collapse
That's for file based backups, which is great and I love rsync and ssh, but its not what I'm looking for. I want full on partition images going directly from my phone to my laptop (hopefully at USB2.0 speeds). So far the only way that I have seen that can do this is with scandiun's guide here:
http://forum.xda-developers.com/showpost.php?p=29862574&postcount=1
It works. I've tried scandiun's original directions and it does produce viable iamges. What I want to do is automate/simplify that process.
So far, I haven't had a chance to figure out how to get adb to play nice with spawning subprocesses in bash scripts.
like :
Code:
#!/bin/bash
function1(){
echo "function is running"
adb forward tcp:5555 tcp:5555
adb shell /system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd bs=4096 if=/dev/block/mmcblk0p17
}
function2(){
echo "function2 has to finish execution before either function can exit"
adb forward tcp:5555 tcp:5555; cd ./Cache_Test; nc 127.0.0.1 5555 | pv -i 0.5 > ./mmcblk0p17_cache.img
wait
echo "function2 is done"
}
function0(){
(function1)&
(function2)&
wait
exit
}
function0
wait
exit
This code doesn't work though. And I'm pretty sure its because adb needs actual separate terminals (not subprocesses) to run the two instances of adb forward.
This means I need a portable way to spawn new terminals. I've tried xterm -e [command] and that kinda works on linux but not on mac and I doubt it would on cygwin/windows. I may have to re-write this in python, but I'd rather use bash cause not everyone has python installed or is comfortable using it. Also, I'm lazy and I don't want to have to re-write what seems to be perfectly viable code.
Ta,
ALQI
FYI - I thought the cache partition would be a small safe partition to play around with, but its like 800MB on my device. I'll pick another for my next test/example.

Eureka (I think)
Ok, so I have a set of scripts now that can do what I need. That is execute in new terminal windows and play nice with adb.
This script (which can be .sh file), calls the other two .command files and actually backs up my cache partition.
Code:
#!/bin/bash
cd ./adb_bak2computer
open ./cache_bak1.command
sleep 2
open ./cache_bak2.command
wait
echo "cache should be backed up."
Here's the first command file:
Code:
#!/bin/bash
cache_bak1(){
echo "cache_bak1 is running"
adb forward tcp:5555 tcp:5555
sleep 2
echo "/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd bs=4096 if=/dev/block/mmcblk0p17" | adb shell
wait
}
cache_bak1
Here's the second one:
Code:
#!/bin/bash
cache_bak2(){
cd ./adb_bak2computer
echo "cache_bak2 is running"
adb forward tcp:5555 tcp:5555
sleep 2
nc 127.0.0.1 5555 | pv -i 0.5 > ./mmcblk0p17_cache.img
wait $!
echo "cache_bak2 is done"
}
cache_bak2
For some reason I to pipe in an echo of the command I wanted to run in "adb shell".
Also, depending on your terminal settings, the windows for the two command files will stay open even when they are done. To fix that, just make sure your preferred terminal emulator is set to close when a process is complete.
I'd still like to get subprocesses (from post #4) to work but its stating to look like adb no likey.
I'll try and have the rest of the code for all the paritions up within the next few days, I still have some things to figure out though. I can use a menu to seperate the dd instances or loop/wait for the pid's of each instance to quit before moving on to the next partition, I'm on the fence as to whether I want everything to run consecutively or to give users the option to pick each partition they want to back up. Maybe I can do both, but that will take longer for me to finish.
Please excuse the crap typing as I'm doing this all in my "spare" time, which means I should be sleeping.
Ta,
ALQI

Why not just make scripts pull each partition? Adb can simply pull them......
Sent from my SCH-I535 using xda app-developers app

tonu42 said:
Why not just make scripts pull each partition? Adb can simply pull them......
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
IIRC, adb pull is for files only. It can't pull full partition images.
I'm getting full partition images that can be (hopefully) used for Odin restoration and maybe nandroid or cwm restore.
Thanks for the input.
Ta,
ALQI
Sent from my SCH-I535 using xda app-developers app

ALPHA Version
OP is updated with fully functional alpha release of the tool.
Ta,
ALQI

Going to have to check this out over the weekend when I can sit down and read first.
Thank you for providing us with an alternative backup solution.
Sent from my SCH-I535 using Tapatalk 2

ok, so backing up the data block is HUGENORMOUSBIG
maybe mmcblk0p15 is including the internal sdcard because of that /data sub folder link to the sdcard?
I dunno for now, I'm going on 45mins and 6Gigs. I'll have to take a look in teh morning

Just wanted to let people know that this is not abandoned.
I only have one last hurdle. And that's getting an img file for /data without backing up /data/media (which is essentialy your internal sdcard). I can't really do a block dump cause mmcblk0p15 (am I even close there) is all userdata including /data/media.
Any ideas would be helpful? (Hint Hint)
Ta,
ALQI
Sent from my SCH-I535 using xda app-developers app

update ready to roll for Beta testers
alquimista said:
Just wanted to let people know that this is not abandoned.
I only have one last hurdle. And that's getting an img file for /data without backing up /data/media (which is essentialy your internal sdcard). I can't really do a block dump cause mmcblk0p15 (am I even close there) is all userdata including /data/media.
Any ideas would be helpful? (Hint Hint)
Ta,
ALQI
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
I got /data backup working (yay me).
OP updated!!

alquimista said:
- Thread title updated with your American way of noting the date
Click to expand...
Click to collapse
My American way of noting the date is an ISO standard... YYYY-MM-DD

OP updated with new beta2 version of the tool.
Github commited as well.
ALL mmc blocks are set for backup now, check in the "CRAZY BACKUP OPTIONS" menu for the crazy backup options.
Next up:
Fix the echo [command] | adb shell scripts not exiting without CTRL+C
Option to have the basic backups turned into an "update".zip
Ta,
ALQI

Beta3
OP Updated with Beta3
Android side adb hang bug is fixed. Yay me.
GitHub updated as well.
Ta,
ALQI

HAAAAALLP!!!
I'm struggling a bit with creating a flashable zip with the files I get using my tool.
Basically I can pick whatever partition I want, but lets just say I want a standard backup and I've run my tool pulling the following:
Code:
boot.emmc.img
cache.ext4.img
data.ext4.tar
recovery.emmc.img
system.ext4.img
Actually, ican name them whatever I want and use whatever I want, so lets simplify that even greater and just go with:
Code:
boot.img
data.tar
system.img
The updater-binary and accompanying updater-script is pretty straight forward for the boot.img and system.img, the script would have something like:
Code:
write_raw_image PACKAGE:system.img SYSTEM:
write_raw_image PACKAGE:boot.img BOOT:
That's a bit of an over simplification depending on the updater-binary I wind up using, but its the right idea (some of the wording might change a bit but the "write_raw_image" part is whats important).
But what do I do with data.tar? Can I unpack that tar directly to "DATA:"? Something like:
Code:
package_extract_dir PACKAGE:data DATA:
I don't know if the updater-binary supports this with a tar??
I could unpack the tar file before creating the zip, but then I have to set all the permissions, which should have been preserved in the tar. Or can I just write a little script to go inside the zip that will essentially "tar -xf /tmp/data.tar /data" and unpack the tarball while in recovery?
I dunno, any ideas??
This would be alot easier if I could workout a way to dd a data.img without including the internal sdcard.
Ta,
ALQI

Beta4
OP Updated with Beta4
Github as well
Added funtionality to backup internal and external SDCards.
Ta,
ALQI

Important: Mac only
I just realized that this code probably won't work on Linux.
I'm on a Mac for most of my work, so I've been making all this on a Mac (OS X Lion 10.7). The "open" command probably won't work on linux or Cygwin.
I just need to add a quick check for for the OS and then use "xterm" instead of "open" for the .command files.
Actually, since I'm doing alot of cleanup and such, I will probably remove file extensions for most of the scripts.
Anyway, sorry for any confusion. I haven't been awake for most of this. But its definately a great big FAIL on my part. Well at least until I fix it.
Ta,
ALQI

BETA5 - Now works on Linux!!
OP Updated (as well as new repos) for new linux version.
Had to seperate out a version for linux cause Macs are dumb and can't open new terminal windows without the "open" command.
Tars are attached to the OP!!

Related

[MOD] Ubuntu *Working On Epic!!* NOW UPDATED TO V1.2 (03/13/2011)

IMPORTANT INFO
First I gotta give a shoutout to KellyLewis3985 because he's helped so much with modding the script to need less work for install, run faster, and have more programs work.
NEEDED!
Must Be ROOTED
1. Busybox (Preferrably the most updated version).
2. Superuser.
3. Android SDK (With knowledge on how to use it).
4. AndroidVNC (Search exactly that in the market. It will say "Android VNC Viewer").
5. Terminal Emulator (Also available in the market).
6. Patience when working with this.
UPDATE!!
Thanks to the persistance of urboy4mbx, we now know a little more information to get it working. While both KellyLewis3985 and myself were running custom ROMS, we didn't think about testing it for the stock build. So due to urboy4mbx's will to get this installed, we now know you MUST have a custom ROM installed. There's probably ways to get it to work on the stock build, but it's going to take a little more work. For now, make sure you have a custom ROM, download, and install the files, and if we got our scripts right, it should boot right up for you.
DOWNLOAD FILE!
NOTE: When you download this zip, you will need to extract it, and inside the extracted folder will be the folder "sdcard", DO NOT!! Place this entire folder in your "ubuntu" folder, simply open it and copy all the files from it to your "ubuntu" folder on your sd card.
Download File...
Ubuntu: Epic Edition v1.2 <---These are the files you will need to run Ubuntu. It will come with "bootlinux", "fsrw", "mountonly", "ubuntu.img", "ubuntu.sh", and "unionfs".
INSTRUCTIONS!
Options For Transferring Files To Phone
First Option...
Your first option of course is the easiest. Simply connect your phone to the computer, and mount your sd card. Once on the sd card, you are going to create a new folder labeled "ubuntu". Open this folder and transfer all the files from the downloaded zip file into this folder. After you have transferred the files to your "ubuntu" folder on the sd card, unmount the sd card, but leave the phone plugged in.
Second Option...
Your second option is "adb push". Here is the command for "adb push" if you cant, or don't feel like mounting your sd card.
First you need to create your destination folder. Do so with this set of commands.
cd C:/sdk/tools (Of course you might have your sdk folder in a different location, just cd to that location)
adb shell
su
cd /sdcard/
mkdir ubuntu
exit
Now you should be back at "C:/sdk/tools", or wherever you have your sdk folder located. Next, you push the files to your folder. In order to push the files, you first need to open the zip folder, and copy all the files into your tools subfolder in the sdk folder. Then push the files with this set of commands.
adb push bootlinux /sdcard/ubuntu
adb push fsrw /sdcard/ubuntu
adb push mountonly /sdcard/ubuntu
adb push ubuntu.sh /sdcard/ubuntu
adb push unionfs /sdcard/ubuntu
adb push ubuntu.img /sdcard/ubuntu
The "ubuntu.img" file may take a little longer, as it is the largest file that needs to be transferred.
NOTE: You cannot have your sd card mounted to use adb. You must be unmounted.
INSTALLATION
1. Ok, first thing you have to do is make sure you're still cd'd to "C:/sdk/tools". Now you need to type "adb shell". You will then most likely be prompted with the symbol "$". To continue, type "su" and the symbol should then change to a "#". NOTE!!!! After adb shell, YOU MUST TYPE "su", or the program will not boot!!!
2. Next you are going to cd into the Ubuntu folder on your sd card. (cd /sdcard/ubuntu) Once in, you're going to type the command "sh ./ubuntu.sh".
After that runs through, the next thing you're going to enter is "bootlinux". Once you get the prompt "[email protected]" you have successfully installed ubuntu on the Epic.
With this new update, there is no need to install any other files, as we have added them into the image file for you so it should do so automatically. If you have issues, let us know and we will try to fix it.
PREPARING YOUR VNC TO LOAD UBUNTU!
NOTE: There is no need to type this into your adb shell. This is for information purposes only, i've displayed the code and it's position at the bottom of this post along with screen shots to show you what it should look like.
With our new update, it's a lot easier to get everything up and running, but we don't have the capability of storing the vnc server to start every time we start up ubuntu, as it was causing issues. Until we get this issue fixed, you have to start the vnc server like this:
rm -rf /tmp/.X*
export USER=root
vncserver -geometry 1280x800 (Or whatever you would like your resolution to be. We have found this to be the nicest so far.)
Ok, at this point, everything should be set up to run.
NOTE: After the initial install of ubuntu on your phone, when you want to get it to start again, all you have to do is go into the terminal emulator, first type "su" to give it superuser permissions, then type "bootlinux", it will run through it's script and give you the "[email protected]" prompt. After you get that prompt, simply type the "rm -rf /tmp/.X*", "export USER=root", and "vncserver -geometry 1280x800" prompts and you can then start vnc again.
All the info you need for vnc will be as follows.
Nickname: "root"
Password: "ubuntu" (This is a set password, so it will be the same for everyone.)
Address: "localhost"
Port: "5901"
Change Log
Version 1.2
-Modified to make it ext4 compatible.
-Modified img to make it a little faster and more stable.
That's really all I had to do for this version, as it was working before.
Version 1.1
-Modified the scripts to run smoother, faster and use less memory while running.
-Added some custom wallpapers.
-Mozilla Firefox now works.
-Modified scripts to make Ubuntu more interactive.
-Modified the .img to install everything needed instead of you having to do it.
Issues
-Firefox randomly closes. Just reopen and restore.
-After using the vncserver Ubuntu doesn't truly shutdown without a reboot. Fix in progress.
-When wanting to start Ubuntu, after initial install, you have to go into the terminal emulator and type "su", then "bootlinux", allow that to complete giving you the "[email protected]" prompt. Then type "rm -rf /tmp/.X*", "export USER=root", and "vncserver -geometry 1280x800" to start the vnc server. After that you can go right into vnc and start Ubuntu up. We ARE currently working on a fix for this issue.
If you have any issues please post. Your input helps us make this better for you.
Here's a couple tricks we picked up.
1. You can use the arrow pad on your keyboard to direct the mouse.
2. If you long press on the screen and keep your finger on it, you can slide the mouse with your finger.
3. Long press on something, is a left click.
4. Double tap on something, is a right click.
5. To get symbols to appear, such as "-", you have to HOLD the function key while hitting the symbol.
And i'm sure there's more, but there's a couple for now.
After the installation and the first time you setup the vncserver. You have to use this command everytime to start the vncserver again.
rm -rf /tmp/.X*
export USER=root
vncserver -geometry 1280x800
New links.
Ubuntu
http://db.tt/4z8uDst
New Scripts.
http://db.tt/lDjNNQn
Were working on a fix for this.
Here is the latest update. I dont know if its going to work for everyone. I suggest creating a folder inside the ubuntu folder to put the scripts you have in. Unzip this and replace the scripts in the ubuntu folder.
Please make a backup.
If you have any issues please post. Your input helps us make this better for you.
Yeah I'm on this as soon as I leave buffalo wild wings.
Sent from my SPH-D700 using XDA App
going to sleep soon for school in the morning, also will try tomorrow. naaao this is epic!
Since this is a full operating system, what are the chances or installing silverlight and being able to stream netflix?
Sent by a little green robot
As Of Right Now, The Internet Is Having Issues On This One, But Kellylewis And I Have Already Scripted Another Version Of Ubuntu And It Is Internet Compatible . We're Running It Now To Get The Bugs Worked Out And Will Have It Up Soon. After That, You Can Try To Download Whatever You Want, Considering It's An OS, And See If It Works... I Have Not Tested Downloading Anything.
The New Ubuntu Will Come As A Update, So Install This One The Way I've Instructed, And The Update Will Simply Replace The Files. The New One Is Faster, Internet Compatible, And Nicer Looking All Together. This One Still Works, But Please Be Patient For The Update. Thanks Everyone.
No matter what I do Im stuck here...
Also, If You Change The Port And It Says "VNC Cannot Connect" Or Something Like That, Back Out To The Terminal Emulator, And Hit "Exit" And "bootubuntu" Again And Change The "localhost" Number Again. Whatever The "localhost" Number, Change The Port Number To Match. Ex: "localhost:4" > "5904", "localhost:7" "5907".
Click to expand...
Click to collapse
I get "VNC connection failed!" on any port.
TIA for any help! thanks.
First, Exit From The Terminal Emulator, And Open It Back Up. Type "su" Then "Bootubuntu" Without Any Other Commands. It Should Boot It Up Still And Then When You Get The Localhost Prompt, Type "Exit" And "Bootubuntu" Again. This Time It Should Come Up Localhost:2 ...As Long As You Copied My Code, It Should Have Put The VNC Server In The Boot File So When Ubuntu Was Booted Up, It Would Automatically Start The Server. Anyways, When You Get "localhost:2" Change Your Port To 5902. Do That And Let Me Know What Happens.
Why Do You Type Like This? It's Really Annoying!
infamousjax said:
Why Do You Type Like This? It's Really Annoying!
Click to expand...
Click to collapse
Because That's How I Type... You Aren't Required To Look At This Thread, So If It Bothers You, Just Hit The Back Button. Otherwise, How I Type Should Be Of No Importance, So If You Want Ubuntu, Run The Script To Get It And You'll Never Have To Worry About How I Type Ever Again. It's Completely Up To You.
most excellent. hooks up without a glitch or a hangup or anything!
is lxde the only desktop you have used? would other replacement desktops work? im not saying lets throw gnome on there...but i wonder how it would run...takes a minute to get used to but runs like a champ!
so could this really the first step and getting the phone to fastboot into a ubuntu partition?
newkidd said:
most excellent. hooks up without a glitch or a hangup or anything!
is lxde the only desktop you have used? would other replacement desktops work? im not saying lets throw gnome on there...but i wonder how it would run...takes a minute to get used to but runs like a champ!
so could this really the first step and getting the phone to fastboot into a ubuntu partition?
Click to expand...
Click to collapse
If you like this one YOUR gonna love the next one. Its so much faster and looks amazing.
infamousjax said:
Why Do You Type Like This? It's Really Annoying!
Click to expand...
Click to collapse
Why would you come in to someones thread that has worked hard to give to the community and bash them? It makes no sense unless your jealous of him. Go whine about something else somewhere else. Thank you and have a nice day.
Here Are Some Screen Shots From The Next Ubuntu Version We're Working On ...Isn't It Gorgeous??
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Give Us Some Feedback And Let Us Know What You Think
This guy mr im going to bed. Lol wait until you see what im doing.
Sent from my SGH-T959 using XDA App
I figured for all the skeptics I would put a bad pick up of the next update. Especially when it says drocap2 in it.
Sent from my SGH-T959 using XDA App
KellyLewis3985 said:
Why would you come in to someones thread that has worked hard to give to the community and bash them? It makes no sense unless your jealous of him. Go whine about something else somewhere else. Thank you and have a nice day.
Click to expand...
Click to collapse
SERIOUSLY? THAT IS NOT BASHING HIM. WHEN PEOPLE YELL AND SCREAM BY TYPING IN ALL CAPS IT IS JUST AS ANNOYING, DON'T YOU AGREE? HE WAS JUST POINTING OUT THAT TYPING THE WAY HE DOES IS A PAIN IN THE ASS TO READ. IF YOU CAN'T UNDERSTAND THAT THEN YOU MAY BE RETARDED. JUST LIKE PEOPLE WHO TYPE IN ALL CAPS. THANK YOU.
Sent from my SPH-D700 using XDA App
KellyLewis3985 said:
Why would you come in to someones thread that has worked hard to give to the community and bash them?
Click to expand...
Click to collapse
Because it legitimately detracts from the quality of an otherwise fine thread.
Also, it would be helpful if the landscape screenshots could be rotated so the text is right-side up. Thanks!
Just a noob question before I start... This only runs after you've booted it from the terminal emulator? As in your phone is still running all its original phone software (and by this I don't mean stock software, just phone software in general, custom or otherwise) and this is something you can boot on top of that? Maybe my terminology is wrong here, but that's at least how it appeared to work to me and I just wanted to check! Thanks!
wjsmaggle said:
Just a noob question before I start... This only runs after you've booted it from the terminal emulator? As in your phone is still running all its original phone software (and by this I don't mean stock software, just phone software in general, custom or otherwise) and this is something you can boot on top of that? Maybe my terminology is wrong here, but that's at least how it appeared to work to me and I just wanted to check! Thanks!
Click to expand...
Click to collapse
yeah it pretty much runs as a virtual machine on top of android...i only tested it and everything but android is always running...it grabs data and internet from the phones 3g/4g connection.

[TOOLKIT] Nexus 7 rooting tool for Linux [Updated 09/17/12]

WARNING THIS IS A VERY EARLY VERSION AND MAY CONTAIN A LOT OF BUGS. USE AT YOUR OWN RISK
This is my attempt at making a one-click Nexus 7 rooting tool for Linux; it is written in Python with PyQt4
Features:
-Root/Unroot your device
-Permanently flash CWM recovery (touch or standard version)
-Permanently flash TWRP
-Unlock/Lock the bootloader
-Flash an img file to a selected partition
-Reboot the device into recovery or bootloader mode
-Launch an adb shell
-Backup/Restore your apps and shared data (not paid apps)
-Flash a CWM zip
-More to come
Initial setup:
You must add a udev rule to run this tool as a non-root user
To do that on Ubuntu:
-Hit Alt+F2 and type:
gksu gedit /etc/udev/rules.d/51-android.rules
-Copy/paste the following:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
-Save the file
-And reboot
Alternatively, you can use the included script, setup_udev.sh
You must enable USB debugging on your tablet for this tool to work:
-Go to Settings>Developer options, and check "USB debugging"
Dependencies:
-Python 2.x
-PyQt4
On Ubuntu you can install them like this:
Code:
sudo apt-get install python2.7 python-qt4
* The standalone versions do not have any dependencies
64-Bit users:
You will need to install 32-Bit compatibility libs for adb and fastboot:
Code:
sudo apt-get install ia32-libs
Rooting instructions:
* Right-click n7root.py and choose Properties, go to the Permissions tab and make sure that Allow executing this file as a program is checked (it should be already, but it doesn't hurt to check)
* Now you can start the program by double-clicking n7root.py
* Before Unlocking your device you should click the Backup button to backup your data.
* Before rooting you must unlock the device; do that by clicking the Unlock button
* After unlocking you can restore your data by clicking the Restore button
* Now click the Root button to root the device
* (Optional) If you want to use a custom recovery, select your recovery and click the Install recovery button
Downloads:
Version 4
Standalone executable for Ubuntu 12.04
- Added CWM zip flasher
- Code is now cross-platform and should work on Windows and Mac OS X (untested)
* Mac users will need to download the Mac adb/fastboot binaries and place them in the tools folder renamed to adb.mac and fastboot.mac; they will also need to install Python 2.x and PyQt4
* I made an experimental standalone executable for Windows, but was unable to properly test it because I couldn't get the USB drivers working on Windows 8 x64. It does not currently handle USB driver installation like other toolkits, so you'll have to do that manually.
md5: b53f1d487256b56b25bae74c35f82a91
Ubuntu executable: ebe4249c0855c5a26b7d896e68550d9a
Windows executable: 3d4fe0e419eb7c8fc6d17eef6d66c0b8
Live CD:
This is a bootable Linux live CD based on Knoppix that includes the toolkit and not much else. It can be used on any computer without installing anything; just burn the iso to a CD with Imgburn or write it to a USB drive with Suse Image Writer and boot from it.
Live CD v4
md5: c3a031762437024667e4a7331992238e
Screenshots:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Big thanks to:
* ChainsDD for Superuser
http://androidsu.com
* Koush for CWM
http://www.clockworkmod.com
* Team Win for TWRP
http://teamw.in/project/twrp2
* And Google
stop using toolkits and stop posting toolkits. they are not needed on any nexus device. all you are doing is introducing more problems http://forum.xda-developers.com/showthread.php?t=1815020
simms22 said:
stop using toolkits and stop posting toolkits. they are not needed on any nexus device. all you are doing is introducing more problems http://forum.xda-developers.com/showthread.php?t=1815020
Click to expand...
Click to collapse
This is truth.
I made this because I saw some requests for a Linux version of Wug's toolkit.
If it's completely useless and Linux users prefer to just do it manualy, that's okay.
At least I learned a bit about GUI programming in python while making it.
steevp said:
I made this because I saw some requests for a Linux version of Wug's toolkit.
If it's completely useless and Linux users prefer to just do it manually, that's okay.
At least I learned a bit about GUI programming in python while making it.
Click to expand...
Click to collapse
learning is always good.
No bugs for me on latest version of Ubuntu!
Sucessful root and CWM install, I didn't use it to unlock though
steevp said:
I made this because I saw some requests for a Linux version of Wug's toolkit.
If it's completely useless and Linux users prefer to just do it manualy, that's okay.
At least I learned a bit about GUI programming in python while making it.
Click to expand...
Click to collapse
I like toolkits and I'm a linux user mostly.
Thanks for this.
Sent from my HTC Evo Shift using xda app-developers app
I am using linux cause with windows 8 I can't do anything and this tool is really useful as I am new to the linux ecosystem.
Everything worked smoothly.
Good work and thanks
Please don't stop developing the toolkit. Some people don't like them, but some people do.
ferossan said:
Please don't stop developing the toolkit. Some people don't like them, but some people do.
Click to expand...
Click to collapse
Since people are using it I will continue to improve it.
Currently working on giving more detailed error messages, so that the user isn't left completely clueless if something goes wrong.
Could be possible to improve this tool adding the "Team Win for Open Recovery" (TWRP) as one option as well?
Also, as long I understand, the tool is using "Superuser", is it better than "SuperSU"?
ferossan said:
Could be possible to improve this tool adding the "Team Win for Open Recovery" (TWRP) as one option as well?
Also, as long I understand, the tool is using "Superuser", is it better than "SuperSU"?
Click to expand...
Click to collapse
Yes, I will add an option for TWRP.
I have not used SuperSu yet, I will check it out.
Sent from my Nexus 7 using Tapatalk 2
Ubuntu/nexus 7
Hi!
I'm a Ubuntu user since 8.04...This looks like what I need.
Do you have any more info/success?
Thanks!
MegaKegHead
steevp said:
WARNING THIS IS A VERY EARLY VERSION AND MAY CONTAIN A LOT OF BUGS. USE AT YOUR OWN RISK
This is my attempt at making a one-click Nexus 7 rooting tool for Linux.
The GUI is written in Python with PyQt4 and the actual rooting is done with shell scripts.
Features:
-Root/Unroot your device
-Permanently flash CWM recovery (touch or normal version)
-Unlock/Lock the bootloader
-Flash an img file to a selected partition
-Reboot the device into recovery or bootloader mode
-Launch an adb shell
-More to come
Initial setup:
You must add a udev rule to run this tool as a non-root user
To do that on Ubuntu:
-Hit Alt+F2 and type:
gksu gedit /etc/udev/rules.d/51-android.rules
-Copy/paste the following:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
-Save the file
-And reboot
You must enable USB debugging on your tablet for this tool to work:
-Go to Settings>Developer options, and check "USB debugging"
Dependencies:
-Python 2.x
-PyQt4
On Ubuntu you can install them like this:
Code:
sudo apt-get install python2.7 python-qt4
64-Bit users:
You will need to install 32-Bit compatibility libs for adb and fastboot:
Code:
sudo apt-get install ia32-libs
Downloads:
Version 0.1
md5: ee12e64399173791a922ec82cb2c06eb
Screenshots:
Big thanks to ChainsDD (http://androidsu.com) for Superuser and Koush (http://www.clockworkmod.com) for CWM.
Click to expand...
Click to collapse
I just uploaded version 2
Not a lot has changed feature-wise, but there are many changes under the hood to hopefully make it safer and more reliable.
The included Superuser "zip" should be flashed by booting on Recovery, right? Or the GUI will offer an option?
Thanks!
ferossan said:
The included Superuser "zip" should be flashed by booting on Recovery, right? Or the GUI will offer an option?
Thanks!
Click to expand...
Click to collapse
Depends most common way is to boot an insecure image then remount system as root then send su and Superuser.apk (and of course) create symboliks link)
I have coded in C++ a tool to root your device in one click. Works in Windows/Mac/Linux and yes it does have a GUI, it is not a command line appliation
Sent from my Nexus 7 using Tapatalk 2
ferossan said:
The included Superuser "zip" should be flashed by booting on Recovery, right? Or the GUI will offer an option?
Thanks!
Click to expand...
Click to collapse
That is done automatically by the GUI
Basically when you click the "root" button it does this:
1. Reboots into bootloader mode
2. Boots a temporary CWM
3. Copies the included Superuser zip to the internal storage
4. And then it flashes the zip
These are the exact commands it runs if you wanted to do it manually:
Code:
$ ./tools/adb reboot bootloader
$ ./tools/fastboot oem unlock
$ ./tools/fastboot boot ./data/recovery-clockwork-6.0.1.0-grouper.img
$ ./tools/adb shell mount /data
$ ./tools/adb push ./data/Superuser-3.1.3-arm-signed.zip /sdcard/
$ ./tools/adb shell recovery --update_package=/sdcard/Superuser-3.1.3-arm-signed.zip
steevp said:
That is done automatically by the GUI
Basically when you click the "root" button it does this:
1. Reboots into bootloader mode
2. Boots a temporary CWM
3. Copies the included Superuser zip to the internal storage
4. And then it flashes the zip
These are the exact commands it runs if you wanted to do it manually:
Code:
$ ./tools/adb reboot bootloader
$ ./tools/fastboot oem unlock
$ ./tools/fastboot boot ./data/recovery-clockwork-6.0.1.0-grouper.img
$ ./tools/adb shell mount /data
$ ./tools/adb push ./data/Superuser-3.1.3-arm-signed.zip /sdcard/
$ ./tools/adb shell recovery --update_package=/sdcard/Superuser-3.1.3-arm-signed.zip
Click to expand...
Click to collapse
Thank you very much. Now everything is comprehensible. :good:
Please do not quit working on this! It worked perfectly for Ubuntu 12.04 and it was very simple and fast.
Doing it manually is a lot of fun, but it's definitely not for everyone.
Thanks again!
Version 3 is now up
This version fixes a bug and adds a backup/restore function for your apps and shared data
PotentChili said:
Please do not quit working on this! It worked perfectly for Ubuntu 12.04 and it was very simple and fast.
Doing it manually is a lot of fun, but it's definitely not for everyone.
Thanks again!
Click to expand...
Click to collapse
Thanks for testing I appreciate it

[GUIDE] How to extract, create or edit android adb backups

What is an android adb backup?
An adb backup is a file with ab extension, generated by android's backup manager when we request it via adb shell. This allows you to backup some data of the phone, but is not a replacement of a clockworkmod backup:
- Java 7 or higher is required because of SYNC_FLUSH mode for the Deflater.
- If the backup contains apk+data for an app, restore will work. If contains only the data, you must install the app first on the device and then restore. Installing the app later won't work.
- Some apps include a policy where the apk is never backed up even if specified.
- Inside an ab file is a tar file, which contains files and folders in a certain order. You have you respect that order, which is not necessarily alphabetical like tar does by default. Such order is listed in "Full local backup infrastructure".
- Inside the tar file, directories must not have trailing slash, for that reason pax, star or equivalent has to be used.
- There are some bugs present in the android source code.
- 'adb backup' or 'adb restore' are pretty slow, between 1 and 2.6 MBps.
- The adb backups (usually with .ab extension) can be password protected or not. If the device is encrypted this is a must and has to be the same used for the device.
- Star is recommended instead of pax, which supports path length only up to 100 characters, so will fail in some cases. This usually happens with browsers history.
- ADB backups are not a replacement for a Nandroid backup. The whole /data partition is not backed up, only a part of it. Also, other partitions like /system, /preload, /cache, modem, RIL, efs, kernel or recovery are never backed up because are not user data. This is to prevent issue when restoring on a different device. It has also the biggest
- If you have the device encrypted with a password, you must use that particular one for backup creation and restore. You can't create a backup without password or a different one in that particular case, or if you try to restore will fail.
- star for cygwin for windows is attached (move it to C:\cygwin\bin\star.exe) since there is no package available. It can be compiled from the schily (ftp://ftp.berlios.de/pub/schily/).
- The best way to test if an adb backup has errors, is to convert it to tar and then check.advantage that doesn't require root to operate, so is totally compatible with stock roms, locked bootloaders and device encryption.
- There's also a bash script called adb-split.sh that creates individual adb backups for each recognized app from the full one, so you can restore apps individually. Same encryption is preserved to them, if any.
You can use java or perl, although with perl can be more complicated because requires downloading some modules from cpan and some ssl headers.
To know more information about types of android backups:
[Guide] Types of Android backups
Software needed
The entire process can be done from Windows, but is better to use a unix-like operating system, like Linux, OS X or BSD, since we should extract the files on a filesystem that preservers file permissions and owners and repack the tar archive. Furthermore some tools like star are easier to get for linux. In such cases, using Virtualbox or VMWare Workstation is highly recommended. Using Windows should work in any case whatsoever.
Cygwin
Preferably 32 bits: has more packages and is less prone to errors. Furthermore, the star for cygwin attached is 32 bits.
Java 7 or higher
Java 7 or OpenJDK 7 (more builds here)
Oracle Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 if you are going to work with password encrypted backups.
You need to install the files local_policy.jar and US_export_policy.jar under jre's lib/security folder, for example:
- For Windows:
C:\Program Files\Java\jdk1.7.0_09\jre\lib\security\
C:\Program Files\Java\jre7\lib\security\
C:\Program Files (x86)\Java\jdk1.7.0_07\jre\lib\security\
C:\Program Files (x86)\Java\jre7\lib\security\
- For Linux or BSD:
/usr/local/jdk1.7/jre/lib/security/
/usr/lib/jvm/java-7-openjdk-*/jre/lib/security/
/usr/local/openjdk7/jre/lib/security/
- For OS X:
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/security/
Perl
Perl is available for several operating systems
libssl or openssl headers. If you are using Linux or Cygwin is much more easier
cpan modules required by use functions
pax or star
pax is an archiving utility that compresses in ustar by default. In this case is extremely useful because stores directories without trailing slash. Is available for all operating systems, and in windows can be installed via cygwin's setup.exe or download a native version like gnuwin32 (sometimes available via bsdtar with pax option). pax doesn't work when paths are more than 100 characters lenght, so I recommend star instead.
star allows storing directories without trailing slash. You can get the ubuntu version 1.5 here. For Windows you can use Cygwin's version included.
Android Backup Extractor
Android Backup Extractor is the java application that does all the job. It includes the perl scripts.
How it works, better with an example
I will use an example to demonstrate how it works, with java version. If you like to use perl, just grab the perl scripts and is nearly the same.
This is extracted from the readme file, and will extract a whole adb backup and repack only the data for the game Grand Theft Auto III for android.
1) Convert the original adb backup to tar format:
Code:
java -jar abe.jar unpack nexus7.ab nexus7.tar <password>
2) Extract the contents of the tar archive. This should be done on a filesystem where the permissions of the files inside the tar are preserved, for example using linux, mac or bsd. Up to two folders may appear, apps and shared:
Code:
tar -xvf nexus7.tar
3) Make a list of all the contents of the original archive in the order they are archived:
Code:
tar -tf nexus7.tar > nexus7.list
4) Create a new list only with the files and folders you want, in proper order. For example for the GTA 3 (you can try savegames instead of all data):
Code:
cat nexus7.list | grep com.rockstar.gta3 > gta3.list
5) Create the new tar archive. The directories stored on tar shouldn't contain trailing slashes, so I use pax or star instead of tar. Pax works also if paths are up to 100 of lenght:
Code:
cat gta.list | pax -wd > gta3.tar
OR
Code:
star -c -v -f gta3.tar -no-dirslash list=gta3.list
6) Create the adb backup from the tar archive. Password is optional:
Code:
java -jar abe.jar pack gta3.tar gta3.ab <password>
Note: if the backup is not encrypted zlib can be used instead for both unpack and pack the ab archive:
- Quick unpacking:
Code:
dd if=nexus7.ab bs=24 skip=1 | openssl zlib -d > nexus7.tar
- Quick packing:
Code:
dd if=nexus7.ab bs=24 count=1 of=gta3.ab ; openssl zlib -in gta3.tar >> gta3.ab
Split an Android backup
Use Android Backup Splitter (is a shell script). Works on Cygwin too:
sh adb-split.sh backup.ab [password if needed]
Resulting files go in app-ab folder
# ADB Backup Splitter:
#
# This bash script utility generates an adb backup for each item
# on apps/ folder. That equals to generating an adb backup for
# each app.
#
# shared/0 and shared/1 (sdcards) are ignored, so that means that
# external data and OBB files, although may be backed up, may not
# be restored. For doing so backup the folder Android of the sdcards.
# Creating a backup with -shared flag has know issues (corruption)
# so is not recommended. Future releases of this script may add
# the option to automatically detect things from sdcards inside
# the adb backup file.
#
# This script works on Cygwin also, and in general where star does.
#
# There may be apps in the backup that don't include the apk. In that
# particular case, the data won't be restored, so the individual backup
# is generated for testing purposes only. Installing the apk afterwards won't work.
# There is generated an html file called apk-missing.html so you can open it and
# install all applications from Play Store on any of your devices.
Patch apps to allow adb backup
Some apps specify in the AndroidManifest.xml android:allowBackup="false" so it won't be backed up by adb backup. If you have root and use Titanium Backup or CWM or TWRP they will do the job, but if you don't want root the only solution is to modify the apk to edit that string. Read here how to do that and the pros and cons:
[GUIDE] How to enable adb backup for any app changing android:allowBackup
Links
Android Backup Splitter (@ Sourceforge)
Android Backup Extractor (@ Sourceforge)
Android Backup Extractor (@ GitHub)
Documentation at Blogspot
Full local backup infrastructure
[Guide] Types of Android backups
Backing Up Android Games
Titanium Backup Decrypter
Perl scripts to encrypt/decrypt adb backup files
[GUIDE] Full Phone Backup without Unlock or Root
[GUIDE] Internal Memory Data Recovery - Yes We Can!
[Q] [adb] backup not working for Temple Run
Related adb backup and restore bugs:
Issue 55860: adb backup skips the apk for certain apps and doesn't prompt for download when restoring
Issue 48126: device adb connecting to localhost adbd cannot execute commands anymore since 4.2.2 (error device offline)
Issue 3254: adb shell doesn't return exit code of program
Issue 53065: Debugging via ADB stopping the onClick action on ImageView widget
Issue 53668: ADB : An existing connection was forcibly closed by the remote host
Issue 54781: adb install: single quotes in filenames cause quoting issues
Issue 55173: (Game) Offroad Legends does not detect obb when restored via adb restore
Issue 55178: (Game) Carmageddon Promo does not detect obb when restored via adb restore
Issue 28303: adb backup doesn't respect -noshared flag
Issue 32830: adb restore errors not displayed on device
Issue 34311: Galaxy Nexus gets stuck when restoring adb backup
Issue 25780: BackupManager causes reboot when BackupAgent missing
Issue 40691: ab backup and restore Ski Safari does not restore saved data
Issue 16286: Restoration of phone not working properly
Issue 39014: Nexus 7 adb restore freezes when restoring udk.android.reader
Warning about Helium (Carbon): helium backups are just android adb backups that are not compressed with Java Deflater. It means they were created with the option static final boolean COMPRESS_FULL_BACKUPS = false.
A normal adb restore should work.
Great guide, and can confirm that it does work!
I managed to use this method to restore my angry birds data from a Froyo phone (HTC Desire), to a Jelly Bean phone (HTC One X+). This is no easy task since you cannot use adb backup/restore on Froyo, but you can use adb pull, and you can't use adb push on Jelly Bean, but you can use adb backup/restore. Just in case anyone is looking to do the same, here is the process I used (requires having adb up and running but does not require root)...
As the adb backup function doesn't work on Froyo, I had to use adb pull to grab the angry birds data files (highscores.lua and settings.lua). Then, making sure that you have angry birds installed on the jelly bean phone and have played the first level, use the adb backup command to backup just the angry birds app. You can then use scandiuns guide to extract a tar file from the backup file, and then extract the "app" folder from the tar file.
Once this is done, you will find the highscores.lua and settings.lua files in the apps/com.rovio.angrybirds/f directory. Replace these two files with your original ones that you pulled from the old device. Then package up the app folder using the guide. Then just use adb restore to restore the modified backup file to your new device, and you should have all your old scores restored!
Hope that helps and thanks to scandiun for the great guide! :good:
cn198 said:
Great guide, and can confirm that it does work!
I managed to use this method to restore my angry birds data from a Froyo phone (HTC Desire), to a Jelly Bean phone (HTC One X+). This is no easy task since you cannot use adb backup/restore on Froyo, but you can use adb pull, and you can't use adb push on Jelly Bean, but you can use adb backup/restore. Just in case anyone is looking to do the same, here is the process I used (requires having adb up and running but does not require root)...
As the adb backup function doesn't work on Froyo, I had to use adb pull to grab the angry birds data files (highscores.lua and settings.lua). Then, making sure that you have angry birds installed on the jelly bean phone and have played the first level, use the adb backup command to backup just the angry birds app. You can then use scandiuns guide to extract a tar file from the backup file, and then extract the "app" folder from the tar file.
Once this is done, you will find the highscores.lua and settings.lua files in the apps/com.rovio.angrybirds/f directory. Replace these two files with your original ones that you pulled from the old device. Then package up the app folder using the guide. Then just use adb restore to restore the modified backup file to your new device, and you should have all your old scores restored!
Hope that helps and thanks to scandiun for the great guide! :good:
Click to expand...
Click to collapse
I have tried similar attempt to restore my save of another game but that doesn't work.
How did you replace the files in the .tar file? I am using 7z to replace the .tar file but nothing happen after i restored.
Thanks.
ball3t said:
I have tried similar attempt to restore my save of another game but that doesn't work.
How did you replace the files in the .tar file? I am using 7z to replace the .tar file but nothing happen after i restored.
Thanks.
Click to expand...
Click to collapse
Read the guide. 7z is not compatible, you have to use star or equivalent and meet the requirements.
scandiun said:
Read the guide. 7z is not compatible, you have to use star or equivalent and meet the requirements.
Click to expand...
Click to collapse
star
star is required since GNU Tar does not allow storing directories without trailing slash. You can get the ubuntu version 1.5 here. For windows or Cygwin I haven't found it yet, if exists.
Because i am using windows, so does it mean that i couldn't modify the .tar file in any way?
thanks.
ball3t said:
Because i am using windows, so does it mean that i couldn't modify the .tar file in any way?
thanks.
Click to expand...
Click to collapse
Yes, from windows you can use pax. You can download it from cygwin's setup.exe. I've updated the guide, see the step 5.
scandiun said:
Yes, from windows you can use pax. You can download it from cygwin's setup.exe. I've updated the guide, see the step 5.
Click to expand...
Click to collapse
it worked!!
thank you so much.
Maybe I'm missing something.
I've installed Java, ran cygwins setup.exe and I think it installed everything. Also downloaded the Android Backup Extractor. I try running a windows command prompt with:
java -jar abe.jar unpack nexus7.ab nexus7.tar
All I get is "java is not an internal or external command". I'm running the command prompt in the android backup extractor folder. Does everything have to be in the same folder? Where do I dump everything?
AAhrens said:
Maybe I'm missing something.
I've installed Java, ran cygwins setup.exe and I think it installed everything. Also downloaded the Android Backup Extractor. I try running a windows command prompt with:
java -jar abe.jar unpack nexus7.ab nexus7.tar
All I get is "java is not an internal or external command". I'm running the command prompt in the android backup extractor folder. Does everything have to be in the same folder? Where do I dump everything?
Click to expand...
Click to collapse
Probably java is not in your path, try
Code:
which java
It should result something like
Code:
$ which java
/cygdrive/c/Windows/system32/java
Add Java to the Windows Path
Then restart cygwin
Omg omg omg! Thanks for the guide you just saved my ass, i love you!!!!!
scandiun said:
2) Extract the contents of the tar archive. This should be done on a filesystem where the permissions of the files inside the tar are preserved, for example using linux, mac or bsd. Up to two folders may appear, apps and shared:
Code:
tar -xvf nexus7.tar
Click to expand...
Click to collapse
Hi,
I'd like to try this out on a Windows 7 (virtual) machine. All software installed an clear what to do. But how do I manage to preserve the file permissions? Does Cygwin take care of that?
Thanks
ttv said:
Hi,
I'd like to try this out on a Windows 7 (virtual) machine. All software installed an clear what to do. But how do I manage to preserve the file permissions? Does Cygwin take care of that?
Thanks
Click to expand...
Click to collapse
You can't preserve the exact permissions because of the operating system and the filesystem. While permissions will be somewhat similar the owner will change completely. While android has the owner encoded by a number windows will use your windows username. I made simple modifications of backups on windows and luckily worked, but of course can't promise you that will apply for all the cases.
If you know how to use virtual machines, why just don't use linux / unix? For example if you use PC-BSD or Linux Mint you can download directly the Virtualbox image and then share a folder or use ftp server.
http://virtualboximages.com/LinuxMint+14+KDE+Desktop+32bit+Virtual+Appliance
scandiun said:
If you know how to use virtual machines, why just don't use linux / unix? For example if you use PC-BSD or Linux Mint you can download directly the Virtualbox image and then share a folder or use ftp server.
http://virtualboximages.com/LinuxMint+14+KDE+Desktop+32bit+Virtual+Appliance
Click to expand...
Click to collapse
Thanks for the answer.
I didn't understand the bit about sharing a folder on Unix before, but now I think it clicks.... The Linux/Unix VM is only used to share a folder in which I can extract the Android backup from my Windows machine right? So that way I can still use the installed software and drivers for my Nexus 4 on the Windows machine. Do I understand this correctly?
If that's the case I am going to try right away. Otherwise I have to make the Nexus 4 software installation work on the Unix/Linux VM and that will take a lot more time I think.....
ttv said:
Thanks for the answer.
I didn't understand the bit about sharing a folder on Unix before, but now I think it clicks.... The Linux/Unix VM is only used to share a folder in which I can extract the Android backup from my Windows machine right? So that way I can still use the installed software and drivers for my Nexus 4 on the Windows machine. Do I understand this correctly?
If that's the case I am going to try right away. Otherwise I have to make the Nexus 4 software installation work on the Unix/Linux VM and that will take a lot more time I think.....
Click to expand...
Click to collapse
Yes, I mean to access from linux the folder you share in windows, but then remember to copy the backup inside linux to extract it there, to preserve permissions.
You have the option to share folders in Virtualbox and VMWare Workstation. In case you use virtualbox, make sure the guest has Guest Additions installed. Some virtualbox images already come with it.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Well I got the java command to work, but now the "cat" command will not work? Your link to add java to the path worked for the latter, but how do I get 'cat' to work?
AAhrens said:
Well I got the java command to work, but now the "cat" command will not work? Your link to add java to the path worked for the latter, but how do I get 'cat' to work?
Click to expand...
Click to collapse
What exact error are you getting?
scandiun said:
What exact error are you getting?
Click to expand...
Click to collapse
"Cat is not an internal or external command"
AAhrens said:
"Cat is not an internal or external command"
Click to expand...
Click to collapse
What shell are you using? cat is included on any default linux installation.
scandiun said:
What shell are you using? cat is included on any default linux installation.
Click to expand...
Click to collapse
Windows 8
On Cygwin you have cat and the other utilities you have to install them from the setup.

[SCRIPTS] ROM, kernel, anykernel updater and Environment-setup scripts

Hey guys
I've been working on some scripts to automate my work for quite some time now and thought, why not share it?
So that's what I'm gonna do now
For now, we have three scripts: one to build a ROM, one to compile a kernel, to make an anykernel updater zip and to set up and entire build environment on Arch and Ubuntu-based distros (2nd post). The kernel and anykernel scripts, however, are linked, which means the kernel script automatically executes the anykernel script so as soon as you compile a kernel, you get a recovery flashable zip.
A small note: These scripts were made for the LG Optimus 4x HD, but can easily be modified for any other device.
So, you may ask yourself now 'nice, but what do these script do exactly?' well, that's what I'm gonna tell you now
ROM
The ROM build script can be found HERE
This script is made for CM 11, but can be easily modded to be used with other ROMs. I will also add some more scripts to support more ROMs in the future.
In order to make it compatible with your machine and your device, we have several configurable parameters in the beginning of the script:
Code:
# Configurable parameters
ccache_dir=/home/laufersteppenwolf/ccache/CM11
ccache_log=/home/laufersteppenwolf/ccache/CM11/ccache.log
jobs_sync=30
jobs_build=20
rom=cm
rom_version=11
device_codename=p880
If you want to use a special ccache dir, you can define it using the first parameter. Same for ccache's log.
The "jobs_sync" variable defines how many jobs will be running at the same time while running "repo sync" (---> the -j value)
The "jobs_build" variable defines how many jobs will be used for the make command
"rom" defines the ROM you are trying to compile (used in the lunch command, but also for the zip upload command)
"rom_version" defines the version of the ROM. You can change it to 10.2 or any other version depending on the CM version you are compiling.
Last but not least, the devices codename. In my case it's "p880", but you can just change it to your device (mako, hammerhead, maguro,...) and the lunch as well as the upload command will be changed to your device.
About the upload, if you have a goo.im account and also configured it in your ssh_config, you can just leave it the way it is. However, if you use a different file hoster, please edit the last command to your needs
Furthermore, we have some more features. These, however, don't need to be defined inside the script, but added to the execution command.
You can execute the script with the command:
Code:
. build.sh [-h -n -r -c -ncc -d -j #]
But what do these flags do?
Code:
-h | --help
shows a help message and exits the script
Code:
-n | --nosync
skips the "repo sync" command
Code:
-r | --release
uploads the build when it's done
Code:
-c | --clean
executes "make clean" instead of "make installclean"
Code:
-ncc | --no_ccache
disables ccache
Code:
-d | --debug
shows some debug stuff (not really needed for the "normal" user )
Code:
-j #
sets a custom number of jobs for the "make" command
Example:
Code:
. build.sh -c -r
This command syncs the repos, executes "make clean" instead of "make installclean" and uploads the build to the defined file hoster as soon as the build is done.
Kernel
The kernel build script can be found HERE
This script is made for the p880 (aka x3), but can be easily modded to work with your device.
We have 2 configurable parameters in the beginning of the script:
Code:
defconfig=cyanogenmod_x3_defconfig
jobs=32
"defconfig" defines the name of your defconfig to be used
And "jobs" defines the -j value to be used for make
All modules are being copied to ./out/modules/ and the zImage is being copied to ./out/zImage. Which means no more searching for modules inside the various folders, but having everything in one place
If you take a look into the script, the created out dir is after the above command copied to "~/smb/kernel/out". This is where my network drive is mounted. Please change it to a path of your choice.
This folder now needs to have the files from the anykernel folder inside, because the anykernel build script is being executed next. What this script exactly does will be explained later.
When the anykernel updater zip is done, the script cd's back to the place it was initially executed and will then be done.
If you don't want to make an anykernel zip, just remove the commands after
Code:
find -name '*.ko' | xargs -I {} cp {} ./out/modules/
(well, maybe except for the commands that tell you the script it done )
Anykernel updater zip
Wanna know what an anykernel updater zip is?
The anykernel updater zip only replaces the actual kernel (zImage) and not the whole boot.img. This means the ramdisk stays the same, which makes the kernel compatible with every ROM and Android version.
The script and it's needed tools can be found HERE
This script creates an anykernel updater zip from a given zImage and modules. The zImage has to be in the same folder as the script itself. The modules have to be in a folder called "modules", which also should be located in the same folder as the script. In the beginning of the script, you can define the name of the zip:
Code:
zipname="WWJB_v009_anykernel.zip"
IMPORTANT:
Please make sure to edit the updater-script so it is compatible with your device! Otherwise you can (hard) brick your device!
I am not responsible for possibly bricked devices!
Another feature of the anykernel updater is, you can mod the ramdisk while flashing (repacking the boot.img). This can be done inside THIS file. By default it creates an unsecured boot image. But you can edit way, way more using this method. For an example what can be done, you might wanna take a look at THIS file
The signapk.jar and the sign keys were taken from the latest CM11 sources.
You have a question, suggestion, bug report? Please feel free to leave a reply in this thread
Many thanks go to @GermainZ and @doixanh for helping me fighting with bash
Thanks also go to Koush, for "inventing" the anykernel updater
Environment setup script
Who is bored of setting up an entire build environment for Android? I certainly am, which is why I wrote this "tiny" script
This script sets up a complete build environment, so you can directly start to repo sync a ROM after the script is done. And the best thing is, it is extremely customizable without even having to edit the script itself. All done by appending the appropriate flags to the executing command.
A further big advantage of this script is, that it is compatible with the two most common Linux distros Arch Linux and Ubuntu (also including all distros that are based on these 2, like Xubuntu, Lubuntu,....). This compatibility is achieved by detecting the distro in the beginning of the script and then using the appropriate commands (apt-get or pacman).
The script is located HERE and called "setup.sh"
To run the script, cd to the folder the script is located and enter ". setup.sh" and append all desired flags. If you need help, just append the "-h" or "--help" flag and some help will be shown.
So, you may ask yourself now "That's nice, but what the hell does this script install/set up?" and the answer is quite simple: All you need, and (if desired) even more
The "base package" includes:
Ccache
Java
GIT
All needed build tools
Python 2
The Android SDK
Furthermore, you can also choose the "extended package" by appending the flag "-e" or "--extended", which includes:
SSH
iostat
bmon
htop
geany
The dev-host commandline tool by GermainZ
udev-rules (on Arch only)
If this still isn't enough for you, you can also add your own packages. This can be done by either editing the script and entering the packages inside the quotes of the following line:
Code:
extra="" # Add here some extra packages to install
OR
by appending the flag "-s" or "--special" and then listing the packages within quotes, seperated by spaces.
Example:
Code:
. setup.sh -s "package1 package2 package3"
This script is made to perform all actions on its own, however, it will not do so by default. To have it automated, you need to append either "-a" or "--automated". The script will then install the "base package" with all default packages (such as Oracle's JDK 6).
But you can still also append the other flags, like "-e", "-s", "-j",...
Now, let's talk about Java. This script can install 3 Java versions: Oracle's JDK 6, openJDK 6 and openJDK 7. The default version is Oracle's JDK 6. You can change the version by either appending the "-j" or "--java" flag followed by the desired version (1, 2 or 3), or if the -a flag isn't triggered, the script will ask you about it.
What? You don't want to install/change java at all? No problem! Just append "--no-java" and Java will get completely skipped.
The same thing also happens to the SDK when appending "--no-sdk".
The script has been tested on (X)ubuntu 13.10 and 14.04 by @nilse and me, and on Arch Linux by @SMillerNL and me. However, I have only tested Oracle's JDK 6, no other java versions but according to the wiki pages, it should work just fine
You have suggestions, feedback, improvements? Shoot! Just let me know and I'll do my best to include it
A big thanks goes to my testers @nilse and @SMillerNL who also made some nice suggestions. But also to @GermainZ for his dev-host commandline tool
Furthermore to @eagleeyetom for giving me the idea
Thanks awesome work it will be helpfull i was looking for such thing yesterday XD you're best @laufersteppenwolf
The anykernel script doesn't work on newer devices with zImage-dtb right?
Doesn't look like it based on the script, but I've had trouble with the M8 DTB so figured I'd ask.
u saved my life thanks buddy i will try it !!!
Hi
Fits ics?
xboxfanj said:
The anykernel script doesn't work on newer devices with zImage-dtb right?
Doesn't look like it based on the script, but I've had trouble with the M8 DTB so figured I'd ask.
Click to expand...
Click to collapse
To be honest, I have no idea
I have only tested it on the 4x HD myself, but if you use all the same commands as the the ROM build process does (maybe also grab the needed files) it should work. I mean, it does exactly the same thing as when the ROM build packs the boot image, it puts the zImage and ramdisk into one file. Only anykernel does this on the device itself, rather than on your PC.
If you want, we can take a look into it together
Marília de Oliveira said:
Fits ics?
Click to expand...
Click to collapse
Sure, should work with all ROMs, just edit some stuff (like rom_version=11 to rom_version=9 when compiling CM) and it should work just fine
laufersteppenwolf said:
To be honest, I have no idea
I have only tested it on the 4x HD myself, but if you use all the same commands as the the ROM build process does (maybe also grab the needed files) it should work. I mean, it does exactly the same thing as when the ROM build packs the boot image, it puts the zImage and ramdisk into one file. Only anykernel does this on the device itself, rather than on your PC.
If you want, we can take a look into it together
Sure, should work with all ROMs, just edit some stuff (like rom_version=11 to rom_version=9 when compiling CM) and it should work just fine
Click to expand...
Click to collapse
How do I edit? Can you explain me better .. Thanks
Thanks a lot @lauferstppenwolf
Really takes the stress out of executing commands during my kernel compiles.
Marília de Oliveira said:
How do I edit? Can you explain me better .. Thanks
Click to expand...
Click to collapse
open in notepad or gedit or whatever and edit what u want
BTW does -j number of jobs should be for example "-j6" or "-j 6"?
Marília de Oliveira said:
How do I edit? Can you explain me better .. Thanks
Click to expand...
Click to collapse
It's quite simple, open the script with an editor (I personally like Geany) and edit the following lines:
Code:
ccache_dir=/home/laufersteppenwolf/ccache/CM11
ccache_log=/home/laufersteppenwolf/ccache/CM11/ccache.log
jobs_sync=30
jobs_build=20
rom=cm
rom_version=11
device_codename=p880
example:
You want to compile CM9 for the Nexus 5 (codename hammerhead) on a dual core CPU and your username (on your PC) is username:
Code:
ccache_dir=/home/[COLOR="Red"]username[/COLOR]/ccache/CM11
ccache_log=/home/[COLOR="red"]username[/COLOR]/ccache/CM11/ccache.log
jobs_sync=[COLOR="red"]5[/COLOR]
jobs_build=[COLOR="red"]3[/COLOR]
rom=cm
rom_version=[COLOR="red"]9[/COLOR]
device_codename=[COLOR="red"]hammerhead[/COLOR]
and you're already done Your script can now compile CM9 for the Nexus 5
laufersteppenwolf said:
It's quite simple, open the script with an editor (I personally like Geany) and edit the following lines:
Code:
ccache_dir=/home/laufersteppenwolf/ccache/CM11
ccache_log=/home/laufersteppenwolf/ccache/CM11/ccache.log
jobs_sync=30
jobs_build=20
rom=cm
rom_version=11
device_codename=p880
example:
You want to compile CM9 for the Nexus 5 (codename hammerhead) on a dual core CPU and your username (on your PC) is username:
Code:
ccache_dir=/home/[COLOR="Red"]username[/COLOR]/ccache/CM11
ccache_log=/home/[COLOR="red"]username[/COLOR]/ccache/CM11/ccache.log
jobs_sync=[COLOR="red"]5[/COLOR]
jobs_build=[COLOR="red"]3[/COLOR]
rom=cm
rom_version=[COLOR="red"]9[/COLOR]
device_codename=[COLOR="red"]hammerhead[/COLOR]
and you're already done Your script can now compile CM9 for the Nexus 5
Click to expand...
Click to collapse
I have done everything ... where else do I put the script?
Marília de Oliveira said:
I have done everything ... where else do I put the script?
Click to expand...
Click to collapse
just put it inside the root of your sources (the place where you have initiated the repo) and then run it using ". build.sh [flags]"
laufersteppenwolf said:
just put it inside the root of your sources (the place where you have initiated the repo) and then run it using ". build.sh [flags]"
Click to expand...
Click to collapse
Thanks ... Worked in xperia mini pro with ics :good:
gerciolisz said:
open in notepad or gedit or whatever and edit what u want
BTW does -j number of jobs should be for example "-j6" or "-j 6"?
Click to expand...
Click to collapse
Sry for the late reply, haven't seen it at all
it's "-j x", as it only listens to the things behind the actual flag
laufersteppenwolf said:
Sry for the late reply, haven't seen it at all
it's "-j x", as it only listens to the things behind the actual flag
Click to expand...
Click to collapse
thx after reading that script i know now i thought it is same like brunch/lunch -jx
Alright guys, a big update just found its way to github: a script to set up a complete build environment on Ubuntu and Arch-based distros.
If you want me to add support for another distro, please contact me either via PM or via IRC (#TeamFun or #p880-dev) and give me details on what must be changed (install command, packages, ...)
Also the kernel script got some updates, to abort the script if the kernel didn't compile and to copy the anykernel zip directly to dropbox to share it with your testers
Cheers
laufersteppenwolf said:
You want to compile CM9 for the Nexus 5 (codename hammerhead) on a dual core CPU and your username (on your PC) is username:
Code:
ccache_dir=/home/[COLOR="Red"]username[/COLOR]/ccache/CM11
ccache_log=/home/[COLOR="red"]username[/COLOR]/ccache/CM11/ccache.log
jobs_sync=[COLOR="red"]5[/COLOR]
jobs_build=[COLOR="red"]3[/COLOR]
rom=cm
rom_version=[COLOR="red"]9[/COLOR]
device_codename=[COLOR="red"]hammerhead[/COLOR]
Click to expand...
Click to collapse
couldnt you make the script universal by using $HOME?
Wow! Great job and well written... I'll be trying this on my old archserver box that I thought I would have to convert to Ubuntu because I couldn't get all the required packages configured correctly. Looking over your scripts you've touched it all!
Thanks a bunch for the scripts, especially the env-setup one. I'll test it one of these days in Manjaro.
However, env-setup/setup.sh has a small bug: after running the script in LM16 (build environment already set up) it wants to reinstall Java no matter which flag is given.
Also, it doesn't detect installed SDK for some reason.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

[CLOSED][SCRIPT][LINUX] Mount System as read write (Android 10+)

This Linux-only version is pretty much deprecated at this point. Please use the BRAND NEW UNIVERSAL VERSION instead! Thank you.
Ladies and gentlemen. Let me present to you my very first release here at the XDA forums:
Welcome to:
makeSystemRW v1.04
automated bash script by lebigmac for Android 10 and above​Creation date: February 2021
Updated: March 2021
Requirements:​
LINUX ONLY!
Android 10 or newer
This version only supports devices with super image.
Check if you have super by running ls -Alg /dev/block/by-name
phone must be rooted + bootloader unlocked + 10 GB free space on phone
at least 20 GB free space on computer for dumping data
adb and fastboot commands should be in your $PATH environment variable
I'm not 100% sure if this is a necessary requirement but I also disabled dm-verity and verification on my device just in case by simply booting into TWRP and then executing these 2 commands:
Code:
adb disable-verity
adb shell avbctl disable-verification
Description: A script for all Android power users that wish to make their read-only Android 10+ system read-write-able again to remove bloatware and make more thorough customizations to their device.
In a nutshell this is what the script is doing:
dumps your existing super image to your pc
extracts the embedded read-only partitions (system, vendor, product, etc...)
makes these partitions read-write-able
joins everything back together to new flashable super.img
flashes it to device
User data is not affected.
Usage: Simply call the script from the shell.
Optional arguments (replace x with your custom value) :
in=x : With this flag you can specify an existing super.img and skip the entire dumping of the super image process. Here you can use the super_original.img which you dumped earlier with makesysrw or the official super.img from your downloaded firmware. You probably have to unsparse the official super.img first using the included simg2img tool for superunpack to recognize it properly. If omitted, makesysrw will dump super image from phone to ./super_original.img
out=x : With this argument you can specify the output path. If omitted, default output value is ./super_fixed.img
size=x : With this parameter you can specify the extra free space (in megabytes) that will be added to each partition. If omitted, default extra size is 0 (shrink to minimum)
Examples:
Code:
# Run this command if you're first time user:
# Specify the extra free space in megabytes for each partition:
./makesysrw.sh size=100
# Plug an existing raw super image into the script like this:
./makesysrw.sh in=./super_original_raw.img size=100
# Specify both the input file as well as the output destination:
./makesysrw.sh in=./super_original_raw.img out=./super_fixed.img size=100
# For unsparsing the (sparse) super.img from your phone manufacturer's firmware you can do:
./tools/bin/simg2img ./super_sparse.img ./super_raw.img
NOTE: I did not come up with all this by myself. After searching for a solution for countless days without success, going even as far as learning hex editing - I coincidentally came across a couple of very interesting threads burried deep inside the new forum interface where this technique has been described and discussed by various enthousiasts (links can be found below in the credits section). So I take absolutely no credit for the underlying core mechanisms of the script. I'm only the amateur who put it all together into a compact script so that everybody can enjoy an Android system that's read-write-able again. Just like it used to be in Android 9 or earlier. Before this annoying 'shared_blocks feature' was implemented.
Credits: Big thanks to @munjeni for allowing me to use his amazing superunpack tool instead of the default lpunpack. Source code can be found here.
Also big thanks to @Brepro1 without your awesome tutorial guiding me I couldn't have created this script.
Thanks @AndyYan your interesting thread also helped me a lot for automating the script especially the lpdump part.
More thanks @gabrielfrias for his helpful comment
Thanks @YOisuPU and of course @topjohnwu for discovering the 'shared_blocks feature'
Thanks @bynarie for making available his otatools package! A part of it is now bundled with the archive
Disclaimer: This is open source software and is provided as is without any kind of warranty or support whatsoever. By using and viewing this software you agree to the following terms:
Under no circumstances shall the author be held responsible for any damages or negative consequences that may arrise from the (inappropriate) use of this software.
All responsibility and liability lies with the end-user. You hereby agree not to abuse this software for illegal purposes. Use this software at your own risk!
Please feel free to improve this script as you see fit (as long as you don't add anything malicious)
and make sure to post your feedback, suggestions and improvements in the official thread right here.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Mod Edit: Download link removed
Please click my like button below if you like it! Thanks​
It would be very helpful if you guys could please give me some feedback if the script works for you.
Which device are you using?
Your Android version?
Did you disable dm-verity and verification before running the script?
Your suggestions to enhance the script. Remember this is only version 1.0
Thanks!
@thor_1979
Great work! Your donation to the developers community is awesome.
The script works perfectly.
Consider keeping going.
Are you serious it actually works on your device? lmao
Congratulations. You are the first person to try it
The script pretty much does the same thing as your awesome tutorial describes.
Without your tutorial this script would not exist so thank you very much for making it available!
How do I use it? I'm really wanting to make my system rw again and this is perfect but how do I use it? It's a tar and Xz?
Simply extract the downloaded archive and open a terminal shell in the extracted folder by right clicking inside it and select Open in Terminal
Then run this command if you're running it for the first time
Code:
./makesysrw.sh size=100
or this command if you already have your raw super.img file
Code:
./makesysrw.sh in=./existing_super_image.img size=100
If you can't launch the script file make sure it is executable on your computer.
I really don't understand how this works why do you need the storage space is it making a system img that you than flash? I thought it just makes the current system read writable so you can install and uninstall system apps.
lebigmac said:
Simply extract the downloaded archive and open a terminal shell in the extracted folder by right clicking inside it and select Open in Terminal
Then run this command if you're running it for the first time
Code:
./makesysrw.sh
or this command if you already have your super.img file
Code:
./makesysrw.sh existing_super_image.img
If you can't launch the script file make sure it is executable on your computer.
Click to expand...
Click to collapse
Thanks I'm supposed to run the shell from my pc terminal or on the android device?
Sorry I see its for linux users. Ok now im getting it I have ubuntu 14 on my hard drive but I need to reinstall the grub menu because I deleted it or something. I have a s10 lite and tab S6 I would love to make the writable on the system so does this make a backup or dump of your system and than you flash it? Do you guys think thatll work on one ui 2.5 and im on lineage 18.1 on my s10 lite
Well in a nutshell this is what the script is doing:
dumps your existing super image to your pc
extracts the embedded read-only partitions (system, vendor, product, etc...)
makes these partitions read-write-able
joins everything back together to new flashable super.img
flashes it to device
User data is not affected.
The script is telling you exactly what's happening under the hood. You can also check out the source code if you have any doubts.
Yes this version of the script is supposed to be run on a Linux computer.
Please report back if it works for you or not.
Lineage OS? Doesn't that have a read-write-able system by default? In that case the script will likely fail.
Please keep in mind this script has been developed on Android 10 (Xiaomi X3 NFC) with a system that's read-only.
lebigmac said:
Well in a nutshell the script dumps your existing super image to your pc.
And then modifies the files to make everything read write able and then flashes back to the device. User data is not affected.
The script is telling you exactly what's happening under the hood. You can also check out the source code if you have any doubts.
Yes the script is supposed to be run on the computer
Please report back if it works for you or not.
Lineage OS? Doesn't that already come with read-write-able system by default? In that case the script will likely fail.
Please keep in mind this script has been developped on Android 10 MIUI 12 (Xiaomi X3 NFC) with a system that's read-only and embedded in a super image.
Click to expand...
Click to collapse
Honestly Im not a 100 percent sure anymore. I know it's a super img and it's really different in twrp there's a ton of new partitions and you have to wipe it off completely to flash a new system. I really haven't dug to deep into everything because I know that S6 oneui isn't writable and actually upset me because it's not like having full root access anymore.
For Windows users with TWRP.
(This is more like a reference)
From adb shell inside twrp.
X = Partition. To find out what block partition is mounted at, mount it in twrp then run 'df -h'.
e2fsck -f /dev/block/dm-x
resize2fs /dev/block/dm-x 3G
e2fsck -E unshare_blocks /dev/block/dm-x
Now reboot to fastbootd and execute:
fastboot resize-logical-partition <partition_slot> $((3*1024*1024*1024))
Thank you for the script.
When I read that I could use it with the super.img I guessed the usage was like
./makesysrw.sh image.img super_edited.img
I have a linux partition, but on a remote server and I was hoping to use it on the file and get my edited file from the server without putting the phone in the server..
Let me knowif you add something like that(-i and -o flags will be useful)
Best
Lossyx said:
For Windows users with TWRP.
(This is more like a reference)
From adb shell inside twrp.
X = Partition. To find out what block partition is mounted at, mount it in twrp then run 'df -h'.
e2fsck -f /dev/block/dm-x
resize2fs /dev/block/dm-x 3G
e2fsck -E unshare_blocks /dev/block/dm-x
Now reboot to fastbootd and execute:
fastboot resize-logical-partition <partition_slot> $((3*1024*1024*1024))
Click to expand...
Click to collapse
As much as I wish for a solution to be available to our fellow Windows users,
unfortunately your suggestion doesn't work here on my device see screenshot below.
lebigmac said:
As much as I wish for a solution to be available to our fellow Windows users,
unfortunately your suggestion doesn't work here on my device see screenshow below.
View attachment 5236719
Click to expand...
Click to collapse
Yeah. These dynamic partitions are weird, because for some reason I only managed to do this on slot A. And only did it on the vendor partition.
Also, this is the reference i was going by;
https://twitter.com/i/web/status/1260577424418488324
lebigmac said:
As much as I wish for a solution to be available to our fellow Windows users,
unfortunately your suggestion doesn't work here on my device see screenshow below.
View attachment 5236719
Click to expand...
Click to collapse
I think the problem is that you are requesting too large amount of memory try to replace 3G with smaller amount of memory
If anybody is good with creating flashable zips contact me! Need help working on universal version right now which will also be compatible with Windows and Mac users!
I am only amateur so need a real pro to give me some assistance here. Thank you.
Redmi note 9 pro. EU 12.0.2 rom. Android 10. It works. I installed WMware Workstation on a virtual machine in Windows. Thanks.(Google translate, sorry)
I can confirm that it works pềctly on my Pixel 4 XL Android 11 (coral-rq2a.210305.006) and Android 10 (coral-qq3a.200805.001), thank you for your awesome hard work!
Tried it on my Oneplus 7T Pro with Android 10. It extracted the superimage but failed at writing it back. It returned this error:
Code:
error: file_write: write: No space left on device
lpmake E 03-02 21:41:55 76867 76867 images.cpp:468] [liblp]sparse_file_write failed with code: -1
lpmake E 03-02 21:41:55 76867 76867 images.cpp:326] [liblp]Could not open image for partition: product_a
makesysrw: Error! failed to create super_fixed.img file./makesysrw.sh super_image.img 14.21s user 37.28s system 51% cpu 1:40.46 total
Any ideas? Thank you for your great work!

Categories

Resources