yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] mobiware:
DRM Fix incompatible with Trim Area PoC

Well, that would be if I wanted to use Trim Area Proof Of Concept which is incompatible with DRM Fix.

I don't know anymore.
[Xperia Z5 Android Development] mobiware:
Hamed,

Thanks for your response.

1. The reason I posted here is that I used Tobias' script. I've read that people have had problems getting their SD cards recognized, so I hoped that someone with the same problem will be able to offer some help.

2.a) I can read the SD card on my ZL with fx Explorer. I can create a Test.txt file on the root folder of the card.

2.b) I changed the permissions of the card with Root Browser when I could not do that before when the card was in the Z5 slot.

2.c) Operations on the card would take unusually long to complete.

2.d) When I change the destination of pictures saved to SD card, although I have changed the permissions to the DCIM folder and subfolder, pictures don't seem to get saved there, when checking with fx and Root Browser. When I check in the camera app though, the last picture is there. When I search for it in the internal storage or the card, it's nowhere to be found! When I try to delete the picture from the Album app, it tries to load it forever without success!

3.a) I can read my other card (that was in my ZL) on the Z5.

3.b) I was able to also change the write access to this older card (although it's irrelevant for this.)

3.c) Operations on the old card are very fast.

3.d) I can save pictures on the older SD card DCIM folder when in the Z5, but I can only see them in fx Explorer. I cannot see the card in Root Explorer. I can delete those pictures from fx Explorer.

4. As I mentioned earlier, I flashed the following DSDS firmware for Nougat: E6683_Customized MY_1298-9654_32.3.A.0.376_R1D.

5. I noticed that both SD cards have their serial number saved as their name in the Z5 slot (e.g. "hhhh-hhhh" in HEX), as opposed to a name like "sdcard1" or "ext_card" (in different folders), when inserted in the ZL.

6. When a card is inserted in the Z5 slot, it doesn't have folders "ext_card" or "/mnt/ext_card" or "sdcard1". This might be of interest or the key to the solution.

To me, it looks like an issue with either Nougat or the kernel more than the card itself, or at least that's how things started. I'm running some diagnostics on the card in Windows, to see if that's the problem.

Any help would be greatly appreciated. :crying:

Thanks again guys!
[Xperia Z5 Android Development] YasuHamed:
thank you sir for the detailed answer about the behavior of your SD CARDs across two devices with two different Android versions over 3rdparty explorer

1. the old sdcard which you are able to Read in both ZL and Z5 indicates that there is no problem in devices / slots itself

2. the new sdcard however you are unable to read on z5 with firmare .376 (Android N) with fx explorer indicates your fx explorer dont have proper rights. can you try the same with FILE COMMANDER which comes within the stockrom ? because the filcommander has full rights over sdcard since its a core app and you cannot remove.

3. Android N has more security and even after root the /system folder stays READONLY. so i am only guess that fx explorer and root browsers are unable to change its permissions because it can be changed only via adb shell (so far) ,,, where ZL was stopped at android 5.1 and any rooted android 5.1 the /system folder can be easily altered.

4. you are not able to read pictures on your new sdcard via fx explorer but you can read pictures saved by SONY CORE APP galary indicates the same rights problems.

finally i am only guess that OLD SDCARD is different build (brand) and the new SDCARD is different build and brand and speed/encryption

the comparison has too many variables!

if two sd cards of same build/brand/speed are bieng compared with same devices z5 to z5 and on same android versions etc will give definate results but current situations is giving you 16:1 scenarios since sd cards are different mark/build/brand , devices are different and also android versions are different w.r.t to security and you are using third party apps

