yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] PiggyFlooper:
Okay, thank you guys both, I used the method as a backup in case my way doesn't work, either way, what i got is successful- flashing a zip file meant for 5.x+ to a version 4.4x and below- might as well upload what was came up with, it's TBOs Nexus Launcher n wallpaper picker ( the launcher not working in 4.4 )

Wallpaper picker does though

Another question, by using apilevel, does this go by 5.0=50 or 4.4=19, which way applies using apilevel?

Zip- https://db.tt/vQzv3ovo
[Android Software/Hacking General [Developers Only]] osm0sis:
It goes according to the SDK version list [MENTION=4878287]_that[/MENTION] linked for you. KitKat = 19, Lollipop = 21-22, Marshmallow = 23. See my gappsintegrator script on GitHub for an example of how to use them.

Speaking of which, I'd better look into [MENTION=5849464]mikeoswego[/MENTION]'s pull request before I get busy again; I ended up trying to clean install Windows 10 x64 over (my free upgraded) Windows 10 x86 (on a x64 box) yesterday so I could play with Bash on Ubuntu on Windows, but sadly it seems the box is too old for the Windows 10 x64 installer to run correctly. Big time-waster. ;)
[Android Software/Hacking General [Developers Only]] mikeoswego:
I am so frustrated with Win10. I have an older Dell M2400 that with Win7 I couldn't use a video driver newer than 275.33 from 2011 (due to a known problem with how Dell configured the Nvidia card.) When I allowed the Win10 upgrade to push onto it, it immediately boot looped due to a newer driver being used and I had to restore Win7. I was finally able to do a clean install on it and figured out how to use that old video driver and set Win10 to NOT try to update it ever and it worked fine. With the anniversary update, it insists on updating the video driver again, boot loops, can't roll back had to do a system image restore. I suppose I could do a clean install with the anniversary update but it is probably time for a new machine. What a PITA. (I have an older ASUS G50V that also wouldn't upgrade to Win10 but a clean install worked fine and the anniversary update was problem free.)
[Android Software/Hacking General [Developers Only]] Paulo Narley:
[MENTION=4544860]osm0sis[/MENTION]

I do not quite understand about programming language.

More you, considering the amount of contributions to the community, is certainly someone who dominates it.

That said it would be possible to carry this tool for Linux?

[Tool][Win] GOptimize v1.44 (BASH script for CYGWIN) by [MENTION=4665716]gu5t3r[/MENTION]

It would be interesting to see it next to superR's Kitchen of [MENTION=5787964]SuperR.[/MENTION]
[Android Software/Hacking General [Developers Only]] osm0sis:
Eh, I script and I compile. Sometimes I have ideas. ;)

That tool just received an update back in April, so it's still being maintained. There's no Linux equivalent? If no, Cygwin shell is basically bash, do the scripts not work? You probably just need the right binaries installed on your box. I'd ask the author about it in his thread.

Edit: They actually discuss it on the last page of that thread, so there's your answer from the expert. :good:
[Android Software/Hacking General [Developers Only]] Paulo Narley:
OK, thanks for the reply, and thanks for the contributions the community.

I will continue using it in a VM, since I do not have enough knowledge to make the proper associations between the script and the wine.

Thanks again for your attention.

:fingers-crossed::good::highfive:
[Android Software/Hacking General [Developers Only]] mikeoswego:
Thanks for the mentions and for all the work you do on these and other things!
[Android Software/Hacking General [Developers Only]] mattgyver:
[MENTION=4544860]osm0sis[/MENTION], I just tried your adb installer. I have a tf700t on katkiss 6.0.1, and an ATT S4 on JDCTeam's optimized CM13. When I run terminal emulator on either, and try to adb into my firetv, I get "device offline". I know it's not, because I can adb from a windows laptop. Is it something I can fix on my tablet/phone?
[Android Software/Hacking General [Developers Only]] osm0sis:
Hey, you did a lot of great work on that "Major updates" patch set, so I didn't want it to go unmentioned in the v9 commit. :)

Hard to say. On my devices I have a USB-to-microUSB adapter to use my charging cable as micro-to-micro and in that case it depends which end is connected. Next thing to do is enter a root prompt on the client device and type `adb kill-server` then `adb start-server` then try to connect again.

