yashsingh1/xdaforums huggingface dataset:
[ZenFone 2 Android Development] kamranyusuf:
I was trying to install a this rom for Zenfone 2. I formated the internal memory through TWRP (including the system) and now I can't really access the internal memory. Sideload isn't working. Push command gives a permission denied error. I think the partitions are messed up. How do i get my partition table back?

Solutions please!
[ZenFone 2 Android Development] TheSSJ:
Uuuh, messed up pretty hard...

Boot into fastboot and the following commands will fix up your partitions:

fastboot erase cache (takes a while)
fastboot erase system (takes a while)
fastboot erase data (takes a while)

Now you are able to boot into twrp again and flash Hairfanx' ROM again. Or you install stock ROM again: http://xdaforums.com/zenfone2/help/how-to-upgrade-cn-version-to-ww-t3101556
[ZenFone 2 Android Development] yakub234go:
flash stock recovery (@TheSSJ TWRP Sideload not working)

enter recovery mode

adb sideload full firmware & wait till its done(takes long time)
[ZenFone 2 Android Development] TheSSJ:
And it won't work then, as I am using a prebuilt ADB binary from vampirefo. The one that the system builds doesn't work at all :(

Will remove the ADB sideload button in the next release as there currently is no solution with the ADB binary...
[ZenFone 2 Android Development] jrior001:
Not quite true anymore, we have source built adb working now on our early CM builds. You need this though http://review.cyanogenmod.org/#/c/101970/ to get it working.
[ZenFone 2 Android Development] TheSSJ:
And they did it again! :)

Perfect, adb sideload support should be available then (as soon as I implement the changes)
[ZenFone 2 Android Development] kamranyusuf:
Solution to wiped internal memory

Got it working, the following worked for me.

http://xdaforums.com/zenfone2/help/twrp-wiped-internal-memory-t3147429#post61644635
[ZenFone 2 Android Development] vampirefo:
Hopefully works for you, just builds a brick for me.

---------- Post added at 11:58 AM ---------- Previous post was at 11:56 AM ----------

Is there more than this patch? doesn't work for me.

This is correct patch?

https://github.com/CyanogenMod/android_system_core/commit/37ee0c2af6e57ad0a05c3be523bae2e70ff13453
[ZenFone 2 Android Development] TheSSJ:
It builds and works, but sideload seems to be still broken
[ZenFone 2 Android Development] vampirefo:
That's what I meant no adb sideload, don't know why I used word brick.
[ZenFone 2 Android Development] jrior001:
Oops, forgot to mention the new board flag needed.

BOARD_FUNCTIONFS_HAS_SS_COUNT := true

Basically CM is using the caf version of USB 3.0 support and Intel used the( not yet merged into aosp, master branch) version...that commit bridges the gap until aosp standardizes on something, hopefully for M release
[ZenFone 2 Android Development] TheSSJ:
I included this flag in my boardconfig, adb sideload says that it couldn't find a device. When I press cancel on the phone, it re-establishes the adb connection

Odd, but at least it builds and works from source now :)
[ZenFone 2 Android Development] john_petrucci:
Will you be updating soon?
[ZenFone 2 Android Development] TheSSJ:
There will be no benefit using source built adb compared to the one i've been including prebuilt before, so I think a new release can wait at the moment
[ZenFone 2 Android Development] GeneralPag:
So you wont fix adb sideload problem?
[ZenFone 2 Android Development] TheSSJ:
Maybe logcat gives me some insight,but can't promise anything
[ZenFone 2 Android Development] GeneralPag:
I think it would be nice to have custom recovery that supports sideload. Most of us are updating using adb sideload.
[ZenFone 2 Android Development] trnscnd:
Meh.. I could go without.
[ZenFone 2 Android Development] social-design-concepts:
adb sideload doesn't use system/core/adb

