yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] Captain_Throwback:
Hey [MENTION=4544860]osm0sis[/MENTION]!

I wanted to stop by and say thanks for the nano binary/zip - I find it very useful for being able to modify files directly in the TWRP Terminal. However, since attempting to do this, I've come across an issue. For some reason, I'm unable to use the "Enter" key when in the TWRP Terminal. For example, if I want to edit /data/.supersu and open it with nano, I can navigate with the arrow keys, backspace, and type new data. However, if I want to save those changes, I'm unable to do so, because I can't press the Enter key. It appears to produce a double vibration when trying to press it, and the key never registers. Do you think this is something that can be fixed?
[Android Software/Hacking General [Developers Only]] _that:
The "Enter" key in TWRP's terminal sends ASCII code 10 which is understood correctly by the shell's line editor and by busybox vi. I don't remember why I explicitly translated CR to LF (must be a leftover from an early hack), but removing that code makes nano happy.

Fix: https://gerrit.omnirom.org/#/c/17941/
[Android Software/Hacking General [Developers Only]] osm0sis:
Ah! Thanks for noticing that and bringing it up. I had discovered that awhile back but forgot to mention it! :silly:

Perfect! Thanks! I was hoping it was something easily fixed on TWRP's end since I noticed everything worked fine within AROMA Filemanager's Console. :)
[Android Software/Hacking General [Developers Only]] PiggyFlooper:
Hi [MENTION=4544860]osm0sis[/MENTION]

I can't get your gapps integrator to run, both in SManager and Term Emulator it errors in line 6: syntax error: ')' unexpected, which I believe is-

freespace() {

I uncommented everything to easily find where it was messing up at-

https://db.tt/6maEqqyb

Why is it erroring?
[Android Software/Hacking General [Developers Only]] osm0sis:
Works fine here from Terminal Emulator, but you should really be running it as a su.d script, either from /system/su.d or /su/su.d; Make sure you download and extract it from the repo.zip link if you're having trouble with line-endings (ie. you shouldn't be copy-pasting it from GitHub):

http://xdaforums.com/showpost.php?p=66854770&postcount=697
[Android Software/Hacking General [Developers Only]] fhem:
[MENTION=1143630]osmosis[/MENTION] I really appreciate all your great work. I use and have played with many of your works. As an old retired guy I have really learned a lot looking at all your scripts/works, etc and trying to understand what you are doing. It is one of my hobbies LOL.

OK -- Now my question!! I know SuperR is using your BB zip in his kitchen so......... would it be ok if I try to use your bb.zip with my aosp builds. I currently use cm bionic bb but I would like to try yours. Of course I will give credit.

Thanks in advance.
[Android Software/Hacking General [Developers Only]] osm0sis:
Yup! No problem at all. Thanks for the kind words and support! I'll look forward to checking out your ROM. :)
[Android Software/Hacking General [Developers Only]] fhem:
Working great on the three devices ( N6, N6P, & N9 ) for which I build and use.

https://github.com/fwhem/platform_vendor_noobbuilds/commit/0df4fbce3ed82a01438c83917c9772a48340f96f

https://github.com/fwhem/platform_build/commit/ae1703c267c1ed11c6260995ab413fce05c3ccb0

Thank you sir. I gotta buy you a cuppa!!

EDIT: [MENTION=4544860]osm0sis[/MENTION] here's that cuppa -> Confirmation number: 4686293632501151M

Thanks again.
[Android Software/Hacking General [Developers Only]] osm0sis:
Thank you!

Donations are few and far between so I truly appreciate that! :)

It helps me explain to my girlfriend why I spend so much time messing around with my phone in my free time (;)), and helps keep me motivated to put the time in to trying out new ideas. :cowboy:

And, actually, speaking of which.. :D

UPDATE-Adreno.Systemless.Installer-signed.zip:

http://xdaforums.com/showpost.php?p=67117557&postcount=173

For use with Qualcomm's updated GPU drivers packages for N5, N6 and N7 '13.
[Android Software/Hacking General [Developers Only]] fhem:
You are very welcome --- I believe donating to devs who are active and supportive of the community. It is good for us all.

BTW: Let's go Pens!!!!!!! and thanks for sending us Sid the Kid
[Android Software/Hacking General [Developers Only]] dingermtb:
I just had to chime in, being from "The Burgh"... yes, Let's go Pens

Sent from Outside the 9 using my Zombiefied Exodus OnyX
[Android Software/Hacking General [Developers Only]] mikeoswego:
Finally had a chance to check this out on the Motorola stock based 5.1 (SDK 22) rom that I maintain for the XT1096 Verizon version of the MotoX.

You've got a workaround already in place for /sdcard not being writable by root. It never becomes writeable, shell can write to it but not root. There is a symlink for /sdcard to /storage/emulated/legacy which works as shell but as root, the path changes to /storage/emulated/0 I can create a symlink from 0 to legacy but that doesn't stick after a reboot. This is not your fault, of course, but I thought I would report it. I've modified the script to just write the log to /data/local and check for access there instead of /sdcard.

The other problem with this rom is that the chmod included in their version of toybox doesn't work with multiple filenames or wildcards, so the line

chmod 644 $sysapk/$sysname.apk $sysapk/lib/*/*;

fails. Changing that line to

busybox chmod 644 $sysapk/$sysname.apk $sysapk/lib/*/*;

fixes the problem. (I install BusyBox in the ROM, Moto doesn't include it.) I imagine this problem might be widespread so hopefully the info helps future troubleshooting.

Thanks for your work!
[Android Software/Hacking General [Developers Only]] osm0sis:
Did some - work trying to crack the bootloader lockstates for the N5X this week, and while it isn't looking too good due to what is likely a secure auth token, it did present me with the opportunity to be satisfied that Factory Reset Protection (FRP) is being implemented consistently enough to make support for it generalized for all devices detected with it.

This should be pretty future-proof since it gets the FRP persist partition from getprop and then (since Google's spec says it's the last byte) calculates the offset on-the-fly. This means I shouldn't need to update the zip to support any new FRP devices unless there's an actual unlock method to be added. :good:

Flashlt also gained a way to circumvent my fancy dump trimming method in case raw dumps are needed for some reason. ;)

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-Nexus.BootUnlocker-signed.zip:

- refactor so that FRP is now automatically detected and toggled for any device that doesn't match for a classic unlock.

- simplify, cut down on duplication, pulling model name from getprop and combining all devices with the same offsets.

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

- add --notrim argument to "dumpit" functionality.

Edit: Re-uploaded Nexus BootUnlocker with a couple more cleanups (shouldn't affect anything functionally) since it likely won't need to be updated again for a while.
[Android Software/Hacking General [Developers Only]] skulldreamz:
Thanks my dude for the high degree of awesome ideas that you turn into code that can be executed on our devices. I really really appreciate everything that you do for the xda community. Thanks again and have a couple beers on me 7V6057044H099262K
[Android Software/Hacking General [Developers Only]] osm0sis:
Thanks so much for the support and the extremely kind words! :D
[Android Software/Hacking General [Developers Only]] osm0sis:
New nano release with the fix for the Android hang bug I reported, now included officially! Build instructions updated accordingly. :)

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

- update to latest nano official source.

- fix to hack around new detected "-git" versioning.

I also submitted a script to Open GApps today to fix the GApps issue with Google Dialer causing reboots when it's not set as default (edit: final commit now live), and made a Pull Request to make the official BootUnlocker app show some love to the rest of the OnePlus line. ;) :cowboy:
[Android Software/Hacking General [Developers Only]] nathanchance:
[MENTION=4544860]osm0sis[/MENTION], it seems that the nano zip is showing as an invalid attachment on Chrome, is it downloadable for you?
[Android Software/Hacking General [Developers Only]] osm0sis:
It appears XDA is broken/cached again, so I'll have to reup it when it gets resolved.

Edit: [MENTION=6842057]nathanchance[/MENTION], works now, no reup required I guess! Seems to have worked itself out. :)
[Android Software/Hacking General [Developers Only]] nathanchance:
Awesome, all flashed and good to go. Thank you sir :good:
[Android Software/Hacking General [Developers Only]] 808phoneaddict:
Hey I needed to fix my sdcard permissions, apparently, and came here and downloaded and flashed your script for my nexus 6

I couldn't take and save screenshots and phone would say that I was out of memory...

Your script worked perfectly! Thanks!
[Android Software/Hacking General [Developers Only]] The Fer-Shiz-Nizzle:
[MENTION=4544860]osm0sis[/MENTION]

I have seen your profile in many of my subscribed threads on XDA, and have meant to donate to you simply out of appreciation for your contributions. Well, apparently I had a few too many , and was messing around with some su.d scripts. The result was a bootloop. My latest nandroid was a couple weeks ago, and I didn't want to lose my current data. I remembered your SUmount.zip. Unfortunately, my phone is currently my only source of Internet. So I restored my old backup, went to XDA, downloaded your SUmount.zip...restored my new backup, flashed the zip and deleted the offending su.d script and rebooted successfully. Thank you so much for this and all your other contributions! I might not need them, but if I do, I know where to find them.

Thanks,

Transaction ID:*5MV19910S8484252P
[Android Software/Hacking General [Developers Only]] osm0sis:
My general goal has been to fill in whatever gaps I see in my daily use/tinkering, in a "how can I make this easier for myself?" sort of way, so it's always great to hear others are finding my tools useful, or a good success story using one of them! I am humbled by your kind words and generous support. Thank you! :)
[Android Software/Hacking General [Developers Only]] fhem:
I don't get it (them not you)!!! They showing it stable here???
[Android Software/Hacking General [Developers Only]] osm0sis:
Git branch labels versus how they actually treat each major revision; if you scroll down on the official homepage you find each 1.x.0 release is deemed "unstable," then they add some bug fixes from feedback to that branch, and release a "stable" 1.x.1. :)
[Android Software/Hacking General [Developers Only]] fhem:
Ok now i get it LOL everyday a learning experience!!!! They moving on to branch branch 1.25 now.
[Android Software/Hacking General [Developers Only]] skulldreamz:
Unstable of course but Now 1.26 is out, that was quick :D
[Android Software/Hacking General [Developers Only]] _that:
It's not "out" just because the version number has changed. There's no release announcement and no tag, so it's not out.
[Android Software/Hacking General [Developers Only]] osm0sis:
Yes, that's just them beginning the new development cycle (which will result in 1.26):

https://git.busybox.net/busybox/log/?h=master
[Android Software/Hacking General [Developers Only]] skulldreamz:
I'm running 1.26 since yesterday and the applets that i use seem stable to me so far, but thanks [MENTION=4544860]osm0sis[/MENTION] for explaining that in a friendly manner. Again appreciate all your work.
[Android Software/Hacking General [Developers Only]] skulldreamz:
What do you consider out? I'm using it and the applets work fine so i am announcing it and it is out when it's bundled in a kernel and works fine the way i interrupt it.

https://www.dropbox.com/s/f9yoemrkgy34a71/Screenshot_2016-06-29-11-03-33.png?dl=0
[Android Software/Hacking General [Developers Only]] osm0sis:
While it's true you can make/run builds from master branch HEAD of the busybox git repo, and the version number is set for the next major release (1.26.0 in this case), that still does not make that version released and definitely does not make it stable. That's just how a lot of people run their development cycle; they set the next version number at the beginning rather than the end, and [MENTION=4878287]_that[/MENTION] is correct, they add a version git commit tag, fork to a new 1_x_stable branch, and make an official announcement when it's done.

I'd also like to reiterate they have their release process for a reason. Look through the patch directories for all the recent releases, you'll see that they always find something broken and needing patching, especially in the 1.x.0 unstable releases.

I'm waiting on 1.25.1 stable for this very reason (which will come from the 1_25_stable branch), since even though it may run now, I'd rather wait until busybox themselves declare it stable before I include it in all my projects, since there's a better chance nothing is broken that way.
[Android Software/Hacking General [Developers Only]] skulldreamz:
Makes total sense, always appreciate your enlightenment :D

---------- Post added at 04:30 PM ---------- Previous post was at 04:14 PM ----------

@osm0sis just curious are you having trouble with a new applet for example blkdiscard. I thought this was a much needed applet for a while now, even though you can always dd and dev/null a block, this has helped with a shorter cmdline writeout and adds the extra function of not needing the fastboot binary to remove a block if your not around a pc at the time. Always love to hear your spot on added insight, :D
[Android Software/Hacking General [Developers Only]] mikeoswego:
I noticed the other day that the BusyBox version of 'ls' doesn't support the '-Z' option to show security contexts. Do you know if that is intentional, an oversight, or..?
[Android Software/Hacking General [Developers Only]] skulldreamz:
https://www.dropbox.com/s/x0ep8alnyxuym3a/Screenshot_2016-06-29-12-39-44.png?dl=0
[Android Software/Hacking General [Developers Only]] mikeoswego:
Are you saying that 'ls -Z' has been added in v1.26? On mine, the stock/toolbox 'ls' is found in /system/bin before the BusyBox link in /system/xbin. Stock/toolbox 'ls -Z' works, BusyBox doesn't. Screenshot attached. (I discovered this after installing BusyBox into a CM 13 rom which apparently has xbin before bin in the path.)
[Android Software/Hacking General [Developers Only]] osm0sis:
Not sure what is up with it since I haven't done the bring-up to 1.25 for my NDK patchset yet. I'll try to enable it when we do get there though.

It's been a build config option for a few versions now, but ls -Z (and the other context commands) only works if you compile busybox with the selinux libraries. Most don't include them because they're pretty big libraries and add a bit too much bulk to a static binary if it's not necessary.

Here's the last time we discussed it here and I outlined the required config/build changes required if someone wanted to build their own:

http://xdaforums.com/showthread.php?p=66160631#post66160631
[Android Software/Hacking General [Developers Only]] bigsupersquid:
Just a bump. the tools keep getting updated.

I keep finding myself back here from time to time for useful little gems like the sdcard permissions fixer for MM.

Thanks again for sharing all your awesome work, Osmosis!
[Android Software/Hacking General [Developers Only]] osm0sis:
Another official update to nano came out, so it's now up in the OP. :)

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

- update to latest nano official source.
[Android Software/Hacking General [Developers Only]] Captain_Throwback:
Did you ever get the newer static adb built? I'm still looking for this and hoping someone can make it happen :).
[Android Software/Hacking General [Developers Only]] Surge1223:
Ironically I've been working on this lately. Compiling the dependencies between classes lol. When I get home, maybe I'll watch the ending of The Last of the Mohicans, or something and get in the zone and knock out a new adb lolol.
[Android Software/Hacking General [Developers Only]] osm0sis:
Yeah! I also thought it was funny that I'd only just asked you about this on Hangouts like 3 hours before Captain's post. You're on our minds man! :laugh::highfive:
[Android Software/Hacking General [Developers Only]] mikeoswego:
I had some time to play around with gappsintegrator on a Moto X Pure with the stock 6.0 rom, systemless root and Open GApps Super package installed. I found that for some reason, getprop wasn't working while running from /su/su.d. This caused the script to attempt to process the upgraded GApps using the KitKat rules since $sdkver was less than 20. Since the du format was wrong for the free space check, the script would fail indicating no free space.

This change fixes that:

Original:
# get SDK version to perform different actions due to /data/app layout changes
sdkver=`getprop ro.build.version.sdk`;

New:
# get SDK version to perform different actions due to /data/app layout changes
sdkver=`grep "ro.build.version.sdk" /system/build.prop | cut -d\= -f2`;

# abort if failed to get SDK version
if [ ! "$sdkver" ]; then
abort=1;
logbuff echo -ne "\n\x20* -- SDK version unknown";
fi;

As a cosmetic change since /su/su.d is an option:

Original:
# chmod -R 755 /system/etc/init.d /system/su.d

New:
# chmod -R 755 /system/etc/init.d /system/su.d /su/su.d

Finally, an app that was notbeing optimized in the Super GApps package was Google Earth and with the Motorola rom, some of their apps like their camera, gallery, Moto Voice are updated from the play store; so I made this change:

Original:
for i in $(ls /data/app/ | grep -E '^com.android|^com.google.android|^com.chrome'); do

New:
for i in $(ls /data/app/ | grep -E '^com.android|^com.google.android|^com.google.earth|^com.chrome|^com.motorola'); do

Interestingly, SafetyNet still passes on this ROM after integrating the GApps (I also had some things in /system/xbin before discovering /su/xbin and SafetyNet didn't care about that either.)

Last comment: The forcerebuild for apps like Calendar and keyboard/inputmethod apps where runtime-permissions.xml is deleted causes all apps that need location permission to require that to be set again, some apps like Call Recorder by Skavalex lost all their permissions; yet other apps seemed to have their permissions restored from somewhere (like Google keyboard.) Anyway, not a deal breaker, just thought I'd mention it.

Thanks for your work on this, it saves almost 500mb in data after integration with my set of GApps and Moto Apps!
[Android Software/Hacking General [Developers Only]] jabarel:
UPDATE-Nexus.BootUnlocker works for nexus 5x too?
[Android Software/Hacking General [Developers Only]] Surge1223:
So at this point it became easier for me to port the aosp build system to arm, since I would have to recompile a lot of libs for newer dependencies.

I've hit a bit of a snag and not sure how to proceed, android switched to clang not to long ago and depreciated alot of their ndk support libs, like stlport no longer exports the includes needed for streams. This is solveable, but requires removing a few namespaces from some source files.

If anyone has any idea how I can get ios stream includes built, by all means let me know.

I did manage to get the newest adb source buildadble on arm though, granted it doesn't produce a binary because of the undefined references.

on the brightside, I did however completely rebuild libc and it now it seems like i have a full static and shared version of what aosp so poorly builds, libc.so is one of the most annoying libs in android, usually because the 3 morons running the NDK for google dont know how to compile right. Yes thats a a very harsh claim, but seriously ever release of the ndk butchers or messes up libc in someway, whether its because they dont know how to make shared libraries properly (as is kinda evident by their cflags and ldflags passed) , or that they dont care is up for debate lol.
[Android Software/Hacking General [Developers Only]] bigsupersquid:
Can you share your android_build directory fixes (and any other critical patches you noticed) for arm host? I've been intermittently messing around for years trying to get that working more than the little bit I've had success with.

I'd be more than happy to continue messing around with arm building and maybe I'd even be lucky enough to stumble across the fixes you need in the process.
[Android Software/Hacking General [Developers Only]] Surge1223:
Yeah definitely. Yeah it was a bit of of mess, but since I had python and gcc already compiled for arm, i thought I might as well try to build natively. It can definitely use a lot of fixes, I've been working on it on and off, mostly because I wanted to see if i could compile aapt from my device statically. (just achieved that today).

there aren't very many good resources on how to do all this so I'd be happy to post it up on git.
[Android Software/Hacking General [Developers Only]] osm0sis:
Only to toggle `fastboot oem unlock`, as per the blurb in the OP.

Looks good! Can you open a pull request for those changes?
[Android Software/Hacking General [Developers Only]] mikeoswego:
Done (I think, first time doing this!)

On the deletion of runtime-permissions.xml, did you ever try just removing the lines referencing the integrated app instead of deleting the entire file? If not, I'll experiment with that. Or maybe it would be possible to store a backup and then restore the lines for apps not listed in the rebuilt file.
[Android Software/Hacking General [Developers Only]] osm0sis:
Nice! Thanks! Noticed you had a GitHub account, so figured you might as well get direct credit for the commit changes. :)

I seem to recall trying it every which way before ending up killing the .xml file altogether, and it was only in forcing the complete rebuild that saved the device from the dreaded System UI crashes. Here's my little write-up where I first introduced it in v8: http://xdaforums.com/showthread.php?p=66716689#post66716689

Edit: Yup, reviewed my Hangouts conversation with [MENTION=6404745]MastahF[/MENTION] where we figured it out and more surgical edit attempts showed to be pointless since it's not actually runtime-permissions.xml itself that needed a rebuild, but fully deleting it is the only trigger we could find for whatever process works around those newer APKs causing the app renumbering/breakage.

Feel free to try some more things out though, I don't think I tried rebuilding it and then putting the old one back; you could have it do that and force another reboot directly after only on those blacklisted apps so there is no gap where the rebuilt one gets actively used.. might work. :D
[Android Software/Hacking General [Developers Only]] mikeoswego:
Thanks, excellent info! So. maybe find all the runtime-permissions.xml files, make backup(s), delete them, wait around for it/them to reappear, restore the backup(s) and force reboot would do the trick. I'll work on that.
[Android Software/Hacking General [Developers Only]] edu4rd0zs:
When I read these comments, I feel like a little kid listening to the adults talking. Nothing makes sense!! lol

As always, I appreciate what you guys do and share it with the community
[Android Software/Hacking General [Developers Only]] riyosakura:
Wow, this is what a starter devs need. :D
[Android Software/Hacking General [Developers Only]] skulldreamz:
Don't stop, all of a sudden pieces will start to fall in place and you'll be like I'm chilling at the adult table, lol. Nah but stick to it and it really does get easier, well some of it, haha :D

[MENTION=4544860]osm0sis[/MENTION] = great great great grandfather table ;)