FORUMS
Remove All Ads from XDA

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

13,736 posts
Thanks Meter: 30,429
 
By osm0sis, Recognized Developer / Recognized Contributor on 18th April 2013, 01:37 AM
Post Reply Email Thread
31st July 2019, 03:26 PM |#2461  
Member
Thanks Meter: 26
 
More
Interesting idea.

But
Quote:
Originally Posted by DiamondJohn

For example, LOS ROMs do not have this visual history graph built into the ROM [snap].

is not correct. I'm running LOS 14.1, and I get that chart when I e.g. touch the battery QS tile (and in settings).
1st August 2019, 12:28 AM |#2462  
Senior Member
Flag Sydney
Thanks Meter: 1,940
 
More
Quote:
Originally Posted by Keule-T

Interesting idea.

But is not correct. I'm running LOS 14.1, and I get that chart when I e.g. touch the battery QS tile (and in settings).

Sorry, I am running LOS Pie, ie the latest not an older 14.1 version. Features change between android revisions and over time. ie their next Pie build may just include the feature.
2nd August 2019, 03:31 PM |#2463  
Member
Thanks Meter: 26
 
More
Quote:
Originally Posted by DiamondJohn

Sorry, I am running LOS Pie, ie the latest not an older 14.1 version. Features change between android revisions and over time. ie their next Pie build may just include the feature.

Right, as far as generalizations go, we're both wrong 😉
4th August 2019, 01:39 AM |#2464  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,429
 
Donate to Me
More
I love you 30,000 too, xda.
The Following 29 Users Say Thank You to osm0sis For This Useful Post: [ View ]
4th August 2019, 01:48 AM |#2465  
shoey63's Avatar
Recognized Contributor
Flag Somewhere in Oz...
Thanks Meter: 3,994
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

I love you 30,000 too, xda.

+1
The Following 2 Users Say Thank You to shoey63 For This Useful Post: [ View ] Gift shoey63 Ad-Free
7th August 2019, 08:42 PM |#2466  
Member
Thanks Meter: 5
 
More
Twrp script module for A/B devices!
If you have backup ramdisk! can't you patch it to install twrp?!
Maybe you can

---------- Post added at 06:42 PM ---------- Previous post was at 06:42 PM ----------

Twrp script module for A/B devices!
If you have backup ramdisk! can't you patch it to install twrp?!
Maybe you can
9th August 2019, 05:43 AM |#2467  
methuselah's Avatar
Senior Member
Thanks Meter: 2,086
 
More
Quote:
Originally Posted by osm0sis

I love you 30,000 too, xda.

Well very few of you like left on XDA. The guys who really helps 😀...Congrats
The Following 2 Users Say Thank You to methuselah For This Useful Post: [ View ] Gift methuselah Ad-Free
19th September 2019, 06:46 PM |#2468  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,429
 
Donate to Me
More
I was originally waiting for Busybox 1.31.x to go stable, but that seems to be taking forever (1.31.0 unstable has been out since early June), so let's get this update out before I have to focus on my wedding and honeymoon for the next few weeks!

mtd-utils has been up on the Magisk Module Repo for a bit, but this is its Odds thread debut! I'll be updating the OP with blurb/links to it and build instructions shortly.

Also, just so people are properly aware, BasketBuild is down again, so for now Nexus Media is only available as a Magisk module from the Magisk Module Repo (it's too large to attach on xda). I had uploaded the latest version to it before it went down, so whenever it's up again, it's up.

I work on these projects in my limited time off, so if you like the progress I'm making, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

UPDATE-adb.Installer.v1.0.39-signed.zip;
UPDATE-Busybox.Installer.v1.30.1-ALL-signed.zip;
UPDATE-ZipSigner.Installer.v3.0-signed.zip:

- update installer for SAR Magisk

UPDATE-FlashIt.Installer.v3.6-signed.zip:
- fix false positive Magisk detection with non-Magisk Manager booted installs
- fix slot selection when used with partition detection
- support MTD /dev/bootimg and /dev/recovery char device partitions
- optimize write operations (thanks @arter97)
- fix partition detection taking only last match on older devices
- update installer for SAR Magisk
- update flash_erase, nanddump and nandwrite binaries (mtd-utils 2.1.1)

UPDATE-mtd-utils.Installer.v2.1.1-signed.zip:
- installs ARM compiles of flash_erase, nanddump and nandwrite
- use latest mtd-utils official source
- update installer for SAR Magisk

UPDATE-nano.Terminal.Editor.v4.4-signed.zip:
- update installer for SAR Magisk
- update to latest nano official source

UPDATE-Nexus.Media.Installer-signed.zip:
- fix forcing system install advanced option via .nexusmedia config file
- add noreplace advanced option to allow ROM stock sounds to remain available
- update installer for SAR Magisk



This post can double as the build instruction post for mtd-utils.

As with my nano-build.sh, I've made a one-stop shop script to handle it all:

~/mtd-build.sh:
Code:
# yayo!

home=~;
magisk=$home/Magisk;

bold() { echo -e "\033[1m"[email protected]"\033[0m"; }

reset() {
  bold "--- Removing mtd-ndk build environment ...";
  rm -rfv $magisk/UPDATE-mtd-utils.Installer* $(dirname $home/mtd-utils*/.git)/ zipsigner-*.jar mtd-utils-*.zip UPDATE-mtd-utils.Installer.*-signed.zip;
  rmdir $magisk 2>/dev/null;
}

init() {
  reset;
  bold "--- Initializing mtd-ndk build environment ...";
  bold "- Cloning official mtd-utils git repository at HEAD ...";
  git clone git://git.infradead.org/mtd-utils;
  bold "- Cloning mtd-ndk installer git repository ...";
  git clone https://github.com/Magisk-Modules-Repo/mtd-ndk $magisk/UPDATE-mtd-utils.Installer;
  bold "- Downloading zipsigner ...";
  zipsigner=$(wget --no-check-certificate -qO- https://github.com/opengapps/opengapps/tree/master/scripts/zipsigner-resources | grep -o '/opengapps/.*jar' | cut -d\" -f1 | sed 's/blob/raw/');
  wget --no-check-certificate -O $home/$(basename $zipsigner) https://github.com/$zipsigner;
}

update() {
  bold "--- Updating mtd-ndk ...";
  git fetch --tags;
  curtag=$(git describe --tags `git rev-list --tags --max-count=1`);
  bold "- Downloading latest official mtd-utils sources at $curtag ... ";
  git reset -- . > /dev/null;
  git clean -df > /dev/null; 
  git checkout -- .;
  git checkout -f $curtag 2>&1 | tail -n 1;
  bold "- Setting up repository and patching for Android ...";
  ./autogen.sh;
  echo -e 'static char* strchrnul(const char *s, int c)\n{\n\twhile (*s != 0 && *s != c)\n\t\ts++;\n\treturn (char*)s;\n}\n' > misc-utils/strchrnul.c;
  sed -i "s;0;'\\\0';" misc-utils/strchrnul.c;
  sed -i 's;#include "lsmtd.h";#include "lsmtd.h"\n\n#include "strchrnul.c";' misc-utils/lsmtd.c;
  cd $home;
  mv -f $mtd mtd-utils-${curtag//v/};
}

config() {
  bold "--- Configuring ...";
  host=arm-linux-androideabi;
  sysroot=$(echo $home/x-tools/arm-linux-androideabi* | rev | cut -d\  -f1 | rev)/sysroot;
  opts="--disable-shared --enable-static --without-jffs --without-ubifs --without-xattr --without-lzo";
  ldflags="-static -Wl,--gc-sections";
  cflags="-D__ANDROID_API__=21 -O3 -ffunction-sections -s";
  ./configure --host=$host --with-sysroot=$sysroot $opts LD=$host-ld LDFLAGS="$ldflags" CFLAGS="$cflags";
  sed -i "s;^sys_lib_search_path_spec=.*;sys_lib_search_path_spec=\'$chain/lib/gcc $chain/lib $chain/sysroot/usr/lib \';" config.status;
}

clean() {
  bold "--- Cleaning ...";
  make clean;
}

build() {
  bold "--- Building ...";
  ldflags="-all-static -Wl,--gc-sections";
  make LDFLAGS="$ldflags";
}

bundle() {
  bold "--- Bundling ...";
  rm -f mtd-utils-*.zip UPDATE-mtd-utils.Installer.*-signed.zip 2>/dev/null;
  ver=$(echo "$mtd" | cut -d- -f3);
  if [ -f "$mtd/nandwrite" ]; then
    bold "- Copying new mtd-utils $ver builds ...";
    curdir=$(basename $magisk/UPDATE-mtd-utils.Installer*);
    cp -fp $mtd/flash_erase $magisk/$curdir/bin/flash_erase;
    cp -fp $mtd/nanddump $magisk/$curdir/bin/nanddump;
    cp -fp $mtd/nandwrite $magisk/$curdir/bin/nandwrite;
    if [ "$curdir" != "UPDATE-mtd-utils.Installer.v$ver" ]; then
      mv $magisk/$curdir $magisk/UPDATE-mtd-utils.Installer.v$ver;
    fi;
    modver=$(grep -o "^version=.*$" $magisk/UPDATE-mtd-utils.Installer.*/module.prop | cut -d= -f2);
    modcode=$(grep -o "^versionCode=.*$" $magisk/UPDATE-mtd-utils.Installer.*/module.prop | cut -d= -f2);
    if [ "$ver" == "$modver" ]; then
      newmodver="$modver";
      newmodcode="$((modcode + 1))";
      iteration=1;
    else
      newmodver="$ver";
      newmodcode="${ver//.}0";
      test ${#newmodcode} == 3 && newmodcode="$newmodcode"0;
    fi;
    if [ "$iteration" ]; then
      echo -ne "\033[1m\n*** Update Magisk module version code ($modcode -> $newmodcode) (y/n)? \033[0m";
      read n; echo;
      case $n in
        Y|y) ;;
        *) skipmodprop=1;;
       esac;
    fi;
    if [ ! "$skipmodprop" ]; then
      sed -i -e "s/version=.*/version=$newmodver/" -e "s/versionCode=.*/versionCode=$newmodcode/" $magisk/UPDATE-mtd-utils.Installer.*/module.prop;
    fi;
  fi;
  bold "- Packing \"mtd-utils-$ver.zip\" ...";cd 
  cd $magisk/UPDATE-mtd-utils.Installer.*;
  zip -9 -x .git -r -q $home/mtd-utils-$ver.zip *;
  cd $home;
  bold "- Signing as \"UPDATE-mtd-utils.Installer.v$ver-signed.zip\" ...";
  java -jar zipsigner-*.jar mtd-utils-$ver.zip mtd-utils-$ver-signed.zip;
  mv -f mtd-utils-$ver-signed.zip UPDATE-mtd-utils.Installer.v$ver-signed.zip 2>/dev/null;
  rm -f mtd-utils-*.zip /tmp/signAPK*.tmp 2>/dev/null;
}

test ! "$1" && set -- help;
until [ ! $1 ]; do
  mtd=$(readlink -f `find $home -maxdepth 1 -type d -name 'mtd-utils*'` 2>/dev/null);
  if [ ! "$mtd" ]; then
    case $1 in
      help|init|reset) ;;
      *) echo "mtd-build: mtd-utils repo not found, run 'init' option"; exit 1;;
    esac;
  elif [ "$mtd" == "$home/mtd-utils" -o ! -f "$mtd/configure" ]; then
    case $1 in
      help|init|reset|update|all) ;;
      *) echo "mtd-build: mtd-utils repo not patched, run 'update' or 'all' option"; exit 1;;
    esac;
  fi;
  case $1 in
    config|build)
      savedpath="$PATH";
      export PATH="$(echo $home/x-tools/arm-linux-androideabi* | rev | cut -d\  -f1 | rev)/bin:$PATH";
    ;;
  esac;
  case $1 in
    init|reset|bundle) cd $home; $1;;
    update|config|clean|build) cd $mtd; $1;;
    all) set -- "$0" update config clean build bundle;;
    help) echo "init update config build bundle all clean reset help"; exit 1;;
    *) echo "mtd-build: invalid option -- '$*'"; exit 1;;
  esac;
  case $1 in
    config|build) export PATH="$savedpath";;
  esac;
  shift;