i am going to install fx xplorer in my z5p ( ROOTED, RW access given to /system folder, running 5.22 (april2017 android N built) and will update you with my findings....
[Xperia Z5 Android Development] mobiware:
Thank you so much as well. I do agree, things got too complicated. While you were writing this, I was writing the following:

NEVER MIND FELLOWS. THE CARD BLEW ITS GASKET! IT'S CORRUPTED. I READ THAT SOME OTHER FOLKS HAD THE SAME ISSUE IN NOUGAT. WE'LL SEE HOW IT GOES WITH A NEW ONE. THANKS FOR READING MY LONG POSTS.

I can't wait to find out about your findings. I'll let you know about mine with a new card. I assume you have yours formatted as portable, right? (Do you think we shouldn't use v5.23 of the script?)

AGAIN, THANK YOU, THANK YOU, THANK YOU!
[Xperia Z5 Android Development] YasuHamed:
hmmm well best of luck with you new sdcard sir

I have Toshiba SD CARD class4 8gb and i installed FX explorer and tried creating folder. please see the pictorial

I am on 32.3.A.2.33 - Rooted device - modified kernel by v5.23 script - RW access given to /system
[Xperia Z5 Android Development] mobiware:
Hamed,

Thanks so much for the screenshots. I still think something went wrong with how Nougat handled the permissions on the card which was going bad.

When I formatted the card the first time and ran fx, it have it quite access correctly. Them the card started going bad. I reformatted it, ran fx and it couldn't give it quite access because its internal name was different from the default name which fx expected (per me previous long post). Then the card became completely unreadable.

In any event, I'll report back when I get my new card.

Thanks again,

MW
[Xperia Z5 Android Development] rocker00:
Hi, you can try this app and see if it really works, https://play.google.com/store/apps/details?id=in.co.pricealert.apps2sd but it should work because according the the developer of the app one of the features is " SDFix (Fix external sd card write permission) ", since my device is z2 and no nougat so unfortunately i can't test but i remember i tried this app once before and i was able to have acces to sd card,i fixed sd card write permission by using xinternalsd xposed module but as you know there's no xposed for nougat yet, so give a try and report back.good luck.
[Xperia Z5 Android Development] f4t1:
SD Card problem

I also got the SD card problem.

I have a z5c E5823

I flashed rootkernel with 5.23

DM and RIC is disabled

DRM Fix y

TWRP and Superuser flashed manually

The solution with FX explorer doesn't work..

Any other solutions?
[Xperia Z5 Android Development] amirh8466:
Hi how can install twrp in 2.33 with root kernel 5.23?
[Xperia Z5 Android Development] YasuHamed:
make your /System Writable then plz try

https://xdaforums.com/xperia-z5/general/z5-making-writable-32-3-0-372-root-t3551067

---------- Post added at 10:59 AM ---------- Previous post was at 10:56 AM ----------

i guess you mean how to instal twrp 3.0.2 in root kernel 5.23 for Android N ( 32.3.A.2.33 )

if yes then

goto

rootkernel_v5.23_Windows_Linux\Android\twrp_common_kmodules

Copy FOLDER "3.10.84-perf-gda8446f" and paste there itself , it will appear as 3.10.84-perf-gda8446f-copy

rename it "3.10.84-perf-gda8446f-copy" to "3.10.84-perf-g1016077" {without quotes} and try now!
[Xperia Z5 Android Development] f4t1:
system is writable now, still the same: with fx explorer i cant create a file on sd card, when i click on enable write access the app crashes,

it also crashes when i open settings -> storage --> sd card

when i want to put the cache folder from spotify to sd card --> crash

when i want to save audio recording on sd --> crash

but i can open files which are on the sd card --> like pictures or audio

no problem when i make a file on the pc in the sd card

AND: i can also create a folder on the SD card , when card is in my mobile phone, with Root Explorer...
[Xperia Z5 Android Development] YasuHamed:
what is your device model and script version to patch kernel ? because with me its working perfectly perfect

https://xdaforums.com/showpost.php?p=71719719&postcount=2426
[Xperia Z5 Android Development] f4t1:
My Device: Z5C E5823

Script Version: 5.23,

DM and RIC Y,

TWRP N

Superuser N

Busybox N

I flashed TWRP manually via fastboot, and I installed Superuser in TWRP...

seems i could solve the problem: with superuser integrated via rootkernel tool, is noch problem...
[Xperia Z5 Android Development] YasuHamed:
can you recreate kernel but this time EMBED superuser and grant full /system actions via rootkernel script. I don't think so its kernel issue! its more like android N problem!
[Xperia Z5 Android Development] mobiware:
App2SD

Thanks for this. I am a bit hesitant to try it but I'll look into that. The reason is that I used "AppMgr Pro III (App 2 SD)" on my ZL SD card and it relocked the card or corrupted it partially. I cannot save any data from apps to the card after I used the app, but I still can create files manually!

---------- Post added at 10:33 PM ---------- Previous post was at 10:25 PM ----------

By the way, I have followed the exact procedure for my Z5 Dual (E6683) and have no access. My guess is that something in the script gets missed when we answer N to all of the questions above.
[Xperia Z5 Android Development] f4t1:
with embed superuser in the kernel it's working, i wrote this in the post...

when i flash a kernel with excluded superuser, (flashing it manually in twrp), over the existing kernel with embeded superuser then it works but when I flash stock rom via flashtool and afterwards flash kernel without superuser, it's not working...

system is always writable
[Xperia Z5 Android Development] YasuHamed:
since you have your workaround found which works for you! I would suggest keep superuser embedded. you will not battery problems because SUPERSU causes battery drainage!

moreover, i usually use FILE COMMANDER, infact i loved the app so much i bought it. however may be fx has some extra advantages which i don't know of.... however I don't keep dublicate apps since it over burdon ram. so try freezing the FAK and keep FX alive

further more! when you are embedding superuser in kernel you may consider changing FAK to user APP and removing and making FX explorer as System APP and REBOOT. this should give fx more powers as sys app.

you may use root-uninstaller pro
[Xperia Z5 Android Development] f4t1:
Normally I use solid explorer, same reason like you, i like the app :).

I also hates duplicate funcion apps...

What do you mean with FAK? my explorer is installed as system app, and other apps too...

I don't like apps like root uninstaller pro or titanium backup, i uninstall system apps over the explorer because then I exactly know what I do...
[Xperia Z5 Android Development] YasuHamed:
the File Command logo reads FAK ...

please explain what do u mean you remove app over the explorer
[Xperia Z5 Android Development] casouzaj:
It's FC!
[Xperia Z5 Android Development] mobiware:
Thanks for this. When you say system is always writeable, do you mean that you mount it by following the instructions from [MENTION=5613633]YasuHamed[/MENTION]'s thread?
[Xperia Z5 Android Development] f4t1:
I delete/ uninstall the system apps with my root explorer not with an extra app like system app remover or titanium backup

Exactly, I mount system with the instructions from [MENTION=5613633]YasuHamed[/MENTION]
[Xperia Z5 Android Development] dario2510:
Hi there. What will happen if i update to 2.33 via OTA? I just received the notification
[Xperia Z5 Android Development] mobiware:
Can you provide a little more detail on that?
[Xperia Z5 Android Development] f4t1:
i search where the apps are located

most are in system/apps or system/priv-apps

and then i click on the apk folder and delete them

bloatware are here located:

https://xdaforums.com/xperia-z5/help/bloatware-safe-to-uninstall-t3387202
[Xperia Z5 Android Development] appofox:
I have the same situation as butilities

flash_dk <TA backup> DK.ftf

results in

"Could not find device key in TA (Unit 0x1046B)".

Entering command including extension of the image file.

Tried on Windows 10 and Windows 7, different machines.

Tried with rootkernel versions 4.31 | 4.51 | 5.0 | 5.11 and 5.23.

Couldn't find solution. Asking for your help. TY.
[Xperia Z5 Android Development] YasuHamed:
if your device is rooted the rooting will be void.

you will have to flash kernel again

---------- Post added at 10:11 AM ---------- Previous post was at 10:09 AM ----------

could you try unofficial 5.23 (extention to original 5.23 script by [MENTION=3989065]serajr[/MENTION]

https://xdaforums.com/showpost.php?p=71175804&postcount=2236
[Xperia Z5 Android Development] f4t1:
Had long time Ago the same Problem : you didn't install all drivers correct (google and Sony driver). Your TA Backup is corrupt....

Drm keys probably lost
[Xperia Z5 Android Development] appofox:
I have tried. The result is the same.

Is there any way to determine is my TA backup really corrupt? Can the size of TA tell something? Mine is 2 097 152 bytes which equals in 2 Megabytes...
[Xperia Z5 Android Development] dario2510:
So i will Just have to modify the New kernel and flash it again, withous any data loss?
[Xperia Z5 Android Development] f4t1:
Did you install all drivers Correct? So everything was green In the setup Menu?

When yes, The TA should be OK, if not, the TA is corrupt....
[Xperia Z5 Android Development] YasuHamed:
OTA never wipes / delete any data. they just replace few files form /system
[Xperia Z5 Android Development] soodroid:
please help

"i have xperia xa ultra dual f3212" i have 3days trying repack my kernel with this great tool and i stuck in this step i tried it in linux windows and same problem

and its strange i cant see any error !! what i did wrong ( i extraxted the kernel from ftf (boot.sin) and used sin editor on falshtool and i extracted the data to boot.elf and then puted it in this tool directory and rename it kernel.elf and i run terminal in this folder as you see but it stuck there :(((

toshiba@linux-kvsv:~/Téléchargements/android_rootkernel-master> chmod +x bootimgtoshiba@linux-kvsv:~/Téléchargements/android_rootkernel-master> bash rootkernel.sh kernel.elf boot.img

Rootkernel V5.23

- Unpacking kernel

Found elf boot image

Kernel version: 3.18.22

Found appended DTB

- Detected vendor: mediatek, device: MT6755, variant: MT6755

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 6.0
[Xperia Z5 Android Development] serajr:
This tool will tell you!

Did you already try V5.0? The last one for MM (if I'm not wrong)!
[Xperia Z5 Android Development] soodroid:
i tied	rootkernel_v5.23_Windows_Linux.zip

rootkernel_v5.11_Windows_Linux.zip

rootkernel_v4.51_Windows_Linux.zip

and its the same problem dude :(((
[Xperia Z5 Android Development] mobiware:
Verification of integrity of TA partition

Hey [MENTION=3989065]serajr[/MENTION],

I was curious: why does Norton kill the DirtyCow executable? Also, can we verify the integrity of the TA partition via the iovyroot tool somehow?

Thanks,

MW

---------- Post added at 11:55 PM ---------- Previous post was at 11:07 PM ----------

I am in the process of reflashing the newest version of Nougat (32.3.A.2.33). When I open Flashtool, I get the following error:

09/049/2017 23:49:06 - ERROR - C:\Users\mobiware\.flashTool\firmwares\prepared\boot_delivery.xml (Access is denied)

When I close and reopen Flashtool and retry it, I get:

10/025/2017 00:25:39 - ERROR - Can't read a byte value

10/025/2017 00:25:39 - ERROR - Error flashing. Aborted

Do I need to unlock my bootloader again? Any other ideas?
[Xperia Z5 Android Development] YasuHamed:
seems like fsscript issue, when you were preparing the tft file via flashtool, did it prompt you about script

?

32.3.A.2.33 is latest android and can only be flashed by 0.9.23.2 version. you may have to download xjar files from the download page and replace them with the old one. this will update 0.9.23.1 to 0.9.23.2
[Xperia Z5 Android Development] soodroid:
Download this xflasher.jar from flash tool download link (patch) (googleit) and replace the old one in the flash tool directory
[Xperia Z5 Android Development] BrainstormPL:
Kcal control doesn't work, even when renamed the folder
[Xperia Z5 Android Development] appofox:
With

safe_ta_dump

I get

adler32:0x22EE1916 calc_adler32:0x22EE1916
adler32:0xEFA6EDE7 calc_adler32:0xEFA6EDE7
adler32:0x0D1CEDE0 calc_adler32:0x0D1CEDE0
device: E5823
serial number: CB5A282E0U
Trim area dump is a valid.
Unlocked bootloader.

Does this indicates that my TA image isn't corrupted? If yes, why can't I extract keys with rootkernel's flash_dk.cmd?
[Xperia Z5 Android Development] mobiware:
Flashtool 0.9.23.2 ERROR - Access is denied to XML

Thanks [MENTION=5613633]YasuHamed[/MENTION]. I have installed 0.9.23.2 originally with the patch from 0.9.23.1 and with th e latest Java 1.8.0_112 64bits Edition. I didn't get any messages about a problem with the script either. This is weird.

Also, I didn't get the choice to have TWRP integrated or not into the kernel when running the script, as before!

Something else that was interesting was that my FTF was 3 bytes smaller than [MENTION=5813612]sceryavuz[/MENTION]'s FTF. Java, java, java...

If I redo it and it works, do I need to unlock my bootloader again, flash the FTF and then flash the rooted kernel from scratch?

If I don't redo it, can I flash the OTA update and then reflash the rooted kernel?

---------- Post added at 12:36 PM ---------- Previous post was at 12:28 PM ----------

Thanks again [MENTION=4702982]rocker00[/MENTION]. I finally tried App2SD (also spelled as Apps2SD when you open it!!!) It still didn't work. It looks like it has with "superuser" missing some permissions or giving permissions itself to the card (maybe the permissive mode didn't work from the script in the first place as "superuser" wasn't integrated in the kernel.) It looks like we have to integrate "superuser" in the kernel when modifying it. Do you think I explained it correctly [MENTION=5613633]YasuHamed[/MENTION]?
[Xperia Z5 Android Development] munjeni:
You can't extract keys because your TA.img backup is from unlocked bootloader, so no drm keys! Its not corupt.
[Xperia Z5 Android Development] YasuHamed:
I am glad you were able to fix the problem

1. once bootloader unlocked, it unlocked for good. whether you upgrade/ reflash /downgrade, bootloader will always be unlocked.

2. what's your device and which build you are flashing. there is way to integrate twrp.

3. either you upgrade via OTA, / FLASH / Reflash , in all cases KERNEL.sin & system.sin file get REPLACED / upgraded / flashed in flashmode by flasher tool (Xperia Companion, Emma, or xda Flashtool) hence rooting gets VOID and you have to flash the modified patched kernels.
[Xperia Z5 Android Development] mobiware:
I actually was not able to solve the problem; it's still giving me the same errors in Flashtool!

1. I understand that the bootloader is going to stay unlocked. Why does the Rooting status in configuration show as "Bootloader unlock allowed: Yes" then? Isn't that when the bootloader is locked?

2. I have an E6683 Z5 and I want to flash 32.3.A.2.33. I did flash 32.3.A.0.376 successfully before.

3. Do I not need to flash the whole FTF or just fastboot the kernel? I would think I need the whole FTF.

Thanks again,

MW
[Xperia Z5 Android Development] soodroid:
So your bootloader is still locked, then try to full unstall flash tool (delete all its files were installed) then reinstall it.. Copy the xflasher. Jar (patch) in the flash tool directory, reunlock your bootloader and then flash whole ur ftf if you want whole stock firmware and if you want just the kernel which you customized (repacked) with this tool then you can just fast boot it
[Xperia Z5 Android Development] YasuHamed:
0. if you are getting same error then could be problem with drivers, c:\flashtool has drivers folder and there is this setup file, please install

1. the "Bootloader unlock allowed: Yes" is just an indicator that sony will send you keys to unlock your bootloader. if it was ""Bootloader unlock allowed: NO" this means your bootloader can ever be unlocked

2. using FLASHTOOL ... XPERIFIRM you can download your firmware and flash it in flashmode , later flash the kernel in fastboot mode.

details https://xdaforums.com/z5-premium/general/rooted-stock-modified-kernels-32-3-0-t3556874

3. you need to flash whole ftf ( or atleast the system.sin file + kernel) in order upgrade. however partial flashing and/or OTA update has always given me battery drainage problem. so i always recommend my fellow user to flash fully.
[Xperia Z5 Android Development] shoey63:
[MENTION=2024468]mobiware[/MENTION]

Haven't you already unlocked your bootloader and tried various versions of rootkernel and PoC?

In that case, of course "bootloader unlock allowed = yes" is displayed. That means the tool has done its job. ie: trick the phone into believing the bootloader is locked, when in fact, it isn't.
[Xperia Z5 Android Development] sersomy:
I ask for help. Who can pack the TWRP into this stock kernel? In this rootkernel I will not break it.

---------- Post added at 04:45 PM ---------- Previous post was at 04:30 PM ----------

Where to get the instruction for rootkernel?
[Xperia Z5 Android Development] dermaze:
It's all described in the first post of this thread. Please read it thoroughly and completely.

In case you need help beyond that, please be more specific about what you need help with.
[Xperia Z5 Android Development] soodroid:
Hey please i need help!!! :(

I have Xperia xa ultra dual f3212 i backed up the trim aria (ta) and i unlocked the boot loader, i flashed twrp and then i nstalled super su and xposed, i tried the poc nd restored my drm key and boom i got bootloop stuck in sony logo so.. I reunlocked nd i flashed stock firmware,

now im tying to repack my kernel with this tool to restoring my drm keys and keep twrp to flash my stuff

So i tried this tool all versions and tried in both os windows and Linux and i stuck here always! What should I do!!

toshiba@linux-kvsv:~/Téléchargements/android_rootkernel-master> chmod +x bootimgtoshiba@linux-kvsv:~/Téléchargements/android_rootkernel-master> bash rootkernel.sh kernel.elf boot.img

Rootkernel V5.23

- Unpacking kernel

Found elf boot image

Kernel version: 3.18.22

Found appended DTB

- Detected vendor: mediatek, device: MT6755, variant: MT6755

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 6.0
[Xperia Z5 Android Development] sersomy:
My English is bad. I downloaded version 5.23, unpacked it and clicked on rotokernel. The window opened and closed. The program does not start. How to launch it and how to package the recovery in the stock kernel?
[Xperia Z5 Android Development] mobiware:
Rootkernel doesn't work with devices that have a Mediatek processor that yours does. When you tried the PoC process did you post your logs to the thread? [MENTION=4120742]munjeni[/MENTION] and those guys are very responsive.

I tend to think your best bet is to reinstall everything and restart the ToC process.
[Xperia Z5 Android Development] soodroid:
Finally some answer here thank you so much but dude my account in xda is new so im not able to share the log in the poc thread cause it says its only for developers.. So I'll try your idea with poc and then i will quote you the result ;)
[Xperia Z5 Android Development] Berni-0815:
It is a commandline tool. You have to specify two parameters. First is the name of the kernel (.elf), second is the name of the new kernel image to be created:

rootkernel.cmd <your-kernel.elf> newkernel.img

That's all written in this thread...

BTW:

My answer above also... :angel:

So, please read before writing..... :cool:
[Xperia Z5 Android Development] YasuHamed:
what is your device / build version.

this script can do the job!