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

tedrogers61

Senior Member
Aug 18, 2012
520
83
0
Sorry if this question has already been asked, but I have an Nexus 5X that I need to return under warranty, but I've unlocked the bootloader so the tamper flag is set.

It's easy enough to reset on a good old N5, but does the script from the 1st post now work with N5X?

It's been a few years and I was hoping there was some kind of development on this front?

All help gratefully received.

Thanks.

Sent from my Nexus 5 using XDA-Developers mobile app
 

gialakias

Senior Member
Mar 4, 2012
328
166
63
Athens
Sorry if this question has already been asked, but I have an Nexus 5X that I need to return under warranty, but I've unlocked the bootloader so the tamper flag is set.

It's easy enough to reset on a good old N5, but does the script from the 1st post now work with N5X?

It's been a few years and I was hoping there was some kind of development on this front?

All help gratefully received.

Thanks.

Sent from my Nexus 5 using XDA-Developers mobile app
The tamper flag is not affected for 5x. Check from the bootloader with the command fastboot oem device-info if I remember well.

Sent from my Nexus 5X using Tapatalk
 
  • Like
Reactions: tedrogers61

tedrogers61

Senior Member
Aug 18, 2012
520
83
0
The tamper flag is not affected for 5x. Check from the bootloader with the command fastboot oem device-info if I remember well.

Sent from my Nexus 5X using Tapatalk
Yes thanks for this. I ended up just trying it, and checking with fastboot oem device-info each time, and tamper was false on unlock and lock again. Didn't expect the full wipe on locking again though; I'm sure the old N5 just used to wipe on unlock only, and not lock too.
 

shoey63

Recognized Contributor
Jun 5, 2012
4,003
3,982
253
Somewhere in Oz...
Sure. Here you go. Let me know in my Odds and Ends thread if it works, so we don't derail this thread any further. :) :good:
Nope that doesn't do the trick. LED's don't even turn on during the boot process. (didn't do it before with you unmodded version either)Must be something else. Sorry for wasting your time.
 
Last edited:

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,347
32,235
263
Halifax
Nope that doesn't do the trick. LED's don't even turn on during the boot process. (didn't do it before with you unmodded version either)Must be something else. Sorry for wasting your time.
Edit: What about unlzma switches? Is there a differnce there?
All the busybox lzma config switches are otherwise the same, FAST was the only difference. Hmm. Maybe @[NUT] can explain.

On the upside, AIK is probably fine since I included an xz binary for lzma and xz recompression, so maybe I had already come across this issue and that was my solution. Who knows anymore, that was ages ago when I worked this stuff out. :p

Code:
xz) repackcmd="bin/xz $level -Ccrc32";;
lzma) repackcmd="bin/xz $level -Flzma";;
 
Last edited:
  • Like
Reactions: neonkat and shoey63

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,347
32,235
263
Halifax
G

gauravrai

Guest
That's pretty easy stuff from a command prompt, and a script isn't really needed where many tweaking apps exist already which do just that.

https://github.com/osm0sis/GN-Synapse-Injector/blob/master/ramdisk/res/synapse/actions/zram#L6-8
Actually I'm a naive android user have very less knowledge of command based tweaking. I have heard somewhere that that disabling zram will enhance low memory device performance. I also searched for apps related to zram tweaking but with no success.
So my kind request is to please guide me.

Sent from MotoG 2014 Titan
Stock official Marshmallow
 

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,347
32,235
263
Halifax
Actually I'm a naive android user have very less knowledge of command based tweaking. I have heard somewhere that that disabling zram will enhance low memory device performance. I also searched for apps related to zram tweaking but with no success.
So my kind request is to please guide me.
Actually I believe ZRAM is supposed to help low memory device performance, take the Galaxy Nexus as an example.

As for your device, make sure you have ZRAM running in the first place with an app called ZramCC. Then there are literally hundreds of ZRAM control and monitoring apps when I looked on the Play Store a second ago. And I'm pretty sure the well-known Trickster app lets you modify ZRAM as well.

If your device doesn't have ZRAM support enabled in the kernel there's no way to add that with an app, you'll have to go find a custom kernel for your device and talk to the developer if they don't already use ZRAM.
 
Last edited:

Surge1223

Recognized Contributor
Nov 6, 2012
2,603
7,395
203
Florida
So I discovered nano has been kinda broken since I updated the source... :eek::rolleyes:
...Updates to the OP! ;)

UPDATE-nano.Terminal.Editor.v2.5.3-signed.zip:
- hunted down and reverted a commit from 2.5.3 that was breaking file opening (and hanging the Android shell) and submitted the bug for a fix in 2.5.4.
- update to a new 2.5.3 build compiled without the offending commit.

UPDATE-Flashlt.Installer.v2.2-signed.zip:
- add support for MultiROM TWRP + homebrew naming scheme (TWRP*.img) to both .sh and recovery zip.
- add a separate wrapper script (dumpit.sh) for the main script's --dump functionality; simply specify the partition (boot, recovery, radio/modem).
- if no partition is specified for dump, default to dumping boot.
- use busybox for all string parsing commands (if present) in the main script.
- clean up output for MTD devices and match output style to EMMC.
- refactor in order to add image dump trimming(!).
- fix mistaken hashbangs in .sh files (left over from recovery script), fixing standalone command prompt execution.
- hide some occasional possible stderr from lsof in the sourced execution workaround.
- add system/su (flashіt) symlink to enter to a command prompt in the working directory (and provide --restore functionality for symlink if required).
- update/fix placement and wording of installation completed instructions.
So I'm building the full nano suit, but I have a persistent issue with compiling because of the libtinfo.a (from ncurses) I compiled is missing some dependencies that leads to the following.

Do you have a good copy of libtinfo.a? (I need to use it when compiling nano for tty and terminfo compat)

The errors below stem from the bad libtinfo.a, except for the glob errors, I haven't paid attention to figuring that error out yet tho 1461287835699.jpg1461287835699.jpg
 

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,347
32,235
263
Halifax
So I'm building the full nano suit, but I have a persistent issue with compiling because of the libtinfo.a (from ncurses) I compiled is missing some dependencies that leads to the following.

Do you have a good copy of libtinfo.a? (I need to use it when compiling nano for tty and terminfo compat)

The errors below stem from the bad libtinfo.a, except for the glob errors, I haven't paid attention to figuring that error out yet tho
Here are all my dirty tricks to get nano building. I cheated pretty hard and used a prebuilt static arm libncurses.a. ;)

Code:
curses.h: http://www.opensource.apple.com/source/ncurses/ncurses-36/ncurses/include/curses.h?txt
ncurses_dll.h: http://www.opensource.apple.com/source/ncurses/ncurses-36/ncurses/include/ncurses_dll.h?txt
unctrl.h: http://www.opensource.apple.com/source/ncurses/ncurses-36/ncurses/include/unctrl.h?txt

libncurses.a (prebuilt): http://www.kevinboone.net/ncurses-5.9_kbox3.deb:/data.tar.gz:/./usr/lib/libncurses.a
(the above headers can also be taken from this .deb)

getpwent.c: https://kernel.googlesource.com/pub/scm/fs/ext2/xfstests-bld/+/master/android-compat/getpwent.c

pty.c: https://raw.githubusercontent.com/CyanogenMod/android_external_busybox/cm-13.0/android/libc/pty.c


git clone http://git.savannah.gnu.org/r/nano;
cd nano; git checkout -f $(git describe --tags `git rev-list --tags --max-count=1`);
./autogen.sh;


//modified by osm0sis (//hack)

src/pty.c:
//hack int ptsname_r(int fd, char* buf, size_t len) {
int bb_ptsname_r(int fd, char* buf, size_t len) {

src/prototypes.h:
//hack to work around bionic stubs
#define ptsname_r bb_ptsname_r
//#define ttyname bb_ttyname //No longer needed on NDK API 21?
#define ttyname_r bb_ttyname_r

src/rcfile.c:
//hack extra default rcfile search dirs
have_nanorc("/sdcard", "/" HOME_RC_NAME) ||
have_nanorc("/sdcard", "/" RCFILE_NAME) ||


export PATH="/home/Chris/x-tools/arm-linux-androideabi-4.9/bin:$PATH";
./configure --host=arm-linux-androideabi --disable-browser --disable-extra --disable-histories --disable-justify --disable-libmagic --disable-mouse --disable-nls --disable-operatingdir --disable-speller --disable-wrapping-as-root LD=arm-linux-androideabi-ld LDFLAGS="-static -Wl,--gc-sections" CFLAGS="-D__ANDROID_API__=21 -O3 -ffunction-sections -s";
make LIBS="getpwent.c pty.c libncurses.a";

Here's my actual "engineering" (read: hacky :p) build script which can update, patch the new prototypes.h and rcfile.c, config and build.

~/nano-build.sh:
Bash:
# yipyip!

home=~;
magisk=$home/Magisk;

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

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

init() {
  reset;
  bold "--- Initializing nano-ndk build environment ...";
  bold "- Cloning official nano git repository at HEAD ...";
  git clone https://git.savannah.gnu.org/git/nano.git;
  bold "- Cloning nano-ndk installer git repository ...";
  git clone https://github.com/Magisk-Modules-Repo/nano-ndk $magisk/UPDATE-nano.Terminal.Editor;
  bold "- Downloading ncurses arm resources ...";
  mkdir -p $home/android-nano-ndk/src;
  cd $home/android-nano-ndk/src;
  # originally hosted at http://www.kevinboone.net/ncurses-5.9_kbox3.deb
  wget --no-check-certificate -O ncurses-5.9_kbox3.deb https://mva2.androidfilehost.com/dl/OHrMqvN_2l9NQoo5jevaPA/1603051671/10763459528675566234/ncurses-5.9_kbox3.deb;
  ar x ncurses-5.9_kbox3.deb data.tar.gz;
  tar -xzOf data.tar.gz ./usr/lib/libncurses.a > libncurses.a;
  tar -xzOf data.tar.gz ./usr/include/curses.h > curses.h;
  tar -xzOf data.tar.gz ./usr/include/ncurses_dll.h > ncurses_dll.h;
  tar -xzOf data.tar.gz ./usr/include/unctrl.h > unctrl.h;
  rm -f data.tar.gz ncurses-5.9_kbox3.deb;
  bold "- Downloading and patching code extensions for Android compatibility ...";
  wget --no-check-certificate -O android-compat.tar.gz https://kernel.googlesource.com/pub/scm/fs/ext2/xfstests-bld/+archive/master/android-compat.tar.gz;
  tar -xzf android-compat.tar.gz getpwent.c;
  rm -f android-compat.tar.gz;
  wget --no-check-certificate -O pty.c https://raw.githubusercontent.com/CyanogenMod/android_external_busybox/cm-13.0/android/libc/pty.c;
  sed -i 's|int ptsname_r|//hack int ptsname_r(int fd, char* buf, size_t len) {\nint bb_ptsname_r|' pty.c;
  wget --no-check-certificate -o /dev/null -O ../readme.html https://forum.xda-developers.com/showpost.php?p=66486572&postcount=671;
  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 nano-ndk ...";
  git fetch --tags;
  curtag=$(git describe --tags `git rev-list --tags --max-count=1`);
  bold "- Downloading latest official nano 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 ...";
  cp -rf $home/android-nano-ndk android;
  cp -rf android/src/* src/;
  ./autogen.sh;
  protoline=$((`grep -n "definitions.h" src/prototypes.h | head -n1 | cut -d: -f1` + 1));
  sed -i "${protoline}s;^;\n//hack to work around bionic stubs\n#define ptsname_r bb_ptsname_r\n//#define ttyname bb_ttyname\n#define ttyname_r bb_ttyname_r\n;" src/prototypes.h;
  rcline=$((`grep -n "if (have_nanorc(homedir," src/rcfile.c | head -n1 | cut -d: -f1` + 1));
  sed -i "${rcline}s;^;\t\t\t\t\thave_nanorc(\"/sdcard\", \"/\" HOME_RC_NAME) ||\n\t\t\t\t\thave_nanorc(\"/sdcard\", \"/\" RCFILE_NAME) ||\n;" src/rcfile.c;
  cd $home;
  mv -f $nano nano-${curtag//v/};
}

config() {
  bold "--- Configuring ...";
  host=arm-linux-androideabi;
  opts="--disable-browser --disable-extra --disable-histories --disable-justify --disable-libmagic --disable-mouse --disable-nls --disable-operatingdir --disable-speller";
  ldflags="-static -Wl,--gc-sections";
  cflags="-D__ANDROID_API__=21 -O3 -ffunction-sections -s";
  ./configure --host=$host $opts LD=$host-ld LDFLAGS="$ldflags" CFLAGS="$cflags";
}

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

build() {
  bold "--- Building ...";
  make LIBS="getpwent.c pty.c libncurses.a";
}

bundle() {
  bold "--- Bundling ...";
  rm -f nano-*.zip UPDATE-nano.Terminal.Editor.*-signed.zip 2>/dev/null;
  ver=$(echo "$nano" | cut -d- -f2);
  if [ -f "$nano/src/nano" ]; then
    bold "- Copying new nano $ver builds ...";
    curdir=$(basename $magisk/UPDATE-nano.Terminal.Editor*);
    cp -fp $nano/src/nano $magisk/$curdir/bin/nano.bin;
    if [ "$curdir" != "UPDATE-nano.Terminal.Editor.v$ver" ]; then
      mv $magisk/$curdir $magisk/UPDATE-nano.Terminal.Editor.v$ver;
    fi;
  fi;
  modver=$(grep -o "^version=.*$" $magisk/UPDATE-nano.Terminal.Editor.*/module.prop | cut -d= -f2);
  modcode=$(grep -o "^versionCode=.*$" $magisk/UPDATE-nano.Terminal.Editor.*/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-nano.Terminal.Editor.*/module.prop;
  fi;
  bold "- Packing \"nano-$ver.zip\" ...";cd
  cd $magisk/UPDATE-nano.Terminal.Editor.*;
  zip -9 -x .git -r -q $home/nano-$ver.zip *;
  cd $home;
  bold "- Signing as \"UPDATE-nano.Terminal.Editor.v$ver-signed.zip\" ...";
  java -jar zipsigner-*.jar nano-$ver.zip nano-$ver-signed.zip;
  mv -f nano-$ver-signed.zip UPDATE-nano.Terminal.Editor.v$ver-signed.zip 2>/dev/null;
  rm -f nano-*.zip /tmp/signAPK*.tmp 2>/dev/null;
}

test ! "$1" && set -- help;
until [ ! $1 ]; do
  nano=$(readlink -f `find $home -maxdepth 1 -type d -name 'nano*'` 2>/dev/null);
  if [ ! "$nano" ]; then
    case $1 in
      help|init|reset) ;;
      *) echo "nano-build: nano repo not found, run 'init' option"; exit 1;;
    esac;
  elif [ "$nano" == "$home/nano" -o ! -f "$nano/configure" ]; then
    case $1 in
      help|init|reset|update|all) ;;
      *) echo "nano-build: nano 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 $nano; $1;;
    all) set -- "$0" update config clean build bundle;;
    help) echo "init update config build bundle all clean reset help"; exit 1;;
    *) echo "nano-build: invalid option -- '$*'"; exit 1;;
  esac;
  case $1 in
    config|build) export PATH="$savedpath";;
  esac;
  shift;
