FORUMS
Remove All Ads from XDA

[TOOLS][ZIPS][SCRIPTS] osm0sis' Odds and Ends [Multiple Devices/Platforms]

13,596 posts
Thanks Meter: 29,909
 
By osm0sis, Recognized Developer / Recognized Contributor on 18th April 2013, 12:37 AM
Post Reply Email Thread
27th August 2013, 07:13 PM |#101  
nicesoni_ash's Avatar
Senior Member
Flag ....
Thanks Meter: 10,946
 
Donate to Me
More
Hi,

I am using an s3 (4.2) cm based rom. I am interested in ur sd card adbsync backup script. I tried to download the required files from your provided links, but first one has a dead link for that zip and second has too many files and confusing. Can you please provide a zip of urs somewhere with all needed exes included. Thanks.


_____________
Sent from my GT-I9300 powered by 7000mAh ZeroLemon Battery
Fueled by Temasek Rom & Kernel
 
 
28th August 2013, 02:44 PM |#102  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 29,909
 
Donate to Me
More
Quote:
Originally Posted by nicesoni_ash

I am using an s3 (4.2) cm based rom. I am interested in ur sd card adbsync backup script. I tried to download the required files from your provided links, but first one has a dead link for that zip and second has too many files and confusing. Can you please provide a zip of urs somewhere with all needed exes included. Thanks.

Yeah I'm thinking about getting around to that now that adbsync has changed threads. Just gotta find the time to test the new version to see if I can safely remove some of the workarounds I had in place/clean it up.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
31st August 2013, 08:15 PM |#103  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 29,909
 
Donate to Me
More
Quote:
Originally Posted by chrone

Out of topic and dumb question from me, when will the bootlocker script work on adb sideloading in stock recovery?

Would love to have that if it's possible.

Thanks for the great scripts!

That's an interesting idea. I've never bothered signing my zips since custom recoveries don't require it. I know PhilZ has managed to get his temp recovery zip to run on stock Samsung GS2 recovery so, while efrant is likely correct, I'll look into it a bit more and see if I can figure something out before I release the new version next week.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
4th September 2013, 03:18 PM |#104  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 29,909
 
Donate to Me
More
Must be some flaw in the Samsung recovery that PhilZ is exploiting, since I even tried piggybacking mine into an OTA zip and it just fails "whole file verification" after passing the initial file verification.

My guess is Samsung's GS2 one doesn't check whole-file or something. Anyway, as efrant thought, no-can-do for stock recovery, so I'm uploading my unsigned combined Nexus BootUnlocker to the OP now and will edit the OP as I go.

It detects what device you're using and if it's a GN, N4 or N10 proceeds to determine the lockstate and un/lock it. It displays the device name and bootloader version to help prevent user-errors and also does this if it's an unsupported device. If it detects a N7 2012 (also unsupported) it displays a link to my N7 BootUnlocker Script zip thread which is the only similar option available for that device.

Download stats for the previous separate versions:
GN - 94
N4 - 54
N10 - 34
The Following 3 Users Say Thank You to osm0sis For This Useful Post: [ View ]
4th September 2013, 03:37 PM |#105  
chrone's Avatar
Senior Member
Flag Surabaya
Thanks Meter: 398
 
More
Thumbs up
Quote:
Originally Posted by osm0sis

Must be some flaw in the Samsung recovery that PhilZ is exploiting, since I even tried piggybacking mine into an OTA zip and it just fails "whole file verification."

My guess is Samsung's GS2 one doesn't check whole-file or something. Anyway, as efrant thought, no-can-do for stock recovery, so I'm uploading my unsigned combined Nexus BootUnlocker to the OP now and edit it as I go.

It detects what device you're using and if it's a GN, N4 or N10 proceeds to determine the lockstate and un/lock it. It displays the device name and bootloader version to help prevent user-errors and also does this if it's an unsupported device. If it detects a N7 2012 (also unsupported) it displays a link to my N7 BootUnlocker Script zip thread which is the only similar option available for that device.

Download stats for the previous separate versions:
GN - 94
N4 - 54
N10 - 34

thanks for trying it out, dude! downloading right now. hehe
The Following User Says Thank You to chrone For This Useful Post: [ View ] Gift chrone Ad-Free
21st September 2013, 08:07 PM |#106  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 29,909
 
