[Other Tools & General Discussion] YuriRM:
Script for the new Elephone P8 3D

[MENTION=7424515]KP@2016[/MENTION] Thanks for accepting our request!

Root method with TWRP and Magisk is available for Elephone P8 3D.

[MENTION=8990807]pdegraaf[/MENTION] (Paul) has developed a TWRP that works. It is based on TWRP 3.0.3 for OPPO FS1.

https://www.gsmarena.com/oppo_f1s-8239.php

A perfect scatter.txt file is not yet available. A trial with Elephone P8 Mini's scatter file and preloader_p389bf.bin file was partially successful. One bug has been identified. Another pertinent question is the suitability of the scatter file of Elephone P8 Mini. Does it support the 3D parallax screen and Eye-Tracking features of Elephone P8 3D?

Can you help improve the scatter file, KP@2016?

The relevant information for a root/debloat/unroot tool with permanent root as an advanced option is presented in posts # 1, 2, 10, 36, 37, 47, 51, 105, 106 and 107.

Your Coolpad Toolkit is perfect for Elephone P8 3D but needs a script to call this and perform the correct steps in order as set out on the first post to avoid any chance of bricking. An aditional request is an option to root/debloat/unroot for newbies, please!

Post #1 (by pdgraff)

TWRP image link and detailed instructions for rooting with Magisk.

After reading so many useful threads on this forum, I figured it became time to share my experiences with a very new phone with others. I used the work of others, so maybe nothing new, but even so, it took some time to find all info and adapt the TWRP imade. Using the information here and my customized TWRP image, you should be able to root this phone very fast.

I assume some experience with booting into recovery, unlocking bootloaders and flashing. Please be aware of the risks of doing this and be aware that it will void your waranty

The steps:

1) First step has to be to save the existing software. I used the SP Flash tool to do so. Be VERY careful with this tool, as it is very easy to brick your phone already in this first step. The tool has an innocent looking "Download only" buttom, do not be deceived, as this button is UPLOADING to the phone!!! Use the Read back function and read from 0 until the first 3.8Gb. If all goes well, you do not need this backup. Unfortunately I do not (yet) have the scatterfile for this MT6750T phone. You need the scatterfile to be able to download the different partitions. Anyway see: [TUT]MTK Android (Sp flash tool ) tutorial on XDA Developers

2)	Install Magisk man from googleplay, run it and choose download Magisk zipfile. Save this file in your (unencrypted!) SD card

3)	Backup your Userdata. A way to do this is the built-in Recovery rom. It will also backup properly if your phone is encrypted . You can backup to the SDcard or to an OTG usb disk.

4)	Unlock your bootloader look here: how-to-unlock-your-android-phones-bootloader-the-official-way in short:

a.	Make yourself developer (settings/phone/tap the image info 6x)

b.	In the developer tab choose: “Allow unlocking the bootloader”

c.	Shutdown phone

d.	Press and hold Volume UP and ON for five seconds

e.	Choose the bootloader by using the Volume Up key

f.	Press Volume down to activate

g.	Connect your PC to the phone

h.	Start CMD on the PC and browse to the directory where ADB is installed (e.g. C:\adb)

i.	Type: fastboot oem unlock

j.	You need to confirm by using the Volume Up key. OUR USERDATA WILL BE ERASED

5)	Flash the customized TWRP recovery image for the Elephone P8 3D. I made this rom using Carlivs image kitchen, using TWRP 3.0.3 for OPPO FS1. Unfortunately, this did TWRP worked fine if you booted it with: fastboot boot recovery.img, but when I flashed it, Touch did not work. Luckily, somebody found out what the problem is and he wrote a complicated, but complete story how to fix it and it works now!! See github.com minimal-manifest-twrp READ_ME_FIRST issues thanks to user “LosTigeros” for his post. The TWRP image can be found at http://bit.ly/2oQtrbe

Type: fastboot flash recovery.img

6)	Test TWRP by switching off your phone and the reboot into recovery (press volume up and on at the same time and choose “recovery”. Do NOT choose the option to install the TWRP app!! While you are at it, use backup to backup all the partitions.

7)	Choose install the magisk man zip file

8)	Test if your phone works and if you have root access

9)	Reboot the phone into the bootloader

10)	Lock the bootloader: fastboot oem lock (your user data will be deleted again)

11)	Switch off your phone and the reboot into recovery (press volume up and on at the same time and choose “recovery”)

12)	Use the option “wipe” in TWRP to wipe Dalvik cache, cache and user data. If you skip this step, your phone will continue to boot into the recovery mode ….

13) You should now restore your user data

14) Your phone should work again now and should be routed….

Good luck! Paul

https://xdaforums.com/tools/general...p8-3d-twrp-t3760453/post75830728#post75830728

Post #2 (by pdegraaf)

Overview of partitions in the Elephone P8-3D

Almost enough information to build a scatter.txt file. But I do not know yet in what sequence these partitions come....

Overview partitions in the Elephone P8-3D

Partition# # of 1024B blocks Partition name Friendly name

0 61071360 mmcblk0

1 16384 mmcblk0p1 Recovery starting at 0x8000

2 512 mmcblk0p2 Para

3 10240 mmcblk0p3 Expdb

4 1024 mmcblk0p4 Frp

5 32768 mmcblk0p5 nvdata

6 32768 mmcblk0p6 metadata

7 8192 mmcblk0p7 protect 1

8 12768 mmcblk0p8 protect2

9 8192 mmcblk0p9 seccfg

10 8192 mmcblk0p10 oemkeystore

11 3072 mmcblk0p11 proinfo

12 24576 mmcblk0p12 md1img

13 4096 mmcblk0p13 md1dsp

14 3072 mmcblk0p14 md1arm7

15 5120 mmcblk0p15 md3img

16 5120 mmcblk0p16 nvram

17 1024 mmcblk0p17 IK

18 1024 mmcblk0p18 IK2

19 16384 mmcblk0p19 boot

20 8192 mmcblk0p20 logo

21 5120 mmcblk0p21 tee1

22 5120 mmcblk0p22 tee2

23 6144 mmcblk0p23 secro

24 10240 mmcblk0p24 keystore

25 3145728 mmcblk0p25 system

26 442368 mmcblk0p26 cache

27 57237487 mmcblk0p27 userdata

28 16384 mmcblk0p28 flashinfo

96 4096 mmcblk0rpmb

64 4096 mmcblk0boot1

32 4096 mmcblk0boot0

Almost enough information to build a scatter.txt file. But I do not know yet in what sequence these partitions come....

https://xdaforums.com/showpost.php?p=75827560&postcount=2

Post #10 (by pdegraaf)

Explanation on the calculation method to apply for a Read back function... being from 0 until the first 3.8Gb.

The partition with the system ROM on it is 61071360 1024byte blocks large. The userdata partition comes at the end and has 57237487 blocks. So I figured if I save 3833873 blocks, than I should have saved everything that matters. So I entered address 0 and address 3925885925 (converted to hex) in the SP tool and it gave me 3.8GB of data. Not that I needed it, because after I unlocked the bootloader, using TWRP (before flashing it), I was able to save all partitons again.

Best to save as much as you can, to prevent bricking of your device...

https://xdaforums.com/showpost.php?p=75854346&postcount=10

Post #36 (by ProfessorKnox)

Recommendation to use scatter file from Elephone P8 Mini.

c.f. scatter file: I'd recommend to use scatter file from Elephone P8 Mini.

Memory layout fits with the partition information given in this thread respectively the information spit out by Device Info HW app and Disk Info app.

Any arguments against it?

https://xdaforums.com/showpost.php?p=75902565&postcount=36

Post #37 (by ProfessorKnox)

Report of trial with Elephone P8 Mini's scatter file and preloader_p389bf.bin file. One bug has been identified.

Used successfully Elephone P8 Mini's scatter file and preloader_p389bf.bin file to flash Paul's TWRP and then via TWRP Magisk.zip.

I had to flash Magisk.zip from an USB stick, because /data partition isn't mounted by default and I also coudn't mount it in TWRP.

Therefore I had to do TWRP backup to USB stick too.

Maybe someone can find out why /data isn't accessible nor mountable in TWRP.

https://xdaforums.com/showpost.php?p=75904990&postcount=37

Post #47 (by TheMarchHare)

Bloatware removal - Com.android.snap and Com.gangyun.beautysnap

I don't notice any ads but I run all WiFi through a VPN so it gets blocked by hosts files. The rest gets blocked by ad blockers.

I have 2 Elephone P8 3D's Both with com.gangyun.beautysnap on them in the vendor sys directory. Com.android.snap doesn't get flagged. Just beautysnap.

Dr. Web flags it as AdwareHidden.201... I think as of today, it was clean yesterday.

Malwarebytes finds nothing yet, neither does ESET, haven't tried the rest yet.

https://xdaforums.com/showpost.php?p=75936956&postcount=47

Post #51 (by TheMarchHare)

Bloatware removal - Com.android.snap and Com.gangyun.beautysnap

I made a screenshot of the service and program running underneath it, can't upload it here so I'll just type what it says from Malwarebytes' program list.

Com.android.snap

Com.gangyun.beautysnap

Package size: N/A

Installed: December, 31, 2008

Source: System

Last Update: December, 31, 2008

Version: 1.2.1_161230

Foreground Time: 0s

Last Used: N/A

Cache Size: N/A

Note that I cleaned program and cache data.

Also note that most system programs are set to 12/31/2008.

It looks like it never ran before.

It kind of looks like the same issue the Doogee and a few other chinaphones had.

https://xdaforums.com/showpost.php?p=75937426&postcount=51

Post #105 (by TheMarchHare)

Root/debloat/unroot tool with permanent root as an advanced option.

The rooting process is still too complicated for newbies.

I globally suggested a root/debloat/unroot tool with permanent root as an advanced option (since "the average user" is often fine with stock 7.0 as long as it's secure and debloated) but end of the line automation is most likely the key with this particular problem.

https://xdaforums.com/showpost.php?p=75991242&postcount=105

Post #106 (by YuriRM)

Script developed by KP@2016

Have a look at this script developed by KP@2016... it has everything that we have been asking for!

Coolpad Toolkit [Utility][Open Source]

By KP@2016, Member on 20th May 2017

https://xdaforums.com/android/software/utility-coolpad-toolkit-t3609653

Maybe you prefer this version with GUI

Le Eco & Qualcomm Toolkit

https://kpstvhub.com/blog/2017/04/06/le-eco-qualcom-toolkit-toolkit/

KP profile

https://kpstvhub.com/support/about-me/

https://xdaforums.com/showpost.php?p=75993426&postcount=106

Post #107 (by TheMarchHare)

A script to call this and perform the correct steps in order as set out on the first post to avoid any chance of bricking.

Perfect! Now all we need is a script to call this and perform the correct steps in order as set out on the first post to avoid any chance of bricking. This is easy enough for more experienced users but we have to keep in mind that most newbie users run a virus scanner, see a virus in their new phone and go "OMG help!?" when the virus scan mentions root requirement.

[MENTION=7424515]KP@2016[/MENTION] very well done do you think you could write an init script for this tool and a template for this model that meets all requirements and maybe verify it against the P8 Mini ROM?

That way it's easy to adapt for other China models already available and new models in the future.

https://xdaforums.com/showpost.php?p=75998543&postcount=107