yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] crispyduck:
Hi, I am using the flashafterupdate script to flash a custom kernel on my Xiaomi Redmi Note 4 after Lineage OS OTA.

I usually store the "FlashAfterUpdate" folder on my external SD, as my device is encrypted and data is not decrypted while a OTA update.

As I want to use a second SIM, I can't anymore use the external SD on my devices. So I don't know where I should save the "FlashAfterUpdate" folder.

Thinking of putting the files to /system/... and back them up with a additional addon.d script.

Or is there another partition/place where I could save the zips unencrypted?

Or any other way to automatically flash zips after OTA automatically on a encrypted device?

THX

Crispyduck
[Android Software/Hacking General [Developers Only]] TKruzze:
I should have been more clear. I absolutely still use TiBu regularly. Just not for SMS and MMS backups. I bought it 8 years ago and still use it on all my devices daily.
[Android Software/Hacking General [Developers Only]] osm0sis:
If your device has /cache then definitely /cache. /persist would be another option if there's enough space in it on your device to hold the zips you need. Might just need to add something to mount /persist to the script if that's what you end up having to go with.

If you can find a place that works please report back, I don't have a test device with encrypted Lineage to test on.
[Android Software/Hacking General [Developers Only]] osm0sis:
This is the appropriate thread for your (probable) Fla**** question. No, not automatically, since the way Fla**** works by default is partition name matching. You could use the newer advanced exact and target command-line options to dump/write that partition explicitly.
[Android Software/Hacking General [Developers Only]] osm0sis:
Try and let me know! :)
[Android Software/Hacking General [Developers Only]] Setting.Out:
To be honest, I don't think the script works.. I still have the apps eating away on the battery...
[Android Software/Hacking General [Developers Only]] memaro_maro:
why not just fully rooted and get exposed installer + bootmanager + greenify = solved

or try renice scripts~

*i used this to get proper deep sleep + battery life (dont know if it just placebo)

su~

# Tweaking processes at wake

# renice -1 `pidof com.android.phone`;

# renice -1 `pidof com.android.mms`; # Text message app

# renice -1 `pidof com.swype.android.inputmethod`; # Keyboard

# renice -1 `pidof com.sec.android.app.controlpanel`; # Task manager

# renice -1 `pidof com.android.systemui`; # Status bar

# renice -1 `pidof com.android.settings`; # Settings menu

# renice -1 `pidof com.android.vending`; # Market app

# renice -1 `pidof com.sec.android.app.camera`; # Camera app

# renice -1 `pidof android.process.acore`;

* just an idea.. just do what u think best
[Android Software/Hacking General [Developers Only]] Setting.Out:
I'll try reniceing.. Thanks.. :)
[Android Software/Hacking General [Developers Only]] osm0sis:
Those are all #comments though. :confused:
[Android Software/Hacking General [Developers Only]] memaro_maro:
those copied from init.d script ~ (-1) echo wt mod's binaries. but busybox still got ' renice' applet. i dont know the correct command

edit * setting.out good in init.d scripts
[Android Software/Hacking General [Developers Only]] Setting.Out:
I know about reniceing... No worries.. I'll let you know if it helps.. :)
[Android Software/Hacking General [Developers Only]] osm0sis:
And 10000 Thanks right back at you, xda! ;)

Pretty cool to have caught it before it rolled over. :)
[Android Software/Hacking General [Developers Only]] caspboy:
[MENTION=4544860]osm0sis[/MENTION]

I'm a rom dev, and i was wondering if theres a way to manually add xposed framework to a rom so it will flash with the installation?
[Android Software/Hacking General [Developers Only]] osm0sis:
Hey! :)

I'm not sure rovo recommends that , if you read the OP of the Xposed thread, but you could just add my install script to your ROM installation. :good:
[Android Software/Hacking General [Developers Only]] osm0sis:
New project released, linked in the OP:

AnyKernel 2.0 -- Flashable Zip Template for Kernel Releases with Ramdisk Modifications

AnyKernel was a simple template for an update.zip that could apply any kernel to any ROM, regardless of ramdisk. AnyKernel 2.0 pushes the format even further by allowing kernel developers to modify the underlying ramdisk for kernel feature support easily using a number of included command methods along with properties and variables to customize the install experience.

Tell your favorite kernel devs. ;)
[Android Software/Hacking General [Developers Only]] caspboy:
so now devs can use kernels from other devices with their roms?
[Android Software/Hacking General [Developers Only]] osm0sis:
No. That's crazy talk. :laugh:;)

The concept of AnyKernel has been around for awhile, (originally by Koushik Dutta/ClockworkMod,) which allows device-specific kernels to be flashed over device-specific ROMs and use the ramdisk that came with the ROM to reduce the chance of any issues arising from the custom kernel pairing.

The drawback to this is that some kernels require modifications to the ramdisk to enable/set up kernel features, but in the old AnyKernel format there was no way to do this. Until now. :D

AnyKernel 2.0 makes it easy for kernel devs to use a number of simple command methods to automate the process of adding tweaks into a ROM's underlying ramdisk during the flashing process. :good:
[Android Software/Hacking General [Developers Only]] caspboy:
thats awesome! Maybe i'll use this in my next rom:D Thanks for actually "dumbing" it down for me - not lots of genius peoples do that:laugh::good:
[Android Software/Hacking General [Developers Only]] osm0sis:
Hey, no problem man! It's for kernels though, just to be clear. :)
[Android Software/Hacking General [Developers Only]] Droiderat:
Franco kernel vs DirtyV/SmittyV

[MENTION=1143630]osmosis[/MENTION]

I have a GNex (maguro), running CM11 nightlies. While I see from your signature that you personally use "cwm-franco.Kernel-tuna-nightly-r396-AnyKernel", I am aware that you also provide help on RamDisk configuration to other kernel developers, such as DirtyV.

Is there a source that compares the current Franco kernel to the DirtyV/SmittyV? Stated another way, why would someone prefer one over the other?

Many thanks.
[Android Software/Hacking General [Developers Only]] osm0sis:
I also just fixed up Fancy Kernel's ramdisk at boype's request. I don't play favorites. ;)

Truth be told this very minute I'm running my DirtyV-RSR-Synapsed versions (currently 3.8.14 at http://v.ht/osmod) since I'm very involved over there right now with making Synapse support as cool and complete as it can be. Constantly tweaking on my PC, rebuilding the ramdisk and reflashing. However, the franco.Kernel-r395 zip sits on my sdcard as the first thing I flash after a ROM.

In a nutshell: franco.Kernel has ASRAM and is rock ****ing solid, though clearly not in the most active state of development, meaning there may be some advancements it doesn't have (yet). DirtyV has SuperRAM (or ASRAM or no extra memory at all, if you prefer, depending on the build) and is in constant development, which means the latest ideas/features/testing/improvements but also comes with its ups and downs in terms of stability/bugs.

Really, they're both amazing, man. Try them both, and Fancy and Grakernel and ASKP while you're at. :)
[Android Software/Hacking General [Developers Only]] osm0sis:
I just finished up ARM versions of my ramdisk editing tools!

Android Image Kitchen - Mobile Edition (AIK-mobile):

http://xdaforums.com/showthread.php?p=51322566#post51322566

All compiled in the kbox2 build environment I set up on my Nexus 7 2013. :D

My next tricks will be to do a straight Linux version (often requested) and update AnyKernel 2.0 with my own compiles and maybe multiple compression support. :cowboy:
[Android Software/Hacking General [Developers Only]] :
Thanks for letting me know about kbox. Never heard of it until now. Normally been using SGit and/or AIDE for git support. Also used CCTools for gcc support in regards to compilations of open sources. I'm curious to see how much more kbox will benefit in comparison to CCTools. Thanks for sharing.
[Android Software/Hacking General [Developers Only]] HemanthJabalpuri:
Actually firmware means the zip package of my device..sorry..

I want to flash the modem.img from that package..

there is modem.img with name NON-HLOS.bin...

Partion name is modem....in by-name....

In that zip only it is named as NON-HLOS.bin
[Android Software/Hacking General [Developers Only]] crispyduck:
Thanks, works perfect with /cache !

/persist is a bit to small to hold the kernel zip.
[Android Software/Hacking General [Developers Only]] Stephinnoye:
Hi, I am using HTC one m8 with lineage ROM 16.0 (pie)

Can I use this module without any issue?

Thanks

---------- Post added at 02:19 ---------- Previous post was at 02:18 ----------

Hi, I am using HTC one m8 with lineage ROM 16.0 (pie)

Can I use this module without any issue?

Thanks
[Android Software/Hacking General [Developers Only]] madbat99:
What module?
[Android Software/Hacking General [Developers Only]] Rayane Kch:
Thanks

Hey i'm surprised this thread is active i just wanted to say thank you for your awesome work. Nano text editor saved my phone :D
[Android Software/Hacking General [Developers Only]] osm0sis:
Surprised? Thanks, I guess?
[Android Software/Hacking General [Developers Only]] Rayane Kch:
This thread is 6 years old of course i'm surprised ???
[Android Software/Hacking General [Developers Only]] madbat99:
And components, zips, and scripts are updated constantly. He's been keeping up on his stuff for that entire time.

It's not a ROM thread, or a device specific, or even Android version specific topic. So it doesn't have the same kind of short shelf life.
[Android Software/Hacking General [Developers Only]] Rayane Kch:
ok i see now :)
[Android Software/Hacking General [Developers Only]] droople:
Hi, I installed busybox module on my mi mix2s, Eu.rom, Android pie.

After installation, it seems that the phone keep booting forever, I uninstalled the module, everything becomes normal.

I'm just wondering that is this normal?

Regards
[Android Software/Hacking General [Developers Only]] osm0sis:
Obviously not normal. Provide install logs maybe.
[Android Software/Hacking General [Developers Only]] droople:
Thank you for the quick response

Here is the log

Copying zip to temp directory

- Installing Busybox_for_Android_NDK-1.29.3.zip

update-binary: line 35: /system/bin/make_ext4fs: not found

mke2fs 1.43.3 (04-Sep-2016)

Busybox Installer Script

mount: can't read '/etc/fstab': No such file or directory

mount: can't read '/etc/fstab': No such file or directory

mount: can't read '/etc/fstab': No such file or directory

by osm0sis @ xda-developers

Mounting...

Extracting files...

Archive: /data/user/0/com.klzQI.Pm.gpe.y.f/cache/install.zip

creating: META-INF/

inflating: META-INF/CERT.RSA

inflating: META-INF/CERT.SF

inflating: META-INF/MANIFEST.MF

creating: META-INF/com/

creating: META-INF/com/google/

creating: META-INF/com/google/android/

umount: can't unmount /dev/tmp/magisk_merge: No such file or directory

inflating: META-INF/com/google/android/update-binary

inflating: META-INF/com/google/android/updater-script

inflating: README.md

inflating: busybox-arm

inflating: busybox-arm64

inflating: busybox-mips

inflating: busybox-mips64

inflating: busybox-x86

inflating: busybox-x86_64

inflating: module.prop

Installing...

Using architecture: arm64

Using path: /dev/tmp/magisk_merge/busybox-ndk/system/xbin

Cleaning...

Creating symlinks...

Unmounting...

umount: can't unmount /system: Device or resource busy

umount: can't unmount /data: Device or resource busy

umount: can't unmount /cache: Device or resource busy

Done!

- All done!
[Android Software/Hacking General [Developers Only]] osm0sis:
Hmm, and does your device have a /system/xbin and do other Magisk modules install okay?
[Android Software/Hacking General [Developers Only]] droople:
I checked the phone, it has /system/xbin folder,. Other magisk modules installed OK.
[Android Software/Hacking General [Developers Only]] osm0sis:
Well that's weird then. Can you send me the magisk_merge.img that gets created during the install? Maybe it'll provide a clue.
[Android Software/Hacking General [Developers Only]] droople:
Uh, there's no this file under data/adb folder, where it could be?

I
[Android Software/Hacking General [Developers Only]] guest4711:
According to your log the image has not been created because the command to create ext4fs was not found.

update-binary: line 35: /system/bin/make_ext4fs: not found
mke2fs 1.43.3 (04-Sep-2016)

So it was neither created nor unmounted nor copied to the normal location

umount: can't unmount /dev/tmp/magisk_merge: No such file or directory
[Android Software/Hacking General [Developers Only]] droople:
uh, does this mean that my Magisk is not installed properly?
[Android Software/Hacking General [Developers Only]] osm0sis:
Both of those messages don't indicate anything.

if [ ! -f /data/$adb/magisk_merge.img ]; then
(/system/bin/make_ext4fs -b 4096 -l 64M /data/$adb/magisk_merge.img || /system/bin/mke2fs -b 4096 -t ext4 /data/$adb/magisk_merge.img 64M) >/dev/null;
fi;

As you can see, make_ext4fs failing causes a fallback to mke2fs, which appears is present by that log message.

The umount shown occurs near the beginning of the log which is intentional to try and make sure it's clean before the script attempts to mount to that location: https://github.com/Magisk-Modules-R...ETA-INF/com/google/android/update-binary#L139

The fact that it got that far in the install also means that magisk_merge.img was in fact created.

So, [MENTION=1246051]droople[/MENTION], your Magisk installation is fine, please try installing my zip again, don't reboot, then check in /data/adb for magisk_merge.img.
[Android Software/Hacking General [Developers Only]] droople:
Hi Osm0sis , I reinstalled you zip, now the image file sits in the folder.

It's wired that why previous two time failed.

Thank you for the help.
[Android Software/Hacking General [Developers Only]] osm0sis:
So are you going to upload it? :confused:
[Android Software/Hacking General [Developers Only]] droople:
the file disappeared after reboot， is this normal？
[Android Software/Hacking General [Developers Only]] osm0sis:
Yes. Magisk integrates it (hence merge) and then removes it. That's how Magisk's booted module installation works.

If you were able to reboot without issue that sounds like busybox installation works now?
[Android Software/Hacking General [Developers Only]] droople:
Yes, now the booting is normal. Thank you for the help:)
[Android Software/Hacking General [Developers Only]] osm0sis:
Okay we'll chalk that one up to ghosts then, I guess! :good:
[Android Software/Hacking General [Developers Only]] droople:
:laugh:
[Android Software/Hacking General [Developers Only]] jcmm11:
I keep telling people not to feed them after midnight, but nobody listens!
[Android Software/Hacking General [Developers Only]] Rom:
Hello @osm0sis

I come here bcz i have got a problem when i try to cross-compiling curl for all Android archs using the NDK, basicaly i have:

NDK path:/home/rom/Android/Sdk/ndk-bundle/

I then adapted this tutorial (which has now become a little old):

https://gist.github.com/jhandley/a5e9ab2fe09e7addde6f

To get to this one:

After that i successfully get the curl, openssl and zlib folders in my /home/rom/curl-android-build/libcurl-android dir

So, if I don't talk nonsense, everything is ready to be compiled via the NDK (including the Android libraries from JB to Pie, as well as LDDB and CMake).

I don't know about the Android Studio setup if i need to generate the standalone toolchain, and in any way, when i tried i get this message:

root@rom-ubuntu:/home/rom/Android/Sdk/ndk-bundle/build/tools# ./make_standalone_toolchain.py \
> --arch arm --api 28 --install-dir /home/rom/my-android-toolchain
WARNING:__main__:make_standalone_toolchain.py is no longer necessary. The
$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin directory contains target-specific scripts that perform
the same task. For example, instead of:

$ python $NDK/build/tools/make_standalone_toolchain.py \
--arch arm --api 28 --install-dir toolchain
$ toolchain/bin/clang++ src.cpp

Instead use:

$ $NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi28-clang++ src.cpp

Installation directory already exists. Use --force.

Now, i don't know if i should use a standalone toolchain or if i need another stuff to be ready to cross-compiling curl for all Andorid archs as u make with Busybox.

Also, for that i use Ubuntu 18.04.1 LTS 64 bits with java 1.8.0_201

I send the libcurl-android.rar archive in attachment folders compressed again in rar format to be able to send it here).

As u have skills in compiling, i tell myself that u would know how to done this cross-compilation :)

Thank you in advance.
[Android Software/Hacking General [Developers Only]] @androidpie:
Can any one tell me the syntax for format and , wipe

And factory reset
[Android Software/Hacking General [Developers Only]] osm0sis:
Looks like you would just change ARCH= and the tuple references in the build tools exports near the top of that script (under "# Setup cross-compile environment") and then run it again, no?
[Android Software/Hacking General [Developers Only]] Rom:
I just don't know how to get the final curl file to run under Android ?
[Android Software/Hacking General [Developers Only]] osm0sis:
Like anything else, copy it to a location where you can set it executable (/system/xbin if you don't care about systemless and want it in PATH, /data/local otherwise). Then chmod +x the binary and run it? Basic Linux and Android stuff, my dude.
[Android Software/Hacking General [Developers Only]] Rom:
Ok, i thought there was one or more tasks left to do because i rather feel like i now have the final necessary sources to compile with the NDK to get the final binary.

As I compiled for arm32 bits at first, i can't test this.

How do you proceed on your side for Busybox, do you compile one binary at a time for each architecture or do you have a configuration to compile the different binary files on the fly?
[Android Software/Hacking General [Developers Only]] alecxs:
factory reset is same as format data + cache

you can find example syntax here

[WIP] How to Write an Updater-Script with Edify Code
[Android Software/Hacking General [Developers Only]] osm0sis:
I use standalone CCs for nearly everything and automate the process. You can see all my scripted configuration/build shenanigans in the OPs, following the link to AIK Build Farm
[Android Software/Hacking General [Developers Only]] Rom:
Thanks, but what's standalone CCs ? Standalone Cross-Compilers ?

Here

https://xdaforums.com/showpost.php?p=51726566&postcount=231

U speack about Cygwin setup, do u suggest to use Cygwin instead of an Ubuntu with the NDK/SDK or cross-compiling is 'easily' possible on a Ubuntu distrib ?

I don't know which link(s) I need to manually establish between:

$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang++ src.cpp

(or another path?)

and the curl sources I have at my disposal.

What compiler do you suggest I use to compile curl?

I also need to have the entire configuration command, but I have no idea where to look for it.

I admit I'm a little drowned in all this.
[Android Software/Hacking General [Developers Only]] osm0sis:
CC is cross-compiler, yeah.

Honestly there are way too many moving parts in what you're trying to do, especially so for someone just starting out. Ubuntu is definitely better than Cygwin for development, I'm just simultaneously a glutton for punishment and too lazy to fire up a VM.

I think you should first generate some standalone NDK cross-compilers for each architecture you're interested in, then learn how cross-compiling works in general (adding the cross-compiler bin directory to PATH, etc.), and then configure and compile the curl libraries and binary manually without the script.
[Android Software/Hacking General [Developers Only]] Rom:
Ok, so if i understand correctly what u mean, i should start to generate some standalones CC like the NDK make, right ?

I have already read a lot of threads on stackoverflow where users define FLAGS like DFLAG etc ?

Theses last options are here to setup the compiler right ?

After that i could beginning to compile curl librairies to be able to CC the final binary with an huge command line and with the NDK.

Last question, I see very, very few tutorials on the net explaining all this, is it because cross-compile or not is generally complex, even for someone who knows about Android, or just because libraries change all the time?
[Android Software/Hacking General [Developers Only]] osm0sis:
Yes. CFLAGS changes probably won't be necessary for you. Cross-compiling is generally easy. For my mkbootimg compiles all I have to do is export PATH with the CC bin path added to the front, export CROSS_COMPILE with the CC tool prefix and type make. So 3 commands.

Ones with configure are a bit more annoying, but you can use the script as a guide for what you need to be doing.
[Android Software/Hacking General [Developers Only]] @androidpie:
Yes but how to wipe data , for devices like

/data/media.
[Android Software/Hacking General [Developers Only]] alecxs:
if you asking for how to wipe /data without wiping /data/media, one of this should work... But please, backup all data first!

delete_recursive /data/!(media)
rm -rf /data/!(media)
find /data -mindepth 1 -maxdepth 1 -not -iname media -exec rm -rf {} \;
[Android Software/Hacking General [Developers Only]] guest4711:
You should use the gnu/linux tools for it. The fast method is using

rm -rf /data/media

which recursive deletes all files and subdirs in /data/media - see man rm.

The normal method is to recreate the filesystem like

mkextfs /data/media

. The manpage will give you the options to use.

But be aware that these commands are powerful enough to make your device unusable if used on the wrong target (e. g. on /).
[Android Software/Hacking General [Developers Only]] @androidpie:
Thanks:svetius:

---------- Post added at 12:37 AM ---------- Previous post was at 12:36 AM ----------

Thanks:svetius:
[Android Software/Hacking General [Developers Only]] HemanthJabalpuri:
[MENTION=4544860]osm0sis[/MENTION]

Is there any way to trim system.img dumped by fla****?

Since od command for system.img is NOT equal to 000*- i.e., null characters...

My system partition size is 1.46GB and used is only 760MB ....

When I zip system.img of 1.46GB of system.img containing only 760mb data .... zip size is 800+mb...!
[Android Software/Hacking General [Developers Only]] osm0sis:
It can only safely trim \x00 (null) padding from the end of a dump, logically anything else changes the structure of the data.
[Android Software/Hacking General [Developers Only]] ashyx:
A wipe in twrp does not wipe data/media. Only a format does.
[Android Software/Hacking General [Developers Only]] KaMyKaSii:
I believe the solution you need is to turn your raw ext4 image into an android sparse image. You can read about through the first link and get the script to do the conversion on the second link.

http://2net.co.uk/tutorial/android-sparse-image-format

https://github.com/anestisb/android-simg2img
[Android Software/Hacking General [Developers Only]] adikri:
gappsintegrator script not working on pie.. any workaround?
[Android Software/Hacking General [Developers Only]] osm0sis:
:eek:

Yeah.. Pretty certain I said it was tested only up to Nougat..

If you or anyone wants to put in the time and figure it out I'm always open to a Pull Request on GitHub. :good:
[Android Software/Hacking General [Developers Only]] adikri:
i am up for testing, what do i have to do? except github cause i am not good in that :D
[Android Software/Hacking General [Developers Only]] madbat99:
He didn't say "test", he said "work". LoL. Meaning you can do it if you want, based off of his previous work.