yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] osm0sis:
Unfortunately, that just means there's another one that needs to be added to the exclusion list.

zipalign method or no? It's difficult to figure out which is the culprit, but please upload the entire log to pastebin.com so I can take a look to try and narrow it down.
[Android Software/Hacking General [Developers Only]] domicq:
here is log - http://pastebin.com/PwHeemJ1

to be honest idk, which method it used :D but i think zipalign, i flashed your busybox and copied newest zipalign
[Android Software/Hacking General [Developers Only]] osm0sis:
You also need the zip binary; since LatinIme got integrated I'd guess you didn't have it. It's possible LatinIme doesn't play fair in the fallback method universally even though I had it working on my test device on AOSP.

You can either add com.google.android.inputmethod* to the fallback method excludes like it is with the zipbins method, or try again with zip.

I'd definitely like you to try starting over and adding the LatinIme exclusion to see if it resolves it, since I can't reproduce it on my end.
[Android Software/Hacking General [Developers Only]] domicq:
first three parts of log are from succesful integrating, but the last one was that one, which made me FC

between the 3th and last log i was using my phone without problem.
[Android Software/Hacking General [Developers Only]] osm0sis:
You can see in the log that stuff still wasn't done integrating, even on that last boot; LatinIme only got removed from data on that last boot though, so that's still my main guess.
[Android Software/Hacking General [Developers Only]] amit.bagaria:
I faced the same issue of SystemUI FC. In my case the integration happened successfully for "Android System Webview", but resulted in SystemUI FCs. I found that it lost the runtime permissions. To fix it, I had to grant runtime permissions to SystemUI from adb console.

P.S.: I used your zip and zipalign both. I have non systemless root 2.68, hence I had to put this on the top of the script, in order to avoid "df" and other applets to be picked from toybox (as these applets does not play well with toybox in your freespace method)

export PATH=/system/xbin:$PATH
[Android Software/Hacking General [Developers Only]] osm0sis:
toybox df and free space should work fine in the latest release, it's only missing awk and busybox handles that, and for the package.xml hacking Marshmallow's toybox sed symlink in /system/bin needs to be deleted (at least on AOSP) since it's broken.

In my testing it pretty much always came down to TTS, LatinIme and Webview, but once TTS and LatinIme were excluded Webview consistently integrated fine for me.

Anyway, if you want to test your theory, add com.google.android.webview to the exclusions for the method you're using and start over with a fresh install.
[Android Software/Hacking General [Developers Only]] amit.bagaria:
Somehow in my CM's toybox, df is not working (attached screenshot).

I will test excluding Webview and let you know.
[Android Software/Hacking General [Developers Only]] osm0sis:
Ah damn, df usually ignored switches it doesn't know on my AOSP test device, and busybox needed the switches, so I had both working. CM updated toybox to master so sed, etc. are fixed, guess that "fixed" some other stuff too.

Edit: [MENTION=4084072]amit.bagaria[/MENTION] can you show me the output of df -Ph? toolbox df is the ROM default generally, not toybox df, is that different on CM?
[Android Software/Hacking General [Developers Only]] akaHardison:
Can you make a bootloader unlock script for nexus 6p?My 6p is locked but I can still boot into twrp and flash anything I wanted
[Android Software/Hacking General [Developers Only]] osm0sis:
We need partition dumps both locked and unlocked to compare and figure out the lockbit offset (if there is one). See the BootUnlocker app dev thread for information.
[Android Software/Hacking General [Developers Only]] osm0sis:
Just experimented with building using the "stericson-like" config, from the original android-busybox-ndk project, updated for 1.24.1 and TiBu seems to like it, so I'll mess around with the differing config options between it and mine and get things working for TiBu in my next build. :good:

Unrelated to the TiBu issue, I've also discovered the mntent patch from android-busybox-ndk doesn't seem to completely do the job anymore; mount, fsck and umount work, but df throws an error about bionic stubs:

FIX ME! implement getmntent() bionic/libc/bionic/stubs.c:354

similarly, switching keyboards while running nano in command prompt gives:

FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360

and doing a grep of the busybox binary (and nano binary) gives the following:

FIX ME! implement ttyname_r() %s:%d
FIX ME! implement ttyname() %s:%d
FIX ME! implement getmntent() %s:%d
FIX ME! implement getgrnam() %s:%d

where a grep of official Stericson's does not, and neither does the precompiled binary from the original android-busybox-ndk project, so we're definitely looking at some failures in the patches making it fall back to the broken NDK limitations (despite compiling okay). Going to see if I can figure out any workaround to at least get df working again. :good:
[Android Software/Hacking General [Developers Only]] amit.bagaria:
See attached.
[Android Software/Hacking General [Developers Only]] osm0sis:
Perfect. df -Ph in the freespace() function should work pretty much universally then. :)
[Android Software/Hacking General [Developers Only]] Paschfire:
[MENTION=4544860]osm0sis[/MENTION]

Can your flashify script be used to flash the vendor images for the 5x or 6p?
[Android Software/Hacking General [Developers Only]] osm0sis:
It doesn't support it right now since those are ext4/sparse images, so I was unsure how writing them whole in recovery would work. If you're willing to test writing one from a factory image with the appropriate dd command in recovery I'll consider it. :good:
[Android Software/Hacking General [Developers Only]] Paschfire:
Sorry.... If I had a 5x or 6p I most certainly would test it, I was just inquiring as there is a flood of "How do you flash vendor images without a Pc" every month and I remembered how easy to use your flashify script is for flashing boot/recovery/radio image files, thanks though.
[Android Software/Hacking General [Developers Only]] osm0sis:
Ah well I'm pretty sure Chainfire's FlashFire app can do it. :)
[Android Software/Hacking General [Developers Only]] KonoeKyon:
TWRP already can flash vendor.img on the Nexus 6P, not sure about the 5X..
[Android Software/Hacking General [Developers Only]] gialakias:
It does for 5X also.
[Android Software/Hacking General [Developers Only]] bgiesing:
[MENTION=4544860]osm0sis[/MENTION] For some reason on my BLU Energy X Plus, no app integrates anymore since I added a SD card into the device. Anything I can do to debug it?
[Android Software/Hacking General [Developers Only]] osm0sis:
What's the log look like? What's /data/app look like?

Off the top of my head I'm guessing your device automatically prefers to store updated app APKs on external storage so the script can't find them anymore.
[Android Software/Hacking General [Developers Only]] bgiesing:
Here's both the log and the output of ls in the /data/app directory. https://gist.github.com/bgiesing/e908eb4f5cde54eb3be0
[Android Software/Hacking General [Developers Only]] osm0sis:
The log suggests it's failing to find the $sysapk counterpart to the /data/app APK in packages.xml so it skips the package. What's that file look like on your setup?
[Android Software/Hacking General [Developers Only]] bgiesing:
https://gist.github.com/bgiesing/b0ae34a3070d5a93d5bc
[Android Software/Hacking General [Developers Only]] osm0sis:
Alright, so using YouTube as an example, in your "ls /data/app" output we see the directory "com.google.android.youtube-1", the script then processes that into just the package name "com.google.android.youtube" and searches for the system APK name in packages.xml using it:

<updated-package name="com.google.android.youtube" codePath="/system/vendor/operator/app/com.google.android.youtube-1.apk" ft="15359995f68" it="11b7e237e00" ut="1535999ba3e" version="110759633" flags="1079524932" pkgFlagsEx="1" resourcePath="/system/priv-app/com.google.android.youtube" nativeLibraryPath="/data/app-lib/com.google.android.youtube" primaryCpuAbi="armeabi-v7a" userId="10097">

Now for some reason it's not making it past that step once your external sdcard is involved. "/system/vendor/operator/app/com.google.android.youtube-1.apk" where normally we'd expect the directory "/system/app/YouTube" on Lollipop+ certainly seems unusual. Then there's "/system/priv-app/com.google.android.youtube" as well.

The data APK entry seems fine:

<package name="com.google.android.youtube" codePath="/data/app/com.google.android.youtube-1" nativeLibraryPath="/data/app-lib/com.google.android.youtube-1" primaryCpuAbi="armeabi-v7a" flags="1079524932" pkgFlagsEx="1" ft="1535f460e20" it="11b7e237e00" ut="1535f46a216" version="110851633" userId="10097" installer="com.android.vending">

So any idea what the deal is with /system/vendor/operator/app/? What are its contents? What's in /system/app/? /system/priv-app/?
[Android Software/Hacking General [Developers Only]] osm0sis:
Update ALL the things! :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-Busybox.Installer.v1.24.1-ALL-signed.zip:

- update to latest busybox official patches (fixes truncate).

- installer now actually does what people thought it did anyway; it will clean up a busybox installation in /su/bin (which is bad and known to cause breakage) and install to the (safe) /su/xbin instead!

- fixed some mistaken breakage/updated some code that was causing a revert to the NDK bionic stub FIX ME error when using the "df" command (and probably others).

- tracked down and worked around the reported Titanium Backup weirdness; basically Titanium Backup is sooky about "ls --color" (even though it only uses it to set it to normal) and the "xargs" command apparently needs to not support the latest features.

See the related commits here: https://github.com/osm0sis/android-busybox-ndk; along with some minor fixups to my AIK Build Farm script, which I use to automate cross-compilation to all Android and Android x64 architectures.

UPDATE-nano.Terminal.Editor.v2.5.3-signed.zip:

- update recovery nano wrapper to use the same mount loop method as the installer.

- installer fixes for CM Recovery (remove functions that required awk command).

- fix the NDK bionic stub FIX ME error when switching keyboards with nano in a Terminal Emulator app.

- update to latest nano official source.

UPDATE-adb.Installer.v1.0.26-signed.zip:

- switch to stripped static compiles to save more space on /system and /su.

- installer fixes for CM Recovery (remove function that required awk command).

AIK-mobile + AIK-Linux, AnyKernel2 and APK-Patcher also saw some updates. :cowboy:
[Android Software/Hacking General [Developers Only]] jacomail95:
Hi osm0sis, i really appreciate your works here on xda, been on your thread since its first days. I wanted to ask something, if you are willing, maybe also in the future, when you'll have more free time: can you update your odex script to work on LP/MM? Searching on xda i found only deodexing tools, but not reodexing ones. It could be useful to speed up deodexed custom ROMs without returning to stock. I thank you profusely for your time :) :thumbup:

Inviato dal mio Nexus 4 con Tapatalk 2
[Android Software/Hacking General [Developers Only]] Paget96:
Well, yes hah :D

Thank you a lot for this ;)
[Android Software/Hacking General [Developers Only]] osm0sis:
Calling Dalvik dexopt manually required a wrapper binary, but Lollipop and above have ART and use dex2oat, which I believe can be invoked directly from the command line:

dex2oat --dex-file=classes.dex --oat-file=output.odex

That's all I know, though; there was some discussion I was reading about it in the Open GApps room on Gitter. Not sure what it would need to automate it.. there might already be another script out there to do it even, there were definitely a few other Dalvik odex scripts around. :good:

Edit: [MENTION=4947414]jacomail95[/MENTION], I was just reading in SuperR.'s thread that apparently L**** Patcher can reodex jars and apks? Failing that, Open GApps just committed their odexing script so you could always take a stab at combining that with my old script if you wanted. :good:
[Android Software/Hacking General [Developers Only]] bgiesing:
Sorry for not replying (device lag made it near impossible to do anything)

Here's a direct link to a zip containing file lists of all three directories (as Gist was messing up and Tapatalk doesn't let you attach files)
[Android Software/Hacking General [Developers Only]] osm0sis:
Found the slow-flash TWRP 3.0.0 issues plaguing many devices affect more than just ln command symlink creation, so I've worked around all of the affected commands in my busybox installer and reuploaded a fixed one to tide us over until TeamWin pushes a new release with the problems fixed. No binary differences in this one so if it installed well for you with the last one there's no need to redownload. :good:

UPDATE-Busybox.Installer.v1.24.1-ALL-signed.zip:

- Use installed busybox binary to create its own symlinks.

- Also use installed busybox binary for cut and rm commands (which are also affected by TWRP3 busybox issues) used in cleanup.

- Only execute rm command once for cleanup by creating a list of flagged files for deletion.

Hopefully that's the last time I'll have to make another busybox fix until 1.25.0 gets released. :fingers-crossed: ;)
[Android Software/Hacking General [Developers Only]] osm0sis:
Not sure I know what to do about this.. you've got:

/system/priv-app/com.google.android.music/

/system/vendor/operator/app/Music2.apk

/system/priv-app/Chrome/

/system/vendor/operator/app/com.android.chrome-1.apk

/system/priv-app/YouTube/

/system/vendor/operator/app/com.google.android.youtube-1.apk

/system/priv-app/com.google.android.apps.docs/

/system/vendor/operator/app/com.google.android.apps.docs-2.apk

/system/priv-app/com.google.android.apps.plus/

/system/vendor/operator/app/com.google.android.apps.plus-1.apk

/system/priv-app/com.google.android.play.games/

/system/vendor/operator/app/com.google.android.play.games-1.apk

Where none of those would normally be in /system/priv-app at all, they'd be in /system/app; it's a pretty crazy/messy looking setup on your device. :eek:

If you can explain to me what's going on I'll see if I can fix it up for you. Also, feel free to tweak and test and sort it out for yourself and send me a pull request like last time. :good:
[Android Software/Hacking General [Developers Only]] bgiesing:
This is how the device came stock so I don't know
[Android Software/Hacking General [Developers Only]] m0han:
is it ok to delete every binary exept busybox-arm64 from the zip?

just wanna keep the file size to the minimum; my device is arm64.
[Android Software/Hacking General [Developers Only]] osm0sis:
Yeah it should still work as long as you only use it on arm64, you'll have to re-sign it or disable zip verification in your recovery though.
[Android Software/Hacking General [Developers Only]] osm0sis:
gappsintegrator: v5.5 - fix free space calculations, combine Marshmallow exclusions, misc fixes:

- ensure matched /data/app strings are at the beginning of the app package name

- fix free space calculations (on some devices/ROMs) by forcing human readable output, to be parsed by script

- combine Marshmallow exclusion lists as they reportedly may not differ after all

https://github.com/osm0sis/gappsintegrator/commit/55c132eab790c351fbac3897e37000c8a2e178c3

And I've switched the link in the OPs to point to the GitHub raw copy of the latest version to simplify things. :good:

If you like the progress I'm making on this project, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!
[Android Software/Hacking General [Developers Only]] Sik-1:
Hey jus reporting in about your busybox, well i installed it on stock deodexed lg v10 rom and when i install trickstermod it automatically sa says this busybox doesnt ha e the applet needed, but works fine with stericons busybox just fine. Its not an issue for me but jus letting you know
[Android Software/Hacking General [Developers Only]] osm0sis:
Hmm definitely can't reproduce the issue on my Nexus 7, so it might be one of the config differences I had to make to get the native Android x64 builds to compile (for reference, Stericson's are 32bit).

Let me know what applet and I'll try to enable it in the next build.
[Android Software/Hacking General [Developers Only]] johnlgalt:
I was all excited that this may be the breakthrough that users who were getting bricked by the N Preview could use, but alas, for N6 ./ N9 and newer, I guess it is still a no go. At any rate, though, thanks for all your hard work on this and all your other scripts and apps.
[Android Software/Hacking General [Developers Only]] Sik-1:
The spplets that came up were swapon/swapoff
[Android Software/Hacking General [Developers Only]] Jarheadflip:
I have a question if im on a cm based rom am i able to install busybox if i dont want to use toybox by cm if so do i just flash your busybox zip or is there something else i need to do to make it work sorry for the noob question and thank you in advance
[Android Software/Hacking General [Developers Only]] m0han:
this thread might interest you.
[Android Software/Hacking General [Developers Only]] osm0sis:
Yep, just flash and forget. ROMs are reliant on the toybox implementations of things so you shouldn't replace it entirely with busybox, but the addition of the busybox apps toybox doesn't have, and the option to use the busybox versions by typing "busybox <applet>" is extremely useful for any script enthusiast. :)
[Android Software/Hacking General [Developers Only]] Jarheadflip:
Thank you
[Android Software/Hacking General [Developers Only]] clambert11:
I'm trying to do my homework here. It looks like I need to install Busybox Installer to use Layers Manager with Systemless Root. (2.68) The goal is to pass SafetyNet so Android Pay will still work.

I tried doing a search in the thread but nothing came up. Does this method of moving Busybox to /su pass SafetyNet checks for AP? Thanks in advance.
[Android Software/Hacking General [Developers Only]] nathanchance:
The latest Layers Manager doesn't use Busybox anymore so this is bit of a moot point but yes, Busybox in /su passes SafetyNet.
[Android Software/Hacking General [Developers Only]] osm0sis:
Updates to the OP!

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-Busybox.Installer.v1.24.2-ALL-signed.zip:

- update to latest busybox (1.24.2) and official patches.

- fix Android x64 config and patch list to allow swaponoff to build correctly again (resolves Trickster incompatibility).

See the related commits here: https://github.com/osm0sis/android-busybox-ndk; along with corresponding fixes to my AIK Build Farm script, which I use to automate updating, patching and cross-compilation to all Android and Android x64 architectures.

UPDATE-Flashlt.Installer.v2.0-signed.zip:

- rename "Flashify" to "Flashlt" since it's always kind of bugged me that I borrowed the name from @cgollner's excellent app, even if it was clearly paying homage.

- installs a .sh script to /data/local/Flashlt which (following from my latest work on AIK-mobile) can be run from a file explorer app (I prefer FX File Explorer) with an image in the same directory to flash a *boot*.img, *recovery*.img or radio*/modem*.img.

- the original recovery flashable zip is now bundled as "Flashlt Recovery Zip" and installed to /sdcard.

- add support for TWRP's new naming scheme (twrp*.img) to both .sh and recovery zip.

- add support for MTD partitions (pulling in the work I did for my flash_image script and @_n0p_'s excellent MTD-Utils static compiles) to the .sh and, if Flashlt is installed to /data/local, the recovery zip as well (to keep the recovery zip small).

- wipe the target partitions before flashing in both .sh and recovery zip.

- by adding the command-line argument "--dump <imgtype>" the .sh will also dump the selected partition (boot, recovery and radio/modem are supported choices), named from the actual partition label.

- support recoveries without busybox (ie. CM Recovery) in recovery zip.

- sign Recovery zip for support of forced zip verification recoveries (ie. CM Recovery, AOSP).

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

Edit: Flashlt v2.2 added a standalone dumpit.sh wrapper and dump trimming, v2.4 added a --notrim argument to circumvent this, and v2.5 added a standalone trimit.sh wrapper and --help arguments to all scripts. Pixel and a/b slot device support was added in v2.8 along with a --slot command to override flashing to the active slot and choose a different one. v3.0 added the --exact argument to allow using precise partition names and access to all device partitions, and v3.4 added --exact-target so that a different partition name than the filename to be flashed can be chosen. v3.8 added the ability to use --slot inactive or --slot both as arguments. v3.9 added logical partition dump/write (including resize/replace) support.
[Android Software/Hacking General [Developers Only]] pkelly517:
I'm surprised the new name got past the XDA filters!

?
[Android Software/Hacking General [Developers Only]] romracer:
Any particular reason you don't have SELinux enabled in your busybox binary? I have to roll my own because I need things like ls -Z or ps -Z.
[Android Software/Hacking General [Developers Only]] osm0sis:
Haha, it didn't. The actual attachment name displays as Fla****. The rest I switched the I (i) to an l (L) because clearly it says "Flash It", not " Fla-****". :p

I used Stericson as the "gold standard" when creating my configs and I don't think he has it set up. I'll take a look at enabling it for the next build to see if I can get it to cross-compile for all 6 architectures. Can you tell me which specific config options you need enabled? Any special patches required that you can point me to? :good:

Edit: If it makes the files much larger I probably won't include it, but I'll check it out.

Edit 2: These appear to be the differences required:

--- busybox.config
+++ busybox-se.config
@@ -35,7 +35,7 @@
-# CONFIG_SELINUX is not set
+CONFIG_SELINUX=y
@@ -51,7 +51,7 @@
-CONFIG_EXTRA_LDLIBS=""
+CONFIG_EXTRA_LDLIBS="pcre"
@@ -138,7 +138,7 @@
-# CONFIG_FEATURE_TAR_SELINUX is not set
+CONFIG_FEATURE_TAR_SELINUX=y
@@ -847,21 +847,21 @@
-# CONFIG_CHCON is not set
-# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
-# CONFIG_GETENFORCE is not set
-# CONFIG_GETSEBOOL is not set
-# CONFIG_LOAD_POLICY is not set
-# CONFIG_MATCHPATHCON is not set
-# CONFIG_RESTORECON is not set
-# CONFIG_RUNCON is not set
-# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
-# CONFIG_SELINUXENABLED is not set
-# CONFIG_SETENFORCE is not set
-# CONFIG_SETFILES is not set
-# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
-# CONFIG_SETSEBOOL is not set
-# CONFIG_SESTATUS is not set
+CONFIG_CHCON=y
+CONFIG_FEATURE_CHCON_LONG_OPTIONS=y
+CONFIG_GETENFORCE=y
+CONFIG_GETSEBOOL=y
+CONFIG_LOAD_POLICY=y
+CONFIG_MATCHPATHCON=y
+CONFIG_RESTORECON=y
+CONFIG_RUNCON=y
+CONFIG_FEATURE_RUNCON_LONG_OPTIONS=y
+CONFIG_SELINUXENABLED=y
+CONFIG_SETENFORCE=y
+CONFIG_SETFILES=y
+CONFIG_FEATURE_SETFILES_CHECK_OPTION=y
+CONFIG_SETSEBOOL=y
+CONFIG_SESTATUS=y

But size-factor aside, it'll be far too tricky for me to get libselinux and libsepol building in tandem with busybox in my NDK+Cygwin setup currently.