done;

exit 0;
The above script does pretty much everything for you now, so... 👍🤠
 
Last edited:
  • Like
Reactions: Surge1223

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,347
32,235
263
Halifax
Updates to the OPs!

Alright we've got updates to the couple straggler zips of mine that I commonly keep on my device/use but weren't signed yet, and a new tool for everyone's toolkit to help out with using Chainfire's excellent systemless root while in recovery. The latter should be useful to anyone who uses su.d scripts or can't boot due to something in /su.d or /su/bin and/or doesn't feel like messing around with the several mount commands in recovery to access the /su filesystem. It uses the mount script from Chainfire which I modified a while back. :D

This took a fair amount of my time off this week, so if you like the progress I'm making on these projects, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

UPDATE-SUmount-signed.zip:
- mount /data/su.img (or /cache/su.img prior to first post-root boot) as /su while in recovery to simplify manipulating the /su filesystem via ADB, AROMA Filemanager or TWRP's terminal/file manager.
- functions as a toggle, alternating /su mounted and unmounted with each flash.

UPDATE-sdcard.Fix.Permissions-signed.zip:
- update to latest versions of restore_con and ui_print from my Complete Shell Zip Documentation.
- remove reliance on busybox to potentially support recoveries without it (CM Recovery), though the recovery still needs awk because the permissions changes would be too complex without the permissions functions that rely on awk.
- only mount system read-only to behave better with systemless root (system is only mounted to access restorecon anyway).
- update permissions for obb, TWRP and MultiROM, fixing BACKUP access while booted.
- zip is now signed to support recoveries that enforce verification (CM Recovery).

UPDATE-Nexus.BootUnlocker-signed.zip:
- only mount system read-only to behave better with systemless root (system is only mounted to possibly read from build.prop anyway).
- change lockstate check parsing od switches to ones that both busybox and toybox support (CM Recovery).
- added unified "tuna" (Galaxy Nexus) to the list of supported device names.
- fix correct offset for Nexus 9 OEMbit toggling.
- switch to using rev+tr in lockstate check parsing for recoveries that (foolishly) don't have awk support due to toybox (CM Recovery).
- zip is now signed to support recoveries that enforce verification (CM Recovery).

Unfortunately no newer Nexus devices have been added to BootUnlocker in this update. I've got research on N5X support started in the BootUnlocker Dev thread but nobody has yet volunteered any further devices/dumps for us to complete it. If you have any of the missing newer Nexus devices (N5X and N6P), or even an N6 and N9 (since we could take another stab at a proper unlock for those again), this would be a great help, so please volunteer in the above linked thread! :good:

And again, it being signed does not get it working on Nexus stock recovery, just AOSP-based; Nexus stock recovery only supports Google's corporate keys.

AIK-mobile + AIK-Linux, the AIK Build Farm and GN Synapse Injector also saw some updates. :cowboy:

sdcard Fix Permissions previous download count was 16985, and Nexus BootUnlocker was 7898.
 
Last edited:

jesssiii

Senior Member
Aug 19, 2010
4,942
1,656
0
Southern CA
Unfortunately no newer Nexus devices have been added to BootUnlocker in this update. I've got research on N5X support started in the BootUnlocker Dev thread but unforunately nobody volunteered any further devices/dumps for us to complete it. If you have any of the missing newer Nexus devices (N5X and N6P)...
Never heard of that before. What, exactly, would you need from someone with a 6P?

Sent from my Nexus 6P
 
  • Like
Reactions: osm0sis

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,347
32,235
263
Halifax
Hah so I just learned there's a step beyond an "OOPS" in Android errors while putting gappsintegrator through its paces on CM13 for my Galaxy Nexus.. :p
Code:
04-24 23:50:56.521   931   931 E AndroidRuntime: Error reporting WTF
04-24 23:50:56.524   931   931 E AndroidRuntime: Original WTF:
04-24 23:50:56.524   931   931 E AndroidRuntime: android.util.Log$TerribleFailure: Error reading package manager settings
04-24 23:50:56.524   931   931 E AndroidRuntime: Caused by: java.io.FileNotFoundException: /data/system/packages.xml: open failed: EACCES (Permission denied)
The boot was hung (sdcard refused to mount :eek:), so I went in with adb shell and checked the permissions:
Code:
-rwx------  1 root   root         487775 2016-04-24 23:38 packages.xml
Then restored my backup and this is what they should be:
Code:
-rw-rw----  1 system system       514515 2016-04-25 00:23 packages.xml
I also discovered the free space calculation can report an APK could be integrated when it actually can't because of a difference in the df output in CM not having decimals a lot of the time, so I'm just testing out some fixes now that I imagine will fix things on a number of devices/ROMs/setups. :)

Edit: P.S. @jesssiii, see my reply in the linked BootUnlocker thread, where I also @ mentioned you. :good:
 
Last edited:

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,347
32,235
263
Halifax
Milestone update! Can't find a ROM on my test device that can make it fail now. :D:cowboy:

gappsintegrator: v6 - abort on broken script environments, logging improvements, fixes:
- remove oldest log entry once log exceeds ~16kb to create a rolling log and limit length
- test for awk and sed, attempt to use busybox sed if system version is broken, and abort if neither are found/working
- ensure proper ownership and permissions of /data/system/packages.xml to avoid possible WTF breakage on some ROMs or setups
- fix free space calculations when df reported amount has no decimal point (CM toybox)
- fix libsize calculations when unzip -l does not report a total due to deviations from the zip standard in APK compression (invalid zip magic)

https://github.com/osm0sis/gappsintegrator/commit/1f0438dcc711eec9dd4a354af94e3df7f596a0d6


And the requisite bugfix/new milestone release. ;)

gappsintegrator: v7 - improve freespace calculations, more script environment checks:
- expand script environment element checks to all possibly non-standard commands
- fix new libsize counting method for older zip standard-compliant APKs, and ensure no possible variable issues arise within the multiple loops present
- improve freespace calculation by accounting for whether libraries will be removed/repacked for the integrated APK
- add a buffer space amount now that calculations aren't so "quick and dirty" anymore, increasing when libraries are removed/repacked to account for growth
- add exclusions for known APKs with library incompatibility on KitKat and below (thanks @MastahF and Open GApps for maintaining a current list)

https://github.com/osm0sis/gappsintegrator/commit/6a81ca05acee2208b8aec695eaf97bc0fc9e6b08

Download via GitHub's raw copy of the latest version. :good:
 
Last edited:

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,347
32,235
263
Halifax
Bugfix! Turns out Google Calendar v5.5 and Android System WebView v50 trigger the same System UI FC/permissions issues we saw with Google TTS and Google Keyboard.. I'm still not sure why this happens, but now that I have 2 examples of APKs where one version to the next it has become a problem I'm hoping I can dissect and compare to v5.4 and v49, respectively, to maybe figure out how to workaround or at least detect the issue on the fly. :fingers-crossed:

Please let me know if there are any others that need to be added to the exclusions which I haven't yet come across in my testing.

gappsintegrator: v7.5 - update Marshmallow exclusions:
- add calendar and webview to exclusion list since recent app updates (5.5 and 50, respectively) have made these trigger the SystemUI FC/permissions issue

https://github.com/osm0sis/gappsintegrator/commit/4a3cb1e8cd19cd42e9b8096d3f318e808cb36cf9


Major update! Thanks to a great brainstorming session with @MastahF of Open GApps a workaround for the Marshmallow System UI FCs has been found, and I've rewritten the exclusion list into a blacklist for the workaround to use. Unfortunately, despite tearing apart the APKs I noted changed above, I wasn't able to find a way to detect a "bad" APK on-the-fly; must be something in classes.dex or resources.asrc since there was nothing obviously different in the required permissions, AndroidManifest.xml, or the zip structure itself.

The workaround forces a rebuild of the permissions lists, a side-effect of which is that granted user app permissions will be reset until you run the app again to request them. Even though this is pretty minor, I have found we can get away with having this only occur during the cleanup following the integration of one of the flagged (blacklist) apps, so there continues to be as little inconvenience as possible. :cowboy::highfive:

gappsintegrator: v8 - workaround for Marshmallow breakage, update KitKat exclusions:
- rewrite Marshmallow exclusion list into a workaround with blacklist to prevent breakage (System UI FC/permissions issues) following integration of APK by forcing a rebuild of runtime-permissions.xml as part of the cleanup (noted in log with "~") (thanks @MastahF for the idea)
- add streetview to exclusion list for KitKat as it now conflicts with maps (thanks @MastahF and Open GApps)
- rewrite zip/zipalign check to output results in log

https://github.com/osm0sis/gappsintegrator/commit/68fa4d4778e3dc3caaf61b16a131d2f0baadfc79

Download via GitHub's raw copy of the latest version. :good:
 
Last edited:

smint86

Senior Member
Jul 8, 2011
1,043
714
143
Dortmund
I'm currently trying to set up gapps-integrator v8 with CM13 (CAF based) on my OPO. I placed the script in /system/su.d, but unfortunately I get the following output in the log:
Code:
Thu May 12 15:47:47 CEST 2016
 * Missing script environment element detected: awk
---
What could be the culprit? Should I contact the kernel maintainer, ROM dev or would it be an easy fix by myself?

Additional information: I'm using SuperSU Beta v2.71 and xposed v83.

Swyped via Tapatalk
 
Last edited:
  • Like
Reactions: osm0sis

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,347
32,235
263
Halifax
I'm currently trying to set up gapps-integrator v8 with CM13 (CAF based) on my OPO. I placed the script in /system/su.d, but unfortunately I get the following output in the log:
Code:
Thu May 12 15:47:47 CEST 2016
 * Missing script environment element detected: awk
---
What could be the culprit? Should I contact the kernel maintainer, ROM dev or would it be an easy fix by myself?

Additional information: I'm using SuperSU Beta v2.71 and xposed v83.
A lot of Marshmallow ROMs are missing awk because Google/AOSP started using toybox and it doesn't have awk (yet). Simplest solution is to install busybox. My flashable busybox installer zip does a pretty good job. :)

I'd also strongly recommend you put a current zip and zipalign in /su/bin or /system/xbin to process APKs properly (without using the fallback method) and save space in /system. They can be found on my BasketBuild.

Edit: Just re-pushed v8 with checks for zip and zipalign to warn which method will be used. :good:
 
Last edited:
  • Like
Reactions: smint86