You need to patch recovery-twrp/minadb
[ZenFone 2 Android Development] jpacleb85:
Got it all sorted out.. some how access to my partitions were goofed up.. I couldn't even flash the pre-root Rom for a while fast boot was returning errors about not being able to find the device or address.. after a few reboots and tries, all partitions flashed and then I was able to flash twrp and the GG Rom.. now if only we had CM or even better a guide to porting rims over
[ZenFone 2 Android Development] rafyvitto:
Recovery still goes into idle mode(screen goes off and it wont wake up) while backing up specifically data, just wanted to trow that out there.

edit:Actually the device shutsoff completly, even with 50+ battery charged.
[ZenFone 2 Android Development] vampirefo:
I don't have this device, just curious how long after starting backup does this happen? Does it happen via tethered recovery also?
[ZenFone 2 Android Development] rafyvitto:
Never happened on thethered , time wise i cant tell you, my backup is around 7GB's compressed from 10GB, its always around 70%(right around backing up data) of the backup procedure.
[ZenFone 2 Android Development] vampirefo:
Ok, thanks I don't have any backups that big, to test. No ideal if my recovery would do the same.
[ZenFone 2 Android Development] rafyvitto:
Im thinking thermal throttling(device get pretty hot to the touch), but thats kernel related, i dont know , my expertise lies inside userland blobs and the likes.
[ZenFone 2 Android Development] vampirefo:
Ok, sounds like maybe TheSSJ can fix this by using all the stock binaries from stock recovery /sbin, except adbd and recovery binary.

That might fix it, might not, I use them in my recoveries as well.
[ZenFone 2 Android Development] Bushcrafter:
+1. Same thing happened with me too! TWRP go's into sleep mode and never wakes up.
[ZenFone 2 Android Development] rafyvitto:
So i tested my thermal throttling theory by putting my device next to a fan blowing directly at it and low and behold the backup completed successfully.
[ZenFone 2 Android Development] TheSSJ:
Man this is confusing! Okay, makes sense though. Problem is only that minadb creates a lib called libminadb.so. The adb binary is defined in system_core, though. Do you think it makes sense to just extend the Android.mk in minadb to build an adb binary there? Will try it when I am back on my PC

Mh, honestly my recovery uses all stock binaries already, except healthd. The reason is because I include libenc library in order to have the UI not lagging like sh*t. Unfortnately all my partitions are about 5GB in sum, so either the size of my backup is not large enough to test or I am subconsiously keeping the phone cool

Man, this is a problem only the TWRP guys can fix I assume. Will test with stock healthd to see if it reduces the CPU clock, otherwise I will need to set the CPU maybe to another governor (interactive is set currently, will change to ondemand to see if it scales somewhat better, otherwise I would need to add the conservative one to the kernel...
[ZenFone 2 Android Development] vampirefo:
When you get a chance will you upload your built adbd, after more testing I realized my adbd don't do anything.

I got confused and thought the ones I built using the patch worked when in fact they don't.

PS use health from stock recovery also.
[ZenFone 2 Android Development] TheSSJ:
Here you go sir! Will pack adb with upx in my next builds to make the recovery size a bit smaller I think...would be also good for ntfs-3g binary ^^
[ZenFone 2 Android Development] vampirefo:
Thanks yours doesn't work for me either, at least I wasn't going crazy, lol.
[ZenFone 2 Android Development] social-design-concepts:
I haven't tried that shim patch yet but I didn't have any with the actual aosp patches that Intel added either.
[ZenFone 2 Android Development] vampirefo:
Did you try TheSSJ adbd?

On a side note, I requested 3830 KitKat kernel source for a long time. Never got a response, The other day I posted on Dell forum they violated GPL, today got email telling me they will upload 3830 KitKat source in a few days, lol it's been a year since they released KitKat.
[ZenFone 2 Android Development] social-design-concepts:
Not yet just woke up , lol their open source / legal team told me it was up today with the last ota release I said it wasn't they maintained it was. I was emailing them 2 times a week Maybe I should start emailing them again or take the argument to their form.
[ZenFone 2 Android Development] vampirefo:
Here is email.

Hello

*

Following up on your source code request, Dell’s engineering department indicates that they will have the Kit Kat kernel source code available for you within a few days.

Because the code you have requested is on an older platform, obtaining it from engineering archives is taking more time than expected.

*

Best regards,

*

*

Rob Julien

Legal Director

Dell**| *Legal

5455 Great America Pkwy

Santa Clara, 95054*

office: 408.965.5888* mobile: 408.835.1153

robert_julien@dell.com
[ZenFone 2 Android Development] social-design-concepts:
time to test . . . it works!!!!!!!! add these to minadb View attachment 3387725
[ZenFone 2 Android Development] TheSSJ:
YESSSSS! So minadb was to be edited here for sideload working in recovery, thanks for testing!
[ZenFone 2 Android Development] social-design-concepts:
It works I'll have to modify the way twrp starts and stops adbd for the tether version since in the tether we can't use any service set by init but it works.

---------- Post added at 07:27 AM ---------- Previous post was at 07:25 AM ----------

It needs the initial USB 3.0 patch and the patch for Intel that was added to adb in system/core/adb
[ZenFone 2 Android Development] TheSSJ:
I built a new TWRP now with ADB sideload working.

Problem is that I can't upload because xda is throwing out server I/O errors :silly:
[ZenFone 2 Android Development] Harfainx:
Mirror to Google Drive?
[ZenFone 2 Android Development] social-design-concepts:
I use androidfilehost
[ZenFone 2 Android Development] john_petrucci:
Wait your new version with ADB sideload ;)

Thanks!
[ZenFone 2 Android Development] TheSSJ:
Totally right, sometimes I just don't see the most obvious things :D

DL link is added to OP! And also here :)

I find afh a little slow when downloading, that's why I have never taken it into consideration

See OP! Or this post :D
[ZenFone 2 Android Development] vampirefo:
My problem had nothing to do with your code, it was due to one tablet refusing to load any adbd build from cm12, problem solved by applying your patch to cm11.

Now all intels I have will load the built adbd's

Thanks for your share.
[ZenFone 2 Android Development] john_petrucci:
Help me

Please, I am confused, i have original ROM ASUS, Root, Custom Recovery TWRP!!!

which method for flash update Original ROM version 20 to 22??

Via ADB Sideload flash full rom version 20 and after update via OTA with the new flashed original Recovery??

Thank You!
[ZenFone 2 Android Development] TheSSJ:
If flashing with TWRP won't work, you can flash the original recovery and start the OTA update again. I'd first try with TWRP (first don't forget to unroot)
[ZenFone 2 Android Development] john_petrucci:
I have try OTA with TWRP after unroot but nothing to do!!!

Now i need to find recovery stock 2.19.40.20!!

its different recovery stock 2.19.40.18???
[ZenFone 2 Android Development] Bushcrafter:
[MENTION=2388665]TheSSJ[/MENTION]. I just received the update OTA notice from Asus for 2.19.40.22, but when I go to update my phone it shuts itself off and boots in twrps main menu and stays there. The update does not get loaded onto the phone. Is this because TWRP is trying to run it or is TWRP blocking the update from running it?
[ZenFone 2 Android Development] chubby65:
You need stock recovery to flash OTA
[ZenFone 2 Android Development] TheSSJ:
basically the update app is restarting the phone into recovery with arguments to execute upon load. As TWRP seems to have a different procedure to execute parameters upon loading, it just starts :)

What you can do is rename the dlpk file sitting in your /cache partition to something.zip and then trying to install it normally. But honestly I'd rather go with the stock recovery to be sure that nothing gets screwed up
[ZenFone 2 Android Development] Bushcrafter:
Okay thanks for your quick reply! That clears things up!:good::D
[ZenFone 2 Android Development] HopelesRomantc91:
I can't get Mount or ADB to work inside of TWRP, which is pretty annoying since I also can't boot to system since I tried to OTA update and forgot to undo some stuff first...but anyway, is there anyone who can help me out?
[ZenFone 2 Android Development] fuzzybuffalo:
3 posts above yours.
[ZenFone 2 Android Development] HopelesRomantc91:
Yeah, I found a de-bloated ROM that's flashable via TWRP and just put that onto SD and I'm good to go now. Thanks though.
[ZenFone 2 Android Development] Wilkij:
I, too, would like a stock recovery .img file to replace the TWRP recovery prior to flashing an OTA. I checked the latest .zip archive for a recovery .img, but found recovery was a folder with two unknown file types within. Can someone supply a recovery.img or tell me what to do with these odd file types?
[ZenFone 2 Android Development] fuzzybuffalo:
http://www.mediafire.com/folder/setyy42t2cymy

Say Thanks to Shakalaca for the files from this thread...

http://xdaforums.com/zenfone2/orig-development/rom-pre-root-img-t3079590

[ROM] Pre-root system.img
[ZenFone 2 Android Development] Wilkij:
Thank you, I appreciate the help.
[ZenFone 2 Android Development] ponnuvelpandian:
Dowload Link

Where is the download link for this update?
[ZenFone 2 Android Development] TheSSJ:
You have to open the Spoiler for the untethered version in the OP, then look far below
[ZenFone 2 Android Development] justdrew:
Anyone abme to flash this

http://xdaforums.com/android/software/mod-beatsaudio-e-xloud-installer-t3029951
[ZenFone 2 Android Development] grorg:
No, I try everything but no luck
[ZenFone 2 Android Development] TheSSJ:
The updater-binaries are made for ARM, not for x86. Additionally next time state any error message or if any error message at all was thrown out.

As this has nothing to do with the recovery itself, please open a new thread in the general section to discuss this, thanks!
[ZenFone 2 Android Development] 29y6145:
Beat and xcloud and sony music not support cpu intell X86-64

Gửi từ ASUS_Z00AD của tôi bằng cách sử dụng Tapatalk
[ZenFone 2 Android Development] Harfainx:
Well uhh...

That just got awkward.

https://twrp.me/devices/asuszenfone2.html
[ZenFone 2 Android Development] vampirefo:
Yep, very umm awkward.
[ZenFone 2 Android Development] jrior001:
The lead TWRP guy Dees_Troy got a zf2 as well, so yeah.... he'll probably publish his own builds based on our progress.
[ZenFone 2 Android Development] Aceofzeroz:
LMAO!!!!! ??????

Yep, the ones who have been here since March heard some time in April that Dees_Troy would be getting a Zenfone 2. :)

Sent from the Ace's Zenfone 2 using Tapatalk 4
[ZenFone 2 Android Development] cjvzla:
check it out: https://twrp.me/devices/asuszenfone2.html

edit: welp, didnt noticed it was already posted! anyway, its great news!
[ZenFone 2 Android Development] Harfainx:
It is great news, but we've already had some awesome TWRP support here thanks to some great people giving up their time for the community!

Dees just wanted everyone to do all the work for him :p

(joking of course)
[ZenFone 2 Android Development] rlaw:
For anyone wondering, it's safe to flash the official twrp image via unofficial twrp recovery.

When you reboot recovery, it'll ask if you wanna keep the system partition read-only. If you want to keep your ROM OTA compatible (aka you rooted using one click) I'd advise you to check the never show message again and keep system read-only button.

If you change your mind afterwards, in the mount menu you can change system to read-write.
[ZenFone 2 Android Development] GeneralPag:
Is official twrp fully working? Adb sideload?
[ZenFone 2 Android Development] vampirefo:
I would say yes, seeing it was already fully working with adb sideload.
[ZenFone 2 Android Development] jeanne8fr:
I installed the TWRP Manager from Google Play Store but I can't see our Zenfone 2 listed in the Devices.

Which device should I use?

Thanks

Jeannette
[ZenFone 2 Android Development] Harfainx:
It's on the TWRP page linked above.
[ZenFone 2 Android Development] jeanne8fr:
What is in the page above?. When I open the twrp manager and click on 'install twrp' I get a long list of device. I can't see zenfone 2. Is the name of the device on the page above?.
[ZenFone 2 Android Development] TheSSJ:
That's what I would call kanging at its best...