done;

exit 0;

Only pre-req is an NDK stand-alone ARM cross-compiler at a path matching ~/home/x-tools/arm-linux-androideabi-*
The Following 43 Users Say Thank You to osm0sis For This Useful Post: [ View ]
19th September 2019, 07:11 PM |#2469  
david72262's Avatar
Senior Member
Flag Oregon
Thanks Meter: 1,674
 
More
Congratulations 🎉
Quote:
Originally Posted by osm0sis

I was originally waiting for Busybox 1.31.x to go stable, but that seems to be taking forever (1.31.0 unstable has been out since early June), so let's get this update out before I have to focus on my wedding and honeymoon for the next few weeks:

The Following User Says Thank You to david72262 For This Useful Post: [ View ] Gift david72262 Ad-Free
19th September 2019, 10:11 PM |#2470  
mrrocketdog's Avatar
Senior Member
Thanks Meter: 1,768
 
More
@osmosis , thank you and congratulations!! woo hoo

err on the side of kindness
The Following 2 Users Say Thank You to mrrocketdog For This Useful Post: [ View ] Gift mrrocketdog Ad-Free
19th September 2019, 10:14 PM |#2471  
Lughnasadh's Avatar
Senior Member
Thanks Meter: 963
 
More
Quote:
Originally Posted by osm0sis

I was originally waiting for Busybox 1.31.x to go stable, but that seems to be taking forever (1.31.0 unstable has been out since early June), so let's get this update out before I have to focus on my wedding and honeymoon for the next few weeks!

Thanks for the updates and congrats on the upcoming nuptials
The Following User Says Thank You to Lughnasadh For This Useful Post: [ View ] Gift Lughnasadh 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