Donate to Me
More
ADB Screenshot for GN v1.3 up in the OP. A minor update, slimmed down the zip slightly by using a recent stable version of ffmpeg instead of a nightly, also included the credits.txt to better explain where I got the binaries involved (ffmpeg, mogrify, and a version of adb that doesn't leave files behind in your %UserProfile% folder). Previous version (v1.2) had 70 downloads.


Also, long requested..
ADBsync sdcard Backup is now a standalone package and up in the OP.

v1.0 and v2.0 have a lot of advancements over the old batch file code I posted. Much credit and thanks to @Renate NST for continuing to develop the adbsync utility my batch script is built upon, resolving a number of issues which have allowed my script to become more robust (including the ones where files would get pushed to the root of the working Host drive, and where not all host-only directories would get reported). All you require in addition to the package are Windows ADB/Fastboot drivers: http://forum.xda-developers.com/show....php?t=1379875
  • Self-contained; unzip anywhere and run the batch file to have it create an initial backup of your sdcard while connected via adb to your custom recovery or USB Debugging.
  • Automatically detects outdated included ADB files and updates them from Google's platform-tools-latest repo.
  • Supports ADB over WiFi if your device is set up for this (a "Wi-Fi ADB" app may help you if your ROM doesn't have settings for it). To enable it just edit the batch file and add your device's LAN IP from your home network to the connectIP= variable.
  • After the initial backup, running the batch file synchronizes to host-side, pulling new files from the Android to the Host and removing files/directories from the Host that are now gone on the Android.
  • If you make a fresh nandroid before each sync then this actually results in having a complete snapshot of your device for that moment in time.
  • Logs any remaining differences (host or android side) to backup.log during each sync. The host side only differences get cleaned up, as mentioned above.
  • Customizable; defaults to target /storage/emulated when booted to Android and not adb root shell, otherwise it is /data/media to support internal sdcard devices (most devices), but you can easily edit the batch file and change the variable mountPoint=/data/media at the top to the appropriate directory to access your sdcard (no symlinks, try to use the actual mount, eg. /storage/sdcard0 on the Galaxy S2 GT-i9100).
  • If root is not detected (i.e. booted and on USB Debugging without adb root shell) and using the default targets, automatically changes mountPoint using detected current user # and uses this to make the correct subdirectory under the local sdcard backup folder so it may also be synchronized from recovery.
  • Since Windows has a path length limit significantly shorter than that of Linux, if you run into an issue with the sync halting when the resulting path is too long you may add the offending Android sdcard path to longfilenames-zip-list.ini, the batch file will push a .noadbsync file to entered directories to ignore them during the sync, then zip the paths and pull down sdcard-longfilenames.zip. If you don't require this you can safely delete the .ini file.
  • If you want to ignore any other whole directories you may add them to directory-ignore-list.ini, which will create .noadbsync files in them on the Android side (but not zip them) as above. You may safely delete the .ini file if you don't require this. To ignore or include only specific filenames you can edit the batch file and change the ignorePattern= and/or onlyPattern= variables at the top. Pattern only (ie. no /i or /o required like there would be for the adbsync commandline), wildcards accepted. More info on what the patterns can be and examples on how to use them in the adbsync thread.

A credits.txt is also included to link to adbsync, the GNUWin32 utils and Android Info-Zip binary in use.


Note: If ever restoring a sdcard backup to your device with adb push, you'll want to use my sdcard Fix Permissions Script Zip afterwards to avoid some problems that can arise from adb push setting root:root owner/group and full 777 (rwxrwxrwx) permissions to files.

Previous download count: v1.1 - 8444.
The Following 12 Users Say Thank You to osm0sis For This Useful Post: [ View ]
25th September 2013, 01:07 AM |#107  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 29,909
 
Donate to Me
More
Shell script is awesome.

I just took the most convoluted EDIFY script, my latest combined Nexus BootUnlocker Script zip -- which to support 3 devices had to be a nest of EDIFY ifelse logic so deep that the thought of adding support for yet another device was giving me nightmares -- and with a few tricks from good old Chainfire, turned it into a shell script with variables to make device addition a breeze, remove all the redundancies, and that works with the recovery UI if you replace the update-binary with it.

Let's compare.

cwm-Nexus.BootUnlocker-EDIFY.zip/META-INF/com/google/android/updater-script:
Code:
ui_print("");
ui_print("Nexus BootUnlocker Script");
ui_print("by osm0sis @ xda-developers");
ui_print("");

ui_print("For GN, N4 and N10 bootloaders ONLY");
show_progress(1.34, 0);

ui_print("");
ui_print("Verifying device...");
run_program("/sbin/busybox", "mount", "/system");
ifelse(getprop("ro.product.device") == "maguro" || getprop("ro.build.product") == "maguro" ||
       getprop("ro.product.device") == "toro" || getprop("ro.build.product") == "toro" ||
       getprop("ro.product.device") == "toroplus" || getprop("ro.build.product") == "toroplus",
  (ui_print("Galaxy Nexus: ", getprop("ro.product.device"));
   ui_print("Bootloader: ", getprop("ro.bootloader"));
   set_progress(0.4);
   ui_print("");
   ui_print("Checking bootloader status...");
   ifelse(run_program("/sbin/sh", "-c", "test `dd ibs=1 count=1 skip=124 obs=1 if=/dev/block/platform/omap/omap_hsmmc.0/by-name/param 2> /dev/nul | /sbin/busybox od -h | /sbin/busybox head -n 1 | /sbin/busybox cut -c 13-` = '0001'") == 0,
     (ui_print("Bootloader is locked.");
      ui_print("");
      ui_print("Unlocking...");
      assert(run_program("/sbin/sh", "-c", "echo -ne '\\x00' | dd obs=1 count=1 seek=124 of=/dev/block/platform/omap/omap_hsmmc.0/by-name/param"));
     ),
     (ifelse(run_program("/sbin/sh", "-c", "test -z `dd ibs=1 count=1 skip=124 obs=1 if=/dev/block/platform/omap/omap_hsmmc.0/by-name/param 2> /dev/nul | /sbin/busybox od -h | /sbin/busybox head -n 1 | /sbin/busybox cut -c 13-`") == 0,
        (ui_print("Bootloader is unlocked.");
         ui_print("");
         ui_print("Locking...");
         assert(run_program("/sbin/sh", "-c", "echo -ne '\\x01' | dd obs=1 count=1 seek=124 of=/dev/block/platform/omap/omap_hsmmc.0/by-name/param"));
        ),
        (ui_print("Status does not match known values.");
         ui_print("This is not the intended device or bootloader.");
         ui_print("");
         ui_print("Your system has not been changed.");
         ui_print("");
         ui_print("Script will now exit...");
         ui_print("");
         unmount("/system");
         abort();
        )
      );
     )
   );
  ),
  (ifelse(getprop("ro.product.device") == "mako" || getprop("ro.build.product") == "mako",
     (ui_print("Nexus 4: ", getprop("ro.product.device"));
      ui_print("Bootloader: ", getprop("ro.bootloader"));
      set_progress(0.4);
      ui_print("");
      ui_print("Checking bootloader status...");
      ifelse(run_program("/sbin/sh", "-c", "test -z `dd ibs=1 count=1 skip=16400 obs=1 if=/dev/block/platform/msm_sdcc.1/by-name/misc 2> /dev/nul | /sbin/busybox od -h | /sbin/busybox head -n 1 | /sbin/busybox cut -c 13-`") == 0,
        (ui_print("Bootloader is locked.");
         ui_print("");
         ui_print("Unlocking...");
         assert(run_program("/sbin/sh", "-c", "echo -ne '\\x01' | dd obs=1 count=1 seek=16400 of=/dev/block/platform/msm_sdcc.1/by-name/misc"));
        ),
        (ifelse(run_program("/sbin/sh", "-c", "test `dd ibs=1 count=1 skip=16400 obs=1 if=/dev/block/platform/msm_sdcc.1/by-name/misc 2> /dev/nul | /sbin/busybox od -h | /sbin/busybox head -n 1 | /sbin/busybox cut -c 13-` = '0001'") == 0,
           (ui_print("Bootloader is unlocked.");
            ui_print("");
            ui_print("Locking...");
            assert(run_program("/sbin/sh", "-c", "echo -ne '\\x00' | dd obs=1 count=1 seek=16400 of=/dev/block/platform/msm_sdcc.1/by-name/misc"));
           ),
           (ui_print("Status does not match known values.");
            ui_print("This is not the intended device or bootloader.");
            ui_print("");
            ui_print("Your system has not been changed.");
            ui_print("");
            ui_print("Script will now exit...");
            ui_print("");
            unmount("/system");
            abort();
           )
         );
        )
      );
     ),
     (ifelse(getprop("ro.product.device") == "manta" || getprop("ro.build.product") == "manta",
        (ui_print("Nexus 10: ", getprop("ro.product.device"));
         ui_print("Bootloader: ", getprop("ro.bootloader"));
         set_progress(0.4);
         ui_print("");
         ui_print("Checking bootloader status...");
         ifelse(run_program("/sbin/sh", "-c", "test -z `dd ibs=1 count=1 skip=548 obs=1 if=/dev/block/platform/dw_mmc.0/by-name/param 2> /dev/nul | /sbin/busybox od -h | /sbin/busybox head -n 1 | /sbin/busybox cut -c 13-`") == 0,
           (ui_print("Bootloader is locked.");
            ui_print("");
            ui_print("Unlocking...");
            assert(run_program("/sbin/sh", "-c", "echo -ne '\\x01' | dd obs=1 count=1 seek=548 of=/dev/block/platform/dw_mmc.0/by-name/param"));
           ),
           (ifelse(run_program("/sbin/sh", "-c", "test `dd ibs=1 count=1 skip=548 obs=1 if=/dev/block/platform/dw_mmc.0/by-name/param 2> /dev/nul | /sbin/busybox od -h | /sbin/busybox head -n 1 | /sbin/busybox cut -c 13-` = '0001'") == 0,
             (ui_print("Bootloader is unlocked.");
              ui_print("");
              ui_print("Locking...");
              assert(run_program("/sbin/sh", "-c", "echo -ne '\\x00' | dd obs=1 count=1 seek=548 of=/dev/block/platform/dw_mmc.0/by-name/param"));
             ),
             (ui_print("Status does not match known values.");
              ui_print("This is not the intended device or bootloader.");
              ui_print("");
              ui_print("Your system has not been changed.");
              ui_print("");
              ui_print("Script will now exit...");
              ui_print("");
              unmount("/system");
              abort();
             )
            );
           )
         );
        ),
        (ifelse(getprop("ro.product.device") == "grouper" || getprop("ro.build.product") == "grouper" ||
                getprop("ro.product.device") == "tilapia" || getprop("ro.build.product") == "tilapia",
           (ui_print("Nexus 7: ", getprop("ro.product.device"));
            ui_print("Bootloader: ", getprop("ro.bootloader"));
            ui_print("");
            ui_print("Unsupported device.");
            ui_print("For N7 BootUnlocker Script go to http://v.ht/N7BU");
           ),
           (ui_print("Device: ", getprop("ro.product.device"));
            ui_print("Bootloader: ", getprop("ro.bootloader"));
            ui_print("");
            ui_print("Unsupported device.");
           )
         );
         set_progress(0.4);
         ui_print("");
         ui_print("Your system has not been changed.");
         ui_print("");
         ui_print("Script will now exit...");
         ui_print("");
         unmount("/system");
         abort();
        )
      );
     )
   );
  )
);
set_progress(0.9);

unmount("/system");
ui_print("Done!");
set_progress(1.34);
144 lines, 6741 bytes.

And...

cwm-Nexus.BootUnlocker.zip/META-INF/com/google/android/update-binary:
Code:
#!/sbin/sh
# Nexus BootUnlocker Script: Recovery Flashable Zip
# osm0sis @ xda-developers

OUTFD=$2;
ui_print() {
  echo -ne "ui_print $1\n" > /proc/self/fd/$OUTFD;
  echo -ne "ui_print\n" > /proc/self/fd/$OUTFD;
}
show_progress() { echo "progress $1 $2" > /proc/self/fd/$OUTFD; }
set_progress() { echo "set_progress $1" > /proc/self/fd/$OUTFD; }
abort() {
  ui_print " ";
  ui_print "Your system has not been changed.";
  ui_print " ";
  ui_print "Script will now exit...";
  ui_print " ";
  umount /system;
  exit 1;
}

ui_print " ";
ui_print "Nexus BootUnlocker Script";
ui_print "by osm0sis @ xda-developers";
ui_print " ";
ui_print "For GN, N4 and N10 bootloaders ONLY";
show_progress 1.34 0;

ui_print " ";
ui_print "Verifying device...";
/sbin/busybox mount /system;
set_progress 0.2;
device=`getprop ro.product.device`;
bootloader=`getprop ro.bootloader`;
if [ $device == "maguro" -o $device == "toro" -o $device == "toroplus" ]; then
  ui_print "Galaxy Nexus: $device";
  block=/dev/block/platform/omap/omap_hsmmc.0/by-name/param;
  offset=124;
  locked=01;
  unlocked=00;
elif [ $device == "mako" ]; then
  ui_print "Nexus 4: $device";
  block=/dev/block/platform/msm_sdcc.1/by-name/misc;
  offset=16400;
  locked=00;
  unlocked=01;
elif [ $device == "manta" ]; then
  ui_print "Nexus 10: $device";
  block=/dev/block/platform/dw_mmc.0/by-name/param;
  offset=548;
  locked=00;
  unlocked=01;
else
  test -z $device && device=unknown;
  test -z $bootloader && bootloader=unknown;
  test $device == "grouper" -o $device == "tilapia" && ui_print "Nexus 7 (2012): $device" || ui_print "Device: $device";
  ui_print "Bootloader: $bootloader";
  ui_print " ";
  ui_print "Unsupported device.";
  test $device == "grouper" -o $device == "tilapia" && ui_print "For N7'12 BootUnlocker Script go to http://v.ht/N7BU";
  abort;
fi;
ui_print "Bootloader: $bootloader";
set_progress 0.4;

ui_print " ";
ui_print "Checking bootloader status...";
lockstate=`dd ibs=1 count=1 skip=$offset obs=1 if=$block 2> /dev/nul | /sbin/busybox od -h | /sbin/busybox head -n 1 | /sbin/busybox cut -c 15-`;
test -z $lockstate && lockstate=00;
set_progress 0.6;
if [ $lockstate == $locked ]; then
  ui_print "Bootloader is locked.";
  ui_print " ";
  ui_print "Unlocking...";
  setstate=$unlocked;
elif [ $lockstate == $unlocked ]; then
  ui_print "Bootloader is unlocked.";
  ui_print " ";
  ui_print "Locking...";
  setstate=$locked;
else
  ui_print "Status does not match known values.";
  ui_print "This is not the intended device or bootloader.";
  abort;
fi;
set_progress 0.8;

echo -ne "\x$setstate" | dd obs=1 count=1 seek=$offset of=$block;
set_progress 1.0;

umount /system;
set_progress 1.2;
ui_print "Done!";
set_progress 1.34;
exit 0;
97 lines, 2730 bytes.

Plus since it removes the need for an actual update-binary (~221 kB+), it reduces the size of the zip from 145 kB down to 2 kB. Haha. Take that, Google.

I also realized that with the old one I have uploaded, on the N10 it'll display "Nexus 4: manta" by mistake. It works correctly but that typo could be scary for some manta users. Anyway, the old can stay up for now, since I want to add support for the Nexus 7 2013 (flo/deb), if possible, before I release this one, but we need volunteers: http://forum.xda-developers.com/show...731993&page=25

If you've got an unlocked new N7 please lend a hand.
The Following 5 Users Say Thank You to osm0sis For This Useful Post: [ View ]
25th September 2013, 05:23 AM |#108  
russellvone's Avatar
Senior Member
Flag Gilmer
Thanks Meter: 852
 
Donate to Me
More
Edit: wrong thread.
27th September 2013, 09:40 AM |#109  
WastedJoker's Avatar
Senior Member
Thanks Meter: 125
 
More
The cwm perm fix - it mentions /data/media sdcard path - does this differ from HTC one sdcard path?
27th September 2013, 04:43 PM |#110  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 29,909
 
Donate to Me
More
Quote:
Originally Posted by WastedJoker

The cwm perm fix - it mentions /data/media sdcard path - does this differ from HTC one sdcard path?

I don't own a HTC One; you tell me?
28th September 2013, 05:48 PM |#111  
WastedJoker's Avatar
Senior Member
Thanks Meter: 125
 
More
Quote:
Originally Posted by osm0sis

I don't own a HTC One; you tell me?

Well I just don't know what controls the path - it seems like it changes!
Post Reply Subscribe to Thread

Tags
automation, batch, flashable zip, script, tool

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes