yashsingh1/xdaforums huggingface dataset:
[ZenFone 2 Android Development] crpalmer:
Note that you don't need the modules at all if you are building the kernel from source using the CM-Zenfone2 repos.

If you use the CM 12.1 sources, adbd should be looking at /sbin/sh by default (if it exists) and then only using /system/bin/sh if that path is not accessible.

To build adb, you just need to do something equivalent to this: https://github.com/CM-zenfone2/andr...mmit/109f6d91e97086747623e79769ccb3c9b5b0db3d

To disable selinux, you may be better off doing it once and for all on the command line, like: https://github.com/CM-zenfone2/andr...mmit/c6e022c88643b1f628776feb7960c29ee464058a
[ZenFone 2 Android Development] social-design-concepts:
did you get source built adbd to work i'd love to move away from a patch and use a source build but it always fails to start.
[ZenFone 2 Android Development] crpalmer:
I am working on getting cm recovery working (I want cm 12.1 and trust you all will get twrp working for me....).

Why does it fail to start?
[ZenFone 2 Android Development] social-design-concepts:
Not sure logcat never returns any information regarding it.
[ZenFone 2 Android Development] vampirefo:
Sounds like you didn't edit init.rc as you were suppose to. Upload the recovery you have so I can see for myself.
[ZenFone 2 Android Development] PsychoKilla666:
Hey, I am rooted on 2.18 and when I run this, one of the fastboot commands at the end fails saying too many links, then some scary lines go across the phone screen and the command window goes red. On the phone after a couple seconds of scary lines I see the Teamwin logo but it just stays there. This is on USA 2.3 4GB/64GB, any ideas?
[ZenFone 2 Android Development] fuzzybuffalo:
The failed with to many links and the black and white scary lines are normal.

The hangs at TWRP splash screen only happens randomly and is what he was working on before he started working on the full version, since we have an unlocked bootloader now.

For me it would hang about 40% of the time, but rebooting comp and phone would make it work the first couple of times.

Once it boots into TWRP, everything I tried seems to work and run smoothly.
[ZenFone 2 Android Development] knoneNull:
example bro in twrp

/data	ext4	/dev/block/by-name/factory	flags=encryptable=/dev/block/by-name/factory/userdata_footer

this is the encrypted partition /data if you set that flag twrp will try to decrypt this partition and must enough privilege like in permissive mode or proper selinux policy

i mean you don't have a permission denied because your sepolicy on recovery is running on enforce if you set the enforce 0 on init.rc then your kernel is running selinux enforce it will not trigger to working in permissive selinux like i said if you can build a kernel set selinux policy to permissive to allow your init.rc to switch to permissive the will help you to fix some bug on twrp recovery some graphics problem can be fix in kernel and sepolicy rules from device fugu CAP_SYS_ADMIN RGX GPU from this patch https://github.com/CyanogenMod/andr...mmit/2b2e5750f3c28c08f606b9cd837f96eae78d119b and check also the fugu kernel for CAP_SYS_ADMIN patch

sorry for my bad english
[ZenFone 2 Android Development] ansebovi:
all are normal,just unplug phone from pc after that distorted display image,wait for 20sec,you will see twrp
[ZenFone 2 Android Development] TheSSJ:
Don't worry, it's really good to understand :)

Okay, thanks to your post I know why my Data partition was still showing 0MB. I was referring to a partition which was not mounted like that (mounted factory after data :silly: )

So I won't come around to build the kernel dynamically :( I'm not really the expert in building kernels, but I am eager to learn ;)

Thanks again!
[ZenFone 2 Android Development] vampirefo:
I haven't seen an intel yet that loads source built adbd, I can build adbd all day long but they are so far useless, for my non intel devices they work just fine. Intel adbd needs something added to source, just not sure what.
[ZenFone 2 Android Development] social-design-concepts:
That's what I was saying though I haven't tried since adding some usb patches from android-ia last week
[ZenFone 2 Android Development] vampirefo:
Sounds good, once we can build usable adbd for intel, I will build them insecure for adb remount and root in recovery.

like this

http://xdaforums.com/android/software/manual-method-adbd-insecure-t3140870
[ZenFone 2 Android Development] grorg:
Guys, maybe you can take zenfone 5 twrp sources for the base and modify it for our phone?
[ZenFone 2 Android Development] PsychoKilla666:
Thanks guys, I guess I'll give it another shot after work. Third time is the charm, haha

Do you think unrooting and flashing the 2.19 update in stock recovery is better, or flashing through TWRP? can I just flash the update over stock unrooted or do I need a full ROM of 2.19?

I just want to unlock bootloader for now and be ready.
[ZenFone 2 Android Development] Harfainx:
So when running "adb root" are you guys getting anything output at all?

I was getting nothing, but I've been working on it. Now I get "restarting adbd as root" after entering "adb root".

Unfortunately, I also changed something that is causing my system to hang on boot... So I need to roll back and try to work forward again.

Edit: Fixed my hanging on boot issue. Just had a bad line in the default.prop.

:fingers-crossed:
[ZenFone 2 Android Development] fuzzybuffalo:
That's pretty much what I did. Flashed the 2.19 OTA update over 2.18 stock unrooted with the stock recovery.
[ZenFone 2 Android Development] TheSSJ:
interesting to know would be if you are actually root when you type adb shell :D
[ZenFone 2 Android Development] vampirefo:
[MENTION=2491106]Harfainx[/MENTION]

I think we are looking at different things, when I build adbd binary it has no user mode $ it only have root # so adb root isn't needed, adb remount would remount system as rw though. Problem I am having is none of the built adbd from source work on Intel, my adbd work on arm devices, that means Intel adds something to their adbd that not in stock source.
[ZenFone 2 Android Development] TheSSJ:
Finally got a working recovery where every partition is mounted properly - flashing and backup works :)

Untethered Beta will be release shortly
[ZenFone 2 Android Development] trnscnd:
You and everyone else involved are AMAZING!
[ZenFone 2 Android Development] Val3r10:
Wow, thanks!

With "UNtethered" you mean a persistent version which replaces the standard Recovery and survives rebooting ?
[ZenFone 2 Android Development] Harfainx:
woohoo!

twrp.img boots into TWRP without any issues.

Running a backup now to make sure everything works. :good:

:victory:
[ZenFone 2 Android Development] XneofuX:
Same here ;) currently at 54% with compression :P
[ZenFone 2 Android Development] TheSSJ:
Yep ;) Would be nice if you would test the flashing using flashify and report back :)

This is the sum of the knowledge of the guys working here alltogether, we should all pat on our own shoulders here :)

And the work isn't finished, I will be only satisfied when ADB + Sideload and MTP will work, too!
[ZenFone 2 Android Development] saud__19:
Thanks for ur effort
[ZenFone 2 Android Development] TheSSJ:
Method 1 works if you have root and a terminal emulator installed, on the premise you unlocked BL
[ZenFone 2 Android Development] Harfainx:
I know there's still work to be done, but this is a big piece of it.

What are you looking at for the adb and mtp? I'm not familiar with how it's done in TWRP. Is it based on the initramfs?
[ZenFone 2 Android Development] XneofuX:
Would love to do so, but when i click "Recovery image" and "Choose a file" either flashify or the whole phone doesn't repond (have to hard-reset [both vol + power for 8 sec] then) ... :p
[ZenFone 2 Android Development] lordpipa:
For the life of me I can't find the twrp.zip file on OP.
[ZenFone 2 Android Development] XneofuX:
It's under "Downloads" in the black bar on top of the thread ^^
[ZenFone 2 Android Development] yakub234go:
http://xdaforums.com/devdb/project/dl/?id=13164
[ZenFone 2 Android Development] TheSSJ:
I had a look at the posts in this thread about the permission denied error I get when having adb pointing to /sbin/sh and trying to fire up the shell. I will play a little more...

Well, I saw that Zenfone 5 has working MTP (and it runs on x86, too, if I am not mistaken), so why not also for ours? I enabled it in the boardconfig, but I fear to have read somewhere that MTP binaries do only work on ARM...may be mistaken here of course
[ZenFone 2 Android Development] TheSSJ:
kk, will remove the "tip" using flashify :D
[ZenFone 2 Android Development] XneofuX:
Not that i didn't write clearly ... i didn't choose any zip at that point, might be a bad version or something (would be strange because i just downloaded it from the play store).

btw: Backup and Restore with compression worked for me :good:
[ZenFone 2 Android Development] Harfainx:
Also might as well report. Backup and Restore without compression worked as well.

---------- Post added at 04:09 PM ---------- Previous post was at 03:58 PM ----------

I did just find a bug though. Not serious, just might catch someone off-guard.

If a backup is done on the internal storage, then the location is changed to external without another backup being done (changed in the backup menu, then hit back), the backup still shows up in the Restore list.

You can't actually select it or anything though, it just shows up but can't be selected.

Example:

Make backup on Internal storage

Go back to Backup menu -> Change to External (MicroSD)

Press Back (Don't backup)

Go to Restore Menu

Backup on Internal is displayed, but can't be pressed. After a while it will eventually go away, but it isn't immediate.
[ZenFone 2 Android Development] mario1634:
How do you hard reset or factory reset on this phone. Finally got it boot up but can't stop it from closing( unfortunately . the process com. android. phone has stopped) ( system ui has stopped) ( com. asus sensorapi . service has stopped) (the process android .process media has stopped) so I'm thinking about doing a factory reset
[ZenFone 2 Android Development] rlaw:
Boot phone in safe mode (press and hold on power off in the power menu until the option appears) and see if that will stop the constant crashing long enough for you to factory reset from the settings.

Otherwise you'll have to wipe (ADB ) or format (fastboot) and I believe both options clean out the internal storage (emulated persistent SD card partition), too. Hope you don't have any data on there you don't mind losing!
[ZenFone 2 Android Development] XneofuX:
Just enter Recovery mode (stock recovery is enough) and use factory reset. How you get there can you read here: http://xdaforums.com/zenfone2/general/asus-zenfone-2-flashing-recovery-mode-t3096596

Also you can try to wipe cache first.
[ZenFone 2 Android Development] 29y6145:
backup work fine
[ZenFone 2 Android Development] jpacleb85:
Thanks for your work guys!!!!
[ZenFone 2 Android Development] Bushcrafter:
A BIG shutout to all the devs that made untethering TWRP possible! You all ROCK!:good: :D
[ZenFone 2 Android Development] mario1634:
cant find the download for the twrp.zip for the unlockboot loader
[ZenFone 2 Android Development] Bushcrafter:
Its in downloads, the button right next to the discussion button at the top of the page.
[ZenFone 2 Android Development] TheSSJ:
http://xdaforums.com/showpost.php?p=61490155&postcount=267
[ZenFone 2 Android Development] grorg:
Has anyone of you facing troubles with flashing zip's in recovery? I mean it's flashes good but the files that should be placed in app or priv-app folder doesn't go there. Also I can't copy them to there with root explorer, it says permission denied. I am rooted btw.
[ZenFone 2 Android Development] gh0st-:
Grats on this mate! Installing the un-tethered one in a bit. :)
[ZenFone 2 Android Development] cieffe54:
to return to the original recovery of the un-tethered it's necessary: fastboot recovery recovery.img?
[ZenFone 2 Android Development] TheSSJ:
I tested with the SuperSU package and everything was fine. Maybe your update-binary is made for ARM? Wouldn't explain why you can't copy anything to priv-app though.....

Yes sir (although the command is not complete: fastboot flash recovery recovery.img)! stock recovery can be retrieved from shakalaca's Mega drive
[ZenFone 2 Android Development] grorg:
I've replaced update-binary with ours for x86 from ota update. If you wouldn't do that the zip wouldn't flash at all. May be there is a problem with root, I'll try to reroot it.
[ZenFone 2 Android Development] cieffe54:
Thanks SIR Master!!!

:D

---------- Post added at 12:08 PM ---------- Previous post was at 11:56 AM ----------

Work like a charme!!

Great!
[ZenFone 2 Android Development] sebx_g1:
So as I understand untethered version is fully fuctional TWRP recovery - yes ? Can I flash all packages with it - also Asus stock roms and OTAs ?
[ZenFone 2 Android Development] DmA81:
Hi, thanks for the outstanding work :).

The TWRP image flashed on my ZE551ML (unlocked) with no problems, so I did a system backup which completed flawlessly.

Then I tried to wipe the /cache partition: the recovery seemed stuck on the "wiping filesystem with mkfs.ext4" message for a while, so I turned off the phone :D.

Now it's stuck on the loading splash (the "In search of incredible" with the spinner below) :(.

What can I do ? The recovery works, though.

Thanks again
[ZenFone 2 Android Development] cieffe54:
da fastboot il seguente comando. fastboot erase cache.

Devi attendere sino a che non ha finito... ci siamo caduti tutti

In fastboot this command : fastboot erase cache

you have to wait for it to finish. We have fallen in several!
[ZenFone 2 Android Development] TheSSJ:
Correct,

oddly, cache wipe takes a friggin' long time, in stock or via TWRP. Honestly I don't know what is causing this (maybe cache is like 8 GB big? :D ). Next time you can turn on the "always rm -rf" option in the settings, that should speed cache wipe up by a great degree as it doesn't call mkext4fs, but just uses rm -rf shell command.
[ZenFone 2 Android Development] crpalmer:
Try adding this to your BoardConfig.mk:

COMMON_GLOBAL_CFLAGS += -DNO_SECURE_DISCARD

to speed up the wiping.
[ZenFone 2 Android Development] DmA81:
Whew! Worked great :D.

Grazie frà ;)
[ZenFone 2 Android Development] harpreet.s:
Hi,

What is the impact on future OTA if TWRP recovery is installed !!!
[ZenFone 2 Android Development] XneofuX:
I also experienced very long wipe times. While restoring a backup, it took about 5 minutes to format system. On my old galaxy nexus this took only about 5-10 seconds :p

But hey, as long as it works, i think mtp and especially adb are much more important ;)
[ZenFone 2 Android Development] TheSSJ:
I will implement the NO SECURE DISCARD flag and report if it got better, thanks [MENTION=3857343]crpalmer[/MENTION] again!
[ZenFone 2 Android Development] jrior001:
Likely will result in same bootloops as taking ota when rooted. Honestly its fail by Asus to even have the OTA show as available on a rooted device, most devices won't even give user the option.
[ZenFone 2 Android Development] cangcan:
[MENTION=2388665]TheSSJ[/MENTION], i have a question to ask.. is latest twrp is really permanent after we installed it? because I still have to flash the twrp img after 1 time of using it as it will return back to stock recovery after that.. its weird, suppose that I already replace the recovery img to TWRP, but how come the stock recovery is still here even after TWRP was installed..
[ZenFone 2 Android Development] TheSSJ:
Sounds to me as you are still using the tethered method :D no, I believe that you flashed the recovery and can boot to it. What I can't imagine is that the phone restores the stock image by itself?

Can you tell me more about your phone model? ZE550ML? CN or WW? What did you exactly do (which step did you follow when flashing the untethered recovery)?

Thanks

/EDIT: For the people eager to test, I uploaded a TWRP test version which aims to fix the long waiting time until a wipe / restore finished, find it here and flash it as described in my OP: http://xdaforums.com/devdb/project/dl/?id=13216
[ZenFone 2 Android Development] XneofuX:
Doesn't seem to have worked. Still using make_ext4fs and is currently at 2 minutes for formatting \System. Data and Boot wipe fine. Maybe it's double-checking if the created partition has no errors?
[ZenFone 2 Android Development] Harfainx:
OTA won't flash. It'll look for ASUS recovery, won't find it. Nothing will happen after it reboots into recovery.

You'll have to either make or wait for a flashable OTA zip.
[ZenFone 2 Android Development] TheSSJ:
Thanks for checking mate

Then I'm out of options here, to speed up wiping I think there is only the option to use rm -rf instead of mkext4

By the way, adb root access works now, I overread social-design-concept's tip of using his adbd binary and just hard patched the pointer to sh there

Will upload the fixed img soon
[ZenFone 2 Android Development] XneofuX:
Well, you're awesome and obviously everybody else, who is helping, too :o
[ZenFone 2 Android Development] crpalmer:
Just to double check, did you do a new clean build for that? Just rebuilding without cleaning (mka clobber) wouldn't change anything.
[ZenFone 2 Android Development] TheSSJ:
I'm an idiot.......:silly:

New build coming up as soon as I can

EDIT: Fresh update is out and [MENTION=3857343]crpalmer[/MENTION] was right - system restore takes mere 66 secs
[ZenFone 2 Android Development] Harfainx:
Now we can flash zips in recovery. I'll put together a 2.19 TWRP flashable zip that doesn't include the bloat. :D
[ZenFone 2 Android Development] KuGeL94:
Awesome!!
[ZenFone 2 Android Development] BOSSPDA:
And CM12.1? What about that?
[ZenFone 2 Android Development] vampirefo:
Yes that adbd is from dell's 3840, I use in all my intels because of some brain fart, I didn't think it would work on lollipop but it does, added to my boot.img and now can adb remount, needed to edit default.prop. I also liked your ideal of symbolic linking sh, works great that way, thanks.
[ZenFone 2 Android Development] saurabhrck:
Anybody have the stock recovery from 2.19 from ze550ml/ze551ml?? just in case to revert back!

---------- Post added at 02:29 AM ---------- Previous post was at 02:28 AM ----------

Still have a long way to go!

https://github.com/CM-zenfone2
[ZenFone 2 Android Development] Harfainx:
551 2.19 Stock Recovery

https://drive.google.com/open?id=0B2OJIWJ3yAeBR2tIVHJsTTd0Uzg&authuser=0
[ZenFone 2 Android Development] TheSSJ:
Rome wasn't built in a day, now you need patience as cm won't work out of the box
[ZenFone 2 Android Development] Harfainx:
Stock based ROMs can start rolling now, but as [MENTION=2388665]TheSSJ[/MENTION] stated, we need some patience for CM. It'll come when it comes.
[ZenFone 2 Android Development] jrior001:
We have a good example for CM w/similar hardware in the nexus player(fugu) but will be awhile before we can get it all worked out. Crpalmer and myself are actively working on CM and anybody who has skill and wants to contribute current work on github is here https://github.com/cm-zenfone2
[ZenFone 2 Android Development] yakub234go:
Is it only for ZE551ML or is it for both 550,551 models
[ZenFone 2 Android Development] DmA81:
Just a friendly reminder :D: https://twrp.me/site/update/2015/06/22/twrp-2.8.7.0-released.html
[ZenFone 2 Android Development] fuzzybuffalo:
Ummmm ... Look at the thread title. :)

---------- Post added at 04:50 PM ---------- Previous post was at 04:31 PM ----------

Speaking of 2.8.7.0

Just flashed the new zip from the first untethered twrp and it said it was successful, but was still on 2.8.5.0.

Fastboot flashed the image and got 2.8.7.0.
[ZenFone 2 Android Development] Harfainx:
Nnnnnninja update :highfive:
[ZenFone 2 Android Development] TheSSJ:
Hm, I don't get unfortunately what are saying :-\ you mean you tried the tethered version and it still says TWRP 2.8.5.0 or did you have trouble flashing the img?
[ZenFone 2 Android Development] stephtban:
[MENTION=2388665]TheSSJ[/MENTION]

I just flashed your last TWRP 2.8.7.0 with "Rashr" >> No problem/Flash Ok ("Flashify" was hanging up when picking a file to flash)

Cache and dalvik wipes were really snappy.

Thanks for your (and everybody involved) work.
[ZenFone 2 Android Development] fuzzybuffalo:
I was on the untethered 2.8.5.0, the first untethered one you posted, and I flashed the new zip just posted at 4:18 today(I think), and I was still on 2.8.5.0.

It said it flashed successfully, but I was still on 2.8.5.0.

Then I fastboot flashed the twrp.img posted today and got 2.8.7.0.
[ZenFone 2 Android Development] gh0st-:
How do I flash an image or zip? I can't seem to do adb sideload file.zip via cmd from my desktop.
[ZenFone 2 Android Development] fuzzybuffalo:
The easiest way for me was to download the twrp.img file, boot your phone into fastboot mode, hook your phone to computer and type..

fastboot flash recovery twrp.img

from the cmd window.

---------- Post added at 05:33 PM ---------- Previous post was at 05:29 PM ----------

I guess I should say I tried to install the new recovery.zip posted today from within TWRP 2.8.5.0.

After rebooting recovery, I was still on 2.8.5.0.

We can do that can't we, Update TWRP by installing new TWRP zip?
[ZenFone 2 Android Development] stephtban:
I think recovery.zip is for tethered recovery. You have to flash twrp.img from download section
[ZenFone 2 Android Development] fuzzybuffalo:
There's a new recovery.zip, just posted today in the download section.

Edit: You might be right, I thought it was a flashable untethered TWRP.

But, why would he still be doing the tethered file?

Edit 2: I guess I should read the OP again, he explains it there, it's if you don't want to unlock bootloader.
[ZenFone 2 Android Development] Harfainx:
adb won't work in bootloader.

You will see the "continue the fastboot process" on your phone if you're unlocked. That's fine, nothing wrong there.

You should be issuing the fastboot commands from your computer while the phone is in fastboot.
[ZenFone 2 Android Development] stephtban:
I thought it just was new twrp packed for locked bootloader users. Maybe i'm wrong ;)
[ZenFone 2 Android Development] fuzzybuffalo:
No, you are right, it was my mistake, I edited my post above.

Thank you.

Edit: Apologies [MENTION=2388665]TheSSJ[/MENTION], I was trying to flash the tethered zip, Sorry.

---------- Post added at 06:06 PM ---------- Previous post was at 05:54 PM ----------

LOL, I wonder what that did to my phone, did I just install tethered TWRP as a system app? :laugh:

Good thing I made a backup yesterday... :laugh:

[MENTION=1019992]gh0st-[/MENTION] did you get it flashed?
[ZenFone 2 Android Development] gh0st-:
I got it fixed. I had to wait on the bootloader, not really like that before. haha
[ZenFone 2 Android Development] Bushcrafter:
I did the same thing! I guess we will see what happens.:good: I also did a backup yesterday if the SHTF! Lol!
[ZenFone 2 Android Development] BOSSPDA:
You may consider to visit the TWRP theme ans splash screen customizer: http://xdaforums.com/zenfone2/themes-apps/twrp-themes-asus-zenfone-2tested-t3142041
[ZenFone 2 Android Development] cangcan:
I am using latest ZE551ML WW 2.19x fw.. bootloader already unlocked, its weird tho. I also used both method for untethered TWRP in OP but its still the same, and yes I flashed the TWRP recovery and can boot into it, but after one time of using it, it will returned back to stock recovery.. maybe I need to re-unlock the bootloader or reinstall latest 2.19 fw..
[ZenFone 2 Android Development] fuzzybuffalo:
Are you fastboot flashing the twrp.img?