P.S. Unrelated, but, why isn't there an addon.d script yet to retain systemless SuperSU through ROM deltas on ROMs that don't have "flash after update" functionality built-in? *adds to to-do list*
[Android Software/Hacking General [Developers Only]] mikeoswego:
I'm having a bizarre (twilight zone) problem with nano. First, nano works perfectly in terminal on the phone and while in an ADB shell from my Win10 box.

I dual boot the Win10 box into Ubuntu 16.04 and in the native terminal there using ADB shell, the Enter key doesn't work. Nano says "Unbound Key ^J"

If I use ^M, nano still says I'm sending ^J. All other CTRL keys work fine (^V, ^X, ^W, etc.)

The problem exists in ADB shell into TWRP and on both the Motorola and CM roms but only with Nano.

The Ubuntu terminal works fine for every other aspect of using the ADB shell, Enter (or ^M) works as expected everywhere including things like the SQLite3 shell, busybox vi, etc.

I tried creating a new user to see if something was wrong with my config.

I've tried xterm and xterm-color.

I've tried changing the nano wrapper from pcansi to linux, vt100, unknown, etc.

I just recently upgraded to 16.04 from 14.04 but I can't remember if things were ok with 14.04. (I haven't used the Ubuntu side much for a month or two, nano v2.5.3 from the end of May was the first version I used with Android..)

I have an old Lubuntu 14.04 box that I'll go try in a bit, but this is still quite bizarre!

(I just tried my old XT1096 with v2.5.3 and the same problem exists, there it says "Unknown Command" when using the enter key from my Ubuntu setup, but is fine with Win10 booted.)
[Android Software/Hacking General [Developers Only]] Captain_Throwback:
As far as TWRP goes, see here: https://github.com/omnirom/android_bootable_recovery/commit/8323ab53ee4d61a3cdbad5ed39882811d9fb14d2

(that fix will be included in the next TWRP release)
[Android Software/Hacking General [Developers Only]] _that:
That fix affects only TWRP's built-in terminal, not adb shell.
[Android Software/Hacking General [Developers Only]] Captain_Throwback:
Oh yeah, I forgot about this problem, but I know I brought it up to you a while ago.
[Android Software/Hacking General [Developers Only]] mikeoswego:
I found your post about this but as you already know this is a different problem.

I had a chance to use the old Lubuntu 14.04 box to adb shell into the phone and had the same problem with the Enter key resulting in the "Unbound Key ^J" message in nano.

So, I have 2 completely different Ubuntu boxes with the same problem, it's not something wrong with my primary machine. I have no idea how to track down the cause but will be glad to help if I can.
[Android Software/Hacking General [Developers Only]] osm0sis:
Was it an issue with nano 2.61? I'll have to track down the breaking change. :(
[Android Software/Hacking General [Developers Only]] mikeoswego:
Yes, it happens with v2.6.1. A few more bits of information:

The Ubuntu terminal is in UTF-8 encoding while the standard encoding for the Windows terminal is 437 OEM. (chcp 437)

Changing the Windows terminal to UTF-8 with the command "chcp 65001" does not break anything.

Could this have something to do with Windows using CR+LF and Unix using only LF for a newline?

---------- Post added at 11:14 AM ---------- Previous post was at 11:00 AM ----------

I had not tried nano in the TWRP terminal until just now and see that the symptom is the same (Enter key causes [Unbound Key ^J] message.) I wonder if what TWRP is doing in reference to that patch is any different than standard Unix/Linux implementation.
[Android Software/Hacking General [Developers Only]] osm0sis:
Maybe we still need this after all:

https://github.com/Evervolv/android...b568f0b417c1fe3fe8597c600bdbcda4837013f.patch

I was under the impression it worked without it now back when I compiled v2.5.0, but my testing was unfortunately only with adb in Windows (booted and in recovery), the Terminal Emulator app, and AROMA Filemanager's console.

Does the old v2.2.6 binary still linked there work correctly for you when paired with my pcansi terminfo? I'll do a test compile of v2.6.3 with that patch if so, and possibly report it to the bug tracker for a hopeful official fix.
[Android Software/Hacking General [Developers Only]] mikeoswego:
I put the 2.2.6 binary into your 2.6.3 zip installer and the enter key worked properly in TWRP terminal, local terminal on the phone and via ADB shell in both Windows and Ubuntu.

Looks like it will be an easy fix! :good:
[Android Software/Hacking General [Developers Only]] osm0sis:
Hmm or not :confused::