Took your src without mentioning you directly (at least you show up as "contributor"), took my fstab without mentioning me at all...

Does it include the x86 optimizations? Don't see any trace

Also their jenkins server added a flag "tw-Include-ntfs-3g". The source code doesn't have this flag, lets see if they will use some of my code to include ntfs 3g support
[ZenFone 2 Android Development] GeneralPag:
Code name is fhd
[ZenFone 2 Android Development] TheSSJ:
If you now would give a link to your github, I could try some more :laugh:
[ZenFone 2 Android Development] social-design-concepts:
https://github.com/social-design-concepts/vendor_intel_hardware_apache-harmony

[MENTION=2472806]vampirefo[/MENTION] figured out my adb shell issue, I need to update my recovery.launcher so it executes adbd direct instead of restarting the adbd service.

When its started as a service it wants to uses the init LD_LIBRARY_PATH var /system/lib this is an issues as this could be KK libs or L libs depending on the device. I'll fix it tonight so it executes the adbd binary directly like I do with recovery binary so that the LD_LIBRARY_PATH only looks for shared libs under /sbin

Now haven't dug into twrp options to deep is there one that can remove adb sideload option?
[ZenFone 2 Android Development] gh0st-:
This looks really promising! Keep up the good work!
[ZenFone 2 Android Development] TheSSJ:
As far as I know there is no compile flag to remove ADB sideload. Easiest would be to comment out the XML data referring to the ADB sideload button: /bootable/recovery/gui/devices/portrait/res/portrait.xml, line 2662 - 2666

Cheers
[ZenFone 2 Android Development] vampirefo:
You get patch working?
[ZenFone 2 Android Development] TheSSJ:
Unfortunately still compile errors. This time it says it cannot cd to a directory for busybox full...as i cannot find anything about this error I'd say I still need to fix some Android.mk file
[ZenFone 2 Android Development] social-design-concepts:
just as i was about to upload lol

---------- Post added at 05:21 PM ---------- Previous post was at 05:14 PM ----------

There should only be three Android.mk files to change you add libenc where ever you find libpixelflinger_static or libpixelflinger it something like 1 shared lib and 3 or 4 static lib entries

---------- Post added at 06:16 PM ---------- Previous post was at 05:21 PM ----------

if any one wants to test IntelAndroid-FBRL-06-03-2015-PTR2.7z after you type accept you'll be asked to select one of the five recovery options.
[ZenFone 2 Android Development] vampirefo:
Could be healthd Android.mk, what did you add to this file?
[ZenFone 2 Android Development] social-design-concepts:
diff

bootable/recovery-twrp $ git diff
diff --git a/minui/Android.mk b/minui/Android.mk
index ccf6d3c..1d63068 100644
--- a/minui/Android.mk
+++ b/minui/Android.mk
@@ -33,7 +33,8 @@ ifeq ($(TW_NEW_ION_HEAP), true)
LOCAL_CFLAGS += -DNEW_ION_HEAP
endif

-LOCAL_STATIC_LIBRARY := libpng
+LOCAL_STATIC_LIBRARY := libpng libenc
+
LOCAL_WHOLE_STATIC_LIBRARIES := libpixelflinger_static
LOCAL_MODULE := libminui

@@ -100,7 +101,8 @@ LOCAL_C_INCLUDES +=\
LOCAL_MODULE := libminui

LOCAL_ARM_MODE:= arm
-LOCAL_SHARED_LIBRARIES := libpng libpixelflinger
+LOCAL_SHARED_LIBRARIES := libpng libenc libpixelflinger
+
# This used to compare against values in double-quotes (which are just
# ordinary characters in this context). Strip double-quotes from the
# value so that either will work.
diff --git a/minuitwrp/Android.mk b/minuitwrp/Android.mk
index f429744..0123f99 100644
--- a/minuitwrp/Android.mk
+++ b/minuitwrp/Android.mk
@@ -146,7 +146,8 @@ endif

LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
LOCAL_SHARED_LIBRARIES += libz libc libcutils libjpeg libpng
-LOCAL_STATIC_LIBRARIES += libpixelflinger_static
+LOCAL_STATIC_LIBRARIES += libpixelflinger_static libenc
+
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE := libminuitwrp

system/core $ git diff healthd/Android.mk
diff --git a/healthd/Android.mk b/healthd/Android.mk
index 17e51d8..ded52bf 100644
--- a/healthd/Android.mk
+++ b/healthd/Android.mk
@@ -53,7 +53,7 @@ endif

LOCAL_C_INCLUDES := $(call project-path-for,recovery)

-LOCAL_STATIC_LIBRARIES := libbatteryservice libbinder libminui libpng libz libutils libstdc++ libcutils liblog libm libc
+LOCAL_STATIC_LIBRARIES := libbatteryservice libbinder libminui libpng libenc libz libutils libstdc++ libcutils liblog libm libc

ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
LOCAL_STATIC_LIBRARIES += libsuspend
[ZenFone 2 Android Development] vampirefo:
Can't get anymore precise than that, can't wait to test this, another two days before I can get home to try.
[ZenFone 2 Android Development] x-dira:
Can i flash recovery with app Flashify !?

Thanks
[ZenFone 2 Android Development] TheSSJ:
I agree, will test as soon as I can. To be extra sure I restored the whole src to day one and will start from scratch now again.

Thanks for the support guys, really appreciated!

If you want to brick your phone? As our Bootloader is locked the phone would refuse to boot into recovery.

See the first post on how to use

EDIT: Managed to build the g-damn recovery finally. ALL FIXED, OP updated
[ZenFone 2 Android Development] XneofuX:
After you manged to get everything working, what would it take to get the bootloader unlocked? Do we have to hope for Asus to give us a tool or is anybody capable of finding an exploit? I really would love to use CM or actually any custom ROM.
[ZenFone 2 Android Development] social-design-concepts:
To date the only bootloader unlocks for Intel MID Devices have come from the Manufacturer / Intel.

If my theory is correct devices like this that have the sl_vmm.bin boot as a virtual machine great for security bad for exploitation.

So what will it take that's easy Google stepping up to the plate the way Microsoft did with designed for Windows 8 certification requiring that secure boot being able to be disabled and users able to load their own keys. Google could simply make this a requirement of all GMS certified devices they choose not to.
[ZenFone 2 Android Development] mrbubs3:
Question: Can this TWRP .zip file be converted to an .img file? I ask because I flashed the .zip file via fastboot, and it successfully overwrote the default one. While it did not succeed in booting TWRP, it did demonstrate that the recovery partition can be overwritten via ADB. I am using Z00A version of the ZE551ML.
[ZenFone 2 Android Development] Harfainx:
It will write to the recovery partition, but it won't load. You won't be able to access recovery until you flash back to stock recovery. The phone will just reboot to bootloader if you try going to recovery through either bootloader or adb.

---------- Post added at 01:20 PM ---------- Previous post was at 01:17 PM ----------

@TheSSJ I'm getting a failure on restore now with the newest recovery.

Keeps saying system is mounted read only, no matter what I do in recovery. It isn't coming up with write permissions.

Anyone else tested restore in the newest posted recovery?
[ZenFone 2 Android Development] mrbubs3:
Damn. And here I thought that I made a discovery. Oh well. Thanks for the clarification. :)

Side question: When trying to run the .bat file for the temp. CWM method, I get the following message:

ERROR: You must run this script from the standard Windows Command Shell

(C:\Windows\system32\cmd.exe). Please start this shell first before

running this script.

Press any key to continue . . .

I know this is not your work, but if you had some insight, I would appreciate it.
[ZenFone 2 Android Development] Harfainx:
Try running a command prompt from that folder. Shift+Right Click in the folder (not on a file) and select "Open command window here"

Then type "cai_dat_CWM.bat"