FORUMS
Remove All Ads from XDA

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

13,643 posts
Thanks Meter: 30,090
 
By osm0sis, Recognized Developer / Recognized Contributor on 18th April 2013, 12:37 AM
Post Reply Email Thread
22nd January 2016, 01:35 PM |#501  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,090
 
Donate to Me
More
Thanks Captain_Throwback! This testing with readlink stuff is new to me, but I worked through it in adb shell and it makes enough sense to me now that I adapted the above to the rest of my usual script so the latter changes aren't necessary. No real functional changes necessary as you can see.

Code:
# embedded mode support
readlink /proc/$$/fd/$2 2>/dev/null | grep /tmp >/dev/null;
if [ "$?" -eq "0" ]; then
  # rerouted to log file, so suppress recovery ui commands
  OUTFD=/proc/self/fd/0;
  # try to find the actual fd (pipe with parent updater likely started as 'update-binary 3 fd zipfile')
  for FD in `ls /proc/$$/fd`; do
    readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null;
    if [ "$?" -eq "0" ]; then
      ps | grep " 3 $FD " | grep -v grep >/dev/null;
      if [ "$?" -eq "0" ]; then
        OUTFD=/proc/self/fd/$FD;
        break;
      fi;
    fi;
  done;
fi;

ui_print() { echo -e "ui_print $1\nui_print" >> $OUTFD; }
show_progress() { echo "progress $1 $2" >> $OUTFD; }
set_progress() { echo "set_progress $1" >> $OUTFD; }
I did touch up Chainfire's new su.img loop mount script more to my liking though and made sure it all works with CMR's toybox implementation (as I'm sure was also his main concern with it), as well as saves us a few steps if we're using a more sensible recovery like TWRP:
Code:
mount /data;
mount /cache;
suimg=$(ls /cache/su.img /data/su.img 2>/dev/null);
if [ "$suimg" ]; then
  umount /su;
  test ! -e /su && mkdir /su;
  mount -t ext4 -o rw,noatime $suimg /su;
  for i in 0 1 2 3 4 5 6 7; do
    case `mount` in
      *" /su "*) break;;
    esac;
    loop=/dev/block/loop$i;
    mknod $loop b 7 $i;
    if [ ! -f "$loop" -o ! -b "$loop" ]; then
      mknod $loop b 7 $i;
    fi;
    losetup $loop $suimg && mount -t ext4 -o loop $loop /su;
  done;
  test -d /su/xbin && target=/su/xbin || target=/su/bin;
else
  mount -o rw,remount /system;
  target=/system/xbin;
fi;
Just reviewing and making the mount changes on my adb and nano installers then I'll have all 3 updated.
The Following 4 Users Say Thank You to osm0sis For This Useful Post: [ View ]
 
 
22nd January 2016, 02:17 PM |#502  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,090
 
Donate to Me
More
OP updated!

UPDATE-Busybox.Installer.v1.24.1-ALL-signed.zip;
UPDATE-adb.Installer.v1.0.26-signed.zip;
UPDATE-nano.Terminal.Editor.v2.5.0-signed.zip:

- add support for Cyanogen(Mod) Recovery's implementation of toybox for mount and adapt @Chainfire's method for systemless root (su.img) loop mount support
- fix systemless root (su.img) detection support when both /data and /cache don't start mounted (like in CMR)

The busybox installer now uses the much less convoluted "busybox --list" command for the applet list to generate the symlinks, and of course the previously mentioned embedded flashing support for use in ROM kitchens, etc. Thanks @Captain_Throwback & @Chainfire.

Note: These are only installer fixes. If these installed fine for you already, there's no need to reflash; there aren't any updates to the binaries.
The Following 17 Users Say Thank You to osm0sis For This Useful Post: [ View ]
22nd January 2016, 03:49 PM |#503  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,090
 
Donate to Me
More
And the addition of my latest big project!

APK-Patcher (many devices) - link
Simplifies APK modification to make it easier for modification creators to keep creating. Using @JesusFreke's brilliant bak/smali and @iBotPeaches' excellent apktool, modified to run on-device along with the various binaries required, allows on-the-fly APK modifications to be applied via recovery, to whatever ROM APK is present, taking the constant update burden off of the modification creator. The zip is smart and automated, using the APK name to run all the various parts involved for complicated patches and is extensible to any number of APKs in a single zip.

Okay, no more updates for a little while. Everybody stop breaking things.
The Following 23 Users Say Thank You to osm0sis For This Useful Post: [ View ]
25th January 2016, 12:01 PM |#504  
out386's Avatar
Senior Member
Thanks Meter: 91
 
More
You are amazing. Hats off!
The Following User Says Thank You to out386 For This Useful Post: [ View ] Gift out386 Ad-Free
30th January 2016, 11:37 PM |#505  
Senior Member
Flag Gelnica
Thanks Meter: 345
 
More
@osm0sis hey, could you tell me which one from gappsintegrator should i use on nexus 5X stock android 6, rooted systemlessly, i tried one from second post, but i got bootlop.
The Following User Says Thank You to domicq For This Useful Post: [ View ] Gift domicq Ad-Free
31st January 2016, 02:08 AM |#506  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,090
 
Donate to Me
More
Quote:
Originally Posted by domicq

@osm0sis hey, could you tell me which one from gappsintegrator should i use on nexus 5X stock android 6, rooted systemlessly, i tried one from second post, but i got bootlop.

Why would you want to use gappsintegrator on a Nexus 5X running Stock ROM? It'll modify system, breaking the OTA-receiving ability you retained by using systemless root. And yeah, also fully untested and experimental on Marshmallow; there are oddities GApps developers are still only just discovering with Marshmallow not allowing app permissions to be granted after the initial ROM boot.
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
31st January 2016, 06:49 AM |#507  
Senior Member
Flag Gelnica
Thanks Meter: 345
 
More
Quote:
Originally Posted by osm0sis

Why would you want to use gappsintegrator on a Nexus 5X running Stock ROM? It'll modify system, breaking the OTA-receiving ability you retained by using systemless root. And yeah, also fully untested and experimental on Marshmallow; there are oddities GApps developers are still only just discovering with Marshmallow not allowing app permissions to be granted after the initial ROM boot.

Because of wasting space on /data with system-app updates and Titanium Backup or L*****r makes some of updated apps functionless. I don't care about OTAs.

So for now is there any chance of getting your script to work on my device?

Gesendet von meinem Nexus 5X mit Tapatalk
31st January 2016, 07:28 AM |#508  
SpasilliumNexus's Avatar
Senior Member
Flag Delaware
Thanks Meter: 2,842
 
Donate to Me
More
Quote:
Originally Posted by domicq

blah blah

The reason why Titanium Backup and that other app that is NOT ALLOWED TO BE MENTIONED HERE "breaks" integration is because of the way they are now set up with their libraries extracted next to the APK with Lollipop and Marshmallow. Look in the Chrome app folder for an example of the layout.

Unless he can come up with a way for his script to do so, then it's not possible and doing it manually is the only way.

Sent from my Moto X Pure Edition using Tapatalk
31st January 2016, 07:53 AM |#509  
Senior Member
Flag Gelnica
Thanks Meter: 345
 
More
Delete
31st January 2016, 10:19 AM |#510  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,090
 
Donate to Me
More
Quote:
Originally Posted by Spasticdroid

The reason why Titanium Backup and that other app that is NOT ALLOWED TO BE MENTIONED HERE "breaks" integration is because of the way they are now set up with their libraries extracted next to the APK with Lollipop and Marshmallow. Look in the Chrome app folder for an example of the layout.

Unless he can come up with a way for his script to do so, then it's not possible and doing it manually is the only way.

My script already does that on Lollipop, but as I said, there are further issues/changes in Marshmallow that I'm not sure can be resolved.

Quote:
Originally Posted by domicq

Because of wasting space on /data with system-app updates and Titanium Backup or L*****r makes some of updated apps functionless. I don't care about OTAs.

So for now is there any chance of getting your script to work on my device?

Okay well the first thing it needs is a working sed, awk, and unzip, which Marshmallow doesn't provide. Flash my busybox zip then make another symlink from /su/xbin/busybox to /su/bin/sed to override the broken /system/bin/sed. Then give the script another shot in /su/su.d/.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
31st January 2016, 02:04 PM |#511  
ashyx's Avatar
Recognized Contributor
Thanks Meter: 9,509
 
Donate to Me
More
Just wanna say thanks to @osm0sis. I have used some of your tools and they have helped make building projects that bit easier. Saves having to do some of the tedious stuff manually.
The Following User Says Thank You to ashyx For This Useful Post: [ View ] Gift ashyx Ad-Free
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