make[2]: Entering directory '/home/Chris/nano-2.6.3/src'
arm-linux-androideabi-gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/usr/local/share/locale\" -DSYSCONFDIR=\"/usr/local/etc\" -D_XOPEN_SOURCE=600 -O3 -ffunction-sections -s -Wall -MT nano.o -MD -MP -MF .deps/nano.Tpo -c -o nano.o nano.c
nano.c: In function 'do_input':
nano.c:1591:17: error: 'NANO_CONTROL_M' undeclared (first use in this function)
input = NANO_CONTROL_M;
^
nano.c:1591:17: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [Makefile:413: nano.o] Error 1

I'll see what I can figure out.

Edit

: Fixed the patch to work with the current nano source, I think.

[MENTION=5849464]mikeoswego[/MENTION] does the attached nano.bin work (unzip) when you place it in the 2.6.3 installer zip? If you overwrote nano instead of nano.bin in the zip on your last test you should download the zip again.

[MENTION=1162986]Captain_Throwback[/MENTION] & [MENTION=4878287]_that[/MENTION], it definitely seems to resolve the related issue in TWRP 3.0.2-0 terminal as well. Is this good or bad with the changes you made for the next version? :eek:

[ Attachment removed ]
[Android Software/Hacking General [Developers Only]] _that:
When you first mentioned the issue, I compared how nano behaved in TWRP's terminal and in adb shell. Since the Enter key worked in adb but not in TWRP terminal, I removed the conversion of CR to LF, then it worked the same in both, without any obvious new problems in other programs. So I think it should be fine.
[Android Software/Hacking General [Developers Only]] mikeoswego:
Yes, I replaced nano.bin with the 2.2.6 nano, not the wrapper. :cool:

The new 2.6.3 nano.bin that you attached also has a working Enter key in all the places, TWRP, phone terminal, ADB shell in both Windows and Ubuntu. :good:

Would you consider restoring the ^G help screens? I can never remember the less frequently used commands that aren't displayed at the bottom.
[Android Software/Hacking General [Developers Only]] osm0sis:
Perfect! Yeah they removed all their control key mappings from nano.h after 2.4 so the old patch doesn't work as-is anymore, but I fixed it by having it swap in character 13 directly instead of using the broken/missing NANO_CONTROL_M define.

Absolutely about the help, I just tried it out and it's only 8kb, so why not? :)

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

- add updated patch for proper enter key handling in adb shell on Linux (and TWRP 3.0.0-3.0.2 terminal)

- change config options to add back help screens

Build instructions updated accordingly. :good:
[Android Software/Hacking General [Developers Only]] mikeoswego:
Thanks, works perfectly! :highfive:
[Android Software/Hacking General [Developers Only]] JudgeDread11:
[MENTION=4544860]osm0sis[/MENTION], is it possible to (easily) modify the su mount script to use it with magisk?

I have just started liking at scripting 3 days ago and still know virtually nothing.

Looking at the script I didn't feel secure to attempt it.

I managed to create a script to make a magisk module that got my device in a bootloop. And the only way to recover was uninstall and reflash magisk, and it's root and Xposed. Meaning all my apps had to be optimized again.

A script like this would have saved me a lot of time.
[Android Software/Hacking General [Developers Only]] osm0sis:
I think magisk just uses its own .img file, right? So all you'd likely have to do is change suimg=/data/su.img to point at the magisk.img and everything would probably work.
[Android Software/Hacking General [Developers Only]] Captain_Throwback:
Yup, I did this exact thing and have been using it for weeks. I gave it to [MENTION=4470081]topjohnwu[/MENTION] a while ago to post in his thread, but he's been busy refining Magisk so I don't think he ever did. Besides he said since I signed the zip it would have issues flashing on non-TWRP recoveries. If someone really wants it I can post it here, but it's really just the SUmount zip with all the "su" changed to "magisk".
[Android Software/Hacking General [Developers Only]] osm0sis:
I've found the opposite, actually; you need test-keys signed zips on non-TWRP with forced zip verification like CMR, or it won't work. And most AOSP/stock recoveries require them as well (which is why SuperSU can be flashed on many devices' stock recovery). Only exceptions are Nexus and Cyanogen Recovery (sans Mod) since they only accept their corporate keys.
[Android Software/Hacking General [Developers Only]] Captain_Throwback:
So your zips are signed using Google's test-keys and signapk.jar?
[Android Software/Hacking General [Developers Only]] osm0sis:
Yup! They also need Chainfire's zipadjust to allow recovery busybox to unzip, so I've automated it as ZipScriptSign in my Complete Shell Script Zip Documentation thread.
[Android Software/Hacking General [Developers Only]] osm0sis:
Done! :p

Instead of just focusing on SuperSU, I decided to take it one step further, so 99-flashafterupdate.sh is now up in the OP to help on any ROM (*cough CM cough*) where there isn't "flash after update" functionality built-in to the delta/nightly upgrade process, flashing any zips found (in order) from /sdcard/FlashAfterUpdate as part of the process (script).

Like my older 999-customkernel.sh addon.d script this one uses an independent subshell so that the ROM zip will continue to flash its new boot.img, so there's a chance mileage may vary with something in /sdcard/FlashAfterUpdate taking too long and not completing due to the OpenRecoveryScript forcing a reboot but in my tests it works very well: SuperSU and my GN Synapse Injector Add-on AK2 zip both flashed on a CM13 nightly auto-update for my GN and it properly waited for the FlashAfterUpdate zips to complete. :cowboy:

And just in time for my N5 and N7 '13 to need custom ROMs. :(;)
[Android Software/Hacking General [Developers Only]] JudgeDread11:
I would like a copy. Because when I looked at the zoo I got confused what were references to the image out whether it were actual calls for su rights. (Like I said I'm a big and just started to look in to this and your script might just help me figure it out a bit more :)
[Android Software/Hacking General [Developers Only]] osm0sis:
There's already one by [MENTION=4470081]topjohnwu[/MENTION] over in [MENTION=6320543]RatchetPanda[/MENTION]'s Magisk zip collection thread: http://xdaforums.com/android/software/collection-magisk-modules-t3445257 :good:

P.S. None of them are "su calls" since in recovery every command is executed as root. ;):)
[Android Software/Hacking General [Developers Only]] Surge1223:
stop adbd

adb kill-server

adb connect localhost

adb localhost -s shell

Will give you adb shell on your own device, you can replace local host with the ip of another. I regularly send crap to my other phones using adb wireless from my angler

Also I'm getting close and closer lol
[Android Software/Hacking General [Developers Only]] mattgyver:
That did it! Thanks, Surge! I did the kill-server command. Stop adbd must have been the key!

Sent from my TARDIS
[Android Software/Hacking General [Developers Only]] Surge1223:
Also I see you guys are taking su mount commands. I probabaly wrote the most insecure, no sanity checking way of mounting my partitions. Seriously the guy who decided to make mount commands so long didn't take us millenials into account

root@angler:/ # mount -o remount,ro /
root@angler:/ # mount -o remount,ro /system
root@angler:/ # touch hi
touch: 'hi': Read-only file system
1|root@angler:/ # mountsu /

mounting /dev/block/platform/soc.0/f9824900.sdhci/by-name/ on /

root@angler:/ # touch hi
root@angler:/ # ls -l hi
-rw------- root root 0 2016-08-23 20:28 hi

root@angler:/data/local/tmp/simg2img # mountsu /system
mounting /dev/block/platform/soc.0/f9824900.sdhci/by-name/system on /system

root@angler:/data/local/tmp/simg2img #

lol I can't be arsed to type in "mount -o remount, rw /" everytime, my goodness.
[Android Software/Hacking General [Developers Only]] Surge1223:
hey random static zip in bound. Deleting the folder so I figured id upload it in case anything is useful

aapt2

acp

adb

aidl

append2simg

fastboot

hexcompare

hexedit

hexedit2

idmap

img2simg

ldconfig

patchelf

simg2img

untgz

viewmem

vim

xxd

a few people asked me for the adb makefile for the old source. Figured id just update this post instead of posting another post

if anyone tries and gets pthread, atexit, dso_handler, or other libc errors, let me know and ill explain more on how to fix those, other than that, figured this might be useful to someone eventually, also used ndk 12 on a Mac, so shouldnt be a problem on linux, sorry for the spam @osm0sis
[Android Software/Hacking General [Developers Only]] :
Might I ask what simg2img and img2img do?
[Android Software/Hacking General [Developers Only]] Surge1223:
Tools for extracting and creating sparse images.
[Android Software/Hacking General [Developers Only]] :
Thanks.

Have you been able to compile the sdat2img or rimg2dat for ARM?
[Android Software/Hacking General [Developers Only]] Surge1223:
Ok, I have to say a few things about this now that I've been asked.

sdat2img isnt even a binary, from what i see its just a python script, and all it does it call 2 other python scripts, so its useless.

rimg2dat idk what that even is? is that a binary someone made? Is there source available? Doesn't really matter though, I dont even know why people want to decompress dat files and recompress them, makes no sense to me. But I guess if you really wanted to you could just just port the functions of blockimagediff.py into a quick little C file and compile it.

I think if someone really wanted to it would be pretty simple to create an executable binary that literally does what the blockimagediff python script lays out.

if you want to read my rant on the topic:

Imho, that thread is just plain embarassing. Not only are people having a hard time using a simple python script, but the fact that the python scripts only function is to call main and provide its args to two other scipts just compounds everything. More so than the lack of discussion about how bsdiff and deltas and patches are involved in the process.

sorry if it came off as me being rude to you, I just had a lot of thoughts about this and have held my tongue because even though I think its a useless thread, its not even among the the pantheon of wrongly placed threads in Software and Hacking. All the guides, how-tos, installers, GUI for basic android debug tools, tools made with glibc instead of bionic and the complete lack of any source code or compilation discussion that live in there.

/rant
[Android Software/Hacking General [Developers Only]] androcraze:
I find sdat2img.py useful for pulling data out of ROMs for other devices than what I carry. I convert the system.new.dat file, mount it, and rip to my heart's content. Is there a simpler way of doing this?

I'm missing what other python scripts it's calling.

simg2img is very useful as well. I compile the linux executable directly from the source code. Works for the Google factory images (some of them, anyway).
[Android Software/Hacking General [Developers Only]] Surge1223:
You're right, I was thinking of img2sdat.py. I just took a look at the sdat2img.py and it looks much better, although I don't really see the the point, isn't this what the updater script does when you flash a a block based image anyways? Also aosp does this when you build block based lol idk I guess i might just be missing something. I thought all the people using these scripts were trying to patch ota updates or didn't have a transfer list to start with or something lol. It's be like converting a raw system.img.ext4 to img then mounting it and and adding busybox, su, whatever else you want, then repacking it back up and flashing it, where as most would just flash the system.img.ext4 first, then while in recovery just adding whatever you want then lol. Idk I guess I just don't see the point of what's going on with wanting do it outside of recovery
[Android Software/Hacking General [Developers Only]] osm0sis:
I don't usually respond to technical PMs, but this one brought up something I want to clarify so I'll address it here in the appropriate thread.

[MENTION=7557889]Adith Balan[/MENTION], init.d is pretty much deprecated in favor of su.d scripts, via SuperSU. If you do need init.d for some reason then the injector isn't likely the route you'll want to go, you'll want to bake it directly into the ROM or kernel using busybox run-parts. The injector is just an experiment of a way to force basic init.d support with no external binary, on a locked AOSP recovery/bootloader.

Besides, I'm not sure it entirely worked with Marshmallow and it probably won't work with Nougat. ;)
[Android Software/Hacking General [Developers Only]] wrongway213:
Hey guys - hoping there may be a script or something that can be done to fix my Nexus 6 nightmare. I totally messed perms up for /root dirs in recovery - tried both the perm fix zip from here and TWRP fix perms, no luck. Nandroid no luck either. I literally cannot wipe internal - no USB connectivity, Qi charger is all I can use. Is there absolutely any script or anything that can be done to fix my Shamu? SS attached to show a few dirs. I'd be more than appreciative of any help - desperate here, not gonna lie.
[Android Software/Hacking General [Developers Only]] osm0sis:
You should probably be making a Q&A thread in your device forum.

Root dir perms are set in the ramdisk, ie. a reboot should fix it, so I'm not sure what's going on with your device. Maybe factory image flash after a fastboot format of everything?

If you want any further reply please just link to a Q&A thread and I'll attempt to help you there.
[Android Software/Hacking General [Developers Only]] wrongway213:
That's the thing - I cannot fastboot as I cannot connect via USB - if I wipe internal I cannot actually get an OS on here. Qi wireless charger is how I'm still running. I'm up to literally any fix as long as I can do it with a broken USB port. Thanks for such prompt response also!

Edit: sorry, missed your edit. Will link to q & a post in this post. Thanks again!
[Android Software/Hacking General [Developers Only]] Captain_Throwback:
Magisk also handles this well, and provides a few options for running scripts without requiring root.