yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] Hamidreza2010:
Yes i read that.

i just want to tell i try some command but unsuccessful

i also found correct recovery and flash via fastboot and try to enter to recovery but again cant enter to it
[Sony Cross-Device General] munjeni:
But this worked? You have redirected output to file last_kmsg.log , just open that file and see if it is not empty :)
[Sony Cross-Device General] Hamidreza2010:
yes its get log but in log just can see this line:

cat: can't open '/proc/last_kmsg': No such file or directory
[Sony Cross-Device General] munjeni:
thats because you redirected seccond command which not worked! OMG mate

Do only this and you are done:

adb shell cat /sys/fs/pstore/console-ramoops-0 > last_kmsg.log
[Sony Cross-Device General] Hamidreza2010:
bro i just type that command and get log , when i saw that error , test another command

you tell me what should i do and which command exactly

i type all command one by one separetly
[Sony Cross-Device General] munjeni:
Do this first (don't forget you must do this after bootloop on next boot):

adb shell ls /sys/fs/pstore

I will tell you excatly what you need next
[Sony Cross-Device General] Hamidreza2010:
see
[Sony Cross-Device General] munjeni:
adb shell ls /sys/fs/pstore
[Sony Cross-Device General] Hamidreza2010:
ok:

THIS IS MY FIRST BOOT
[Sony Cross-Device General] munjeni:
I can't help sorry :crying:
[Sony Cross-Device General] munjeni:
Did you contacted guy which I told you by pm?
[Sony Cross-Device General] Hamidreza2010:
Special thanks for your guidance bro

have a nice time always

---------- Post added at 08:45 PM ---------- Previous post was at 08:43 PM ----------

yes he told me type :

adb shell cat /sys/fs/pstore/console-ramoops-0 > last_kmsg.log

i do that but get error which i put above
[Sony Cross-Device General] munjeni:
But how than nothing in /sys/fs/pstore dir? Seems your next boot was not till after bootloop? Can you give output of command:

adb shell ls /sys/fs
[Sony Cross-Device General] Hamidreza2010:
special thanks bro

i think the path of this log has been changed in android N ( my idea ) but dont know

please let us know

thanks again
[Sony Cross-Device General] Hamidreza2010:
yes see please
[Sony Cross-Device General] munjeni:
I don't think, [MENTION=3059405]steom[/MENTION] had nougat when we tested things and path was ok. Maybe your kernel didn't crashed! ;) Can you try connect adb while your failed recovery stay at bootloop?
[Sony Cross-Device General] Hamidreza2010:
No i try that

when i connect usb and want to use adb , tell me " didnt recognize any device " ( just similar this )
[Sony Cross-Device General] munjeni:
Ok, than probably last kmsg seems stored in another place. You will need ask some devs from your device forum, I can't do anything to recovery bootloop without last kmsg :( Maybe you can try with grep command to locate path of the last kmsg:

adb shell grep -r kmsg /

or this one:

adb shell grep -r oops /
[Sony Cross-Device General] Hamidreza2010:
Ok bro

I take topic in z5 forum but till now nothing in it.

if i / we can get log , let u know

thanks a lot
[Sony Cross-Device General] munjeni:
Sorry, for grep command, right command is

adb shell find / | grep oops

Or

adb shell find / | grep kmsg
[Sony Cross-Device General] 2ddssa:
In my Z1c - not autocopy TA.img to data/local/tmp and no signal/drmkey(screenshot attached)

dmesg

If manualy cope TA.img in .data/local/tmp - mobile network - worked, but DRM keys are missing(also attached screenshots)

dmesg

I use latest lp 5.1.1 stock .236 firmware, non modified stock kernel ffrom .236 and latest PoC for modification kernel. if if more was needed the logs - I'll take
[Sony Cross-Device General] munjeni:
Which poc you used? Jb? Can you post your patched new_boot.img? And please give output log of the poc
[Sony Cross-Device General] whalesplaho:
i av been trying buh no luck too.... no such directory!
[MENTION=4120742]munjeni[/MENTION]
[Sony Cross-Device General] munjeni:
Try to locate right path with this https://xdaforums.com/showpost.php?p=71089049&postcount=504
[Sony Cross-Device General] 2ddssa:
yes, Jb, log here

new_boot.img - packed in zip archive
[Sony Cross-Device General] whalesplaho:
still no luck..... cant get dir!!!

:crying::crying::crying:
[Sony Cross-Device General] munjeni:
New version is out, let me know please!
[Sony Cross-Device General] 2ddssa:
autocopy - worked correctly, drm - none, dmesg here
[Sony Cross-Device General] fluffi444:
Did you try another reboot after first boot with this 'none' in keys?

For me keys show up after second reboot after kernel flash
[Sony Cross-Device General] 2ddssa:
after several reboot status not changed
[Sony Cross-Device General] munjeni:
I forgot to tell that... On first time only, two reboots is realy need!
[Sony Cross-Device General] 2ddssa:
not affected for me :(
[Sony Cross-Device General] munjeni:
Are you sure TA.img is from that phone!? Please look into poc log serial number and serial number of the your phone to be surre about it
[Sony Cross-Device General] 2ddssa:
Yes, I have created the backup, and recovery of its DRM keys in place, but I look for it, I had another backup of art created immediately when the phone is picked up to .157 firmware
[Sony Cross-Device General] munjeni:
Is this serial number the same on your phone?

serial number: CB5A234XWL
[Sony Cross-Device General] munjeni:
Installed right now on my z1c and I can confirm all things working ok! I'm on .108 fw
[Sony Cross-Device General] 2ddssa:
attach screenshot out "adb devices" in previous mesage
[Sony Cross-Device General] munjeni:
Hmm on your log I can see:

Kernel command line: androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3b7 ehci-hcd.park=3 androidboot.bootdevice=msm_sdcc.1 dwc3.maximum_speed=high dwc3_msm.prop_chg_detect=Y vmalloc=300M msm_rtb.enable=0 androidboot.emmc=true androidboot.bootloader=s1 oemandroidboot.s1boot=1270-3115_S1_Boot_MSM8974_Rhine1.3.1_LA1.04_16 androidboot.serialno=CB5A234XWL [COLOR="Red"]ta_info=1,16,256[/COLOR] startup=0x00000004 warmboot=0x77665501 oemandroidboot.imei=3573590610024700 oemandroidboot.phoneid=0000:3573590610024700 oemandroidboot.security=0 oemandroidboot.securityflags=0x00000003 androidboot.baseband=msm

This might be a causal of the missing drm since 1,16 :(
[Sony Cross-Device General] munjeni:
New version is out, all phones which uses 1,16 parameter for tad service will work now, thing is now autodetected and one empty block auto inserted to ta image, let me know! I have tested on my phone which have that 1,16 and definitelly it working (have no idea how it even worked on my phone) :)

Edit:

In most case it worked on my device with that 1,16 parameter since my drm keys in my own ta is in block 2, but probably because your drm keys is in block 1 its skipped because kernel parameter was 1,16 , it will work defnitely now
[Sony Cross-Device General] Klaus N.:
[MENTION=4120742]munjeni[/MENTION] [MENTION=3989065]serajr[/MENTION]

First of all, thank's a lot for your efforts!

The first thing is, I've successfully created a new_boot.img for my nephew's Z1C device, running latest (236) stock fw.

Unfortunately on my, my Z5 device (E6653), running 5.11 mm fw, every try stops with an error (the kernel is recognized as one of a F5321 device). This happens with every Z5 mm fw I've tried. And with the current Nougat fw, there's only an error displayed, without any description.

Thanks in advance!
[Sony Cross-Device General] 2ddssa:
sorry for slow reply, its same, drm none on stock .236 and latest PoC, dmesg

I also checked called you earlier .108 firmware to the previous version PoС - it works correctly and I, if you want - i attach taked screenshots security section service menu to confirm that the correct backup TA

UPDATE

if i flash in .238 XZDR from NUT - drm key correclty mounted, but I would like to mount without it, as the same .108fw
[Sony Cross-Device General] meistr91:
same here :?? any ideas how to solve?

edit: i even get this error, if i start double click me tool without any kernel file in poc folder..
[Sony Cross-Device General] shoey63:
Rename kernel.elf to mm_F5321_34.1.A.1.sin.elf (or whatever it says it can't find) and try again.
[Sony Cross-Device General] munjeni:
Sorry I don't know what you have doing nor which kernel you used nor if kernel is stock or not nor if you installing something more, even in your dmesg have nothing about tad service which is realy strange... I have tested poc on my z1c and apsolutly it works! Please double check what you doing! If you uses non stock kernel make sure to modify scripts for your needs I not going for doing that since our poc is for stock UNMODiFIED kernels
[Sony Cross-Device General] :
stop ! there is some misunderstanding, which you did in hurry.

trim area partition is 2048kb, 16 blocks of 131072 bytes ALWAYS

HOWEVER, some ( probably, until marshmallow ) kernels using absolute offset from eMMC start :

service tad_static /sbin/tad_static /dev/block/mmcblk0 1,16

so it is offset 0x20000 from eMMC start, 2048kb size

and newer kernels addressing trim area partition directly, because on some new phones trim area partition is not at 0x20000 offset :

# Last 2 args: start block(blk size 128k), number of blocks(partitionsize(kb)/128(kb))
service tad_static /sbin/tad_static /dev/block/platform/msm_sdcc.1/by-name/TA 0,16

ergo :

you should always use

service tad_static /sbin/tad_static /data/local/tmp/TA.img 0,16

and of course do not add any "empty blocks", as it will break boundary checks in tad
[Sony Cross-Device General] serajr:
[MENTION=4898998]Klaus N[/MENTION]

[MENTION=6364196]meistr91[/MENTION]

Exactly... or better yet, by manually tipying in a command prompt:

nougat_ta_poc kernel.elf TA.img ramdisk
[Sony Cross-Device General] munjeni:
[MENTION=3665957]the_laser[/MENTION] no. I added support only for old kernels which uses that 1,16 parameter! Its now auto detected and changed on the fly. If script didn't detect 1,16 in unmodified ramdisk it will stay 0,16 and empty block will not be inserted! I clearly understand how tad_static working! In case script detect 1,16 in unmodified ramdisk empty block will be injected and .rc will be changed to this:

service tad_static /sbin/tad_static /data/local/tmp/TA.img [COLOR="Red"]1,16[/COLOR]

Booth tad and kernel will skip that empty block! :)
[Sony Cross-Device General] munjeni:
New version is out, finaly no more jb,mm,nougat .exe, all is now in just single exe! :)
[Sony Cross-Device General] XperiaAwesome2000:
Hi!,

I love the effort you put into this whole project, Big thumbs up!.

However I am trying to patch the AndroPlus kernel for my Xperia Z3 (D6603) but I ran into one issue.

I searched the whole thread but I can't seem to find a solution that exactly solves my problem here.

Here is the complete log and the error I am getting:
[Sony Cross-Device General] munjeni:
Its mentioned allready. That boot.img contain two ramdisks, one is ramdisk for recovery and seccond is ramdisk for android, curently not supported something like that! You need to make script for extracting and patching that

found string in [COLOR="Red"]ramdisk/sbin/ramdisk.cpio[/COLOR]@0750

and when things done, when things patched, convert it back to ramdisk/sbin/ramdisk.cpio@0750 and finaly continue tool from a part when it failed :) My tool contain some extended tools like unpack cpio, gunzip, gzip, mkcpio , type ta_poc for idea! Fill free to implement support for that type of boot images into script! :)
[Sony Cross-Device General] shoey63:
That kernel probably uses the old 2 stage boot method where recovery.cpio (which contains file_contexts) resides inside /sbin in the ramdisk, so the tool can't see it.

Edit: pull it apart to see what's going on. [MENTION=4120742]munjeni[/MENTION] and [MENTION=4544860]osm0sis[/MENTION] both have windows tools for that purpose.
[Sony Cross-Device General] 2ddssa:
Since you do not believe that I am using kernel stock or am I doing something wrong - I recorded your video, I did not particularly accelerated and cut waiting to be seen that no further action I did not commit. The difference - in only one I downloaded again firmware for video recording and for tests I use the absolutely stock firmware without any modifications

Enough small change in the kernel to work properly PoC?

P.S. I repeat, at .108 at me, too, everything works fine, except for the different versions of .108 and .236, I have not tested.
[Sony Cross-Device General] xRevengerZee:
I just installed you're latest poc I've put my Ta.img and stock kernel elf into poc folfer i changed kernel name in fouble click me all wofking great i got my new_boot.img what do i need to do next sir?
[Sony Cross-Device General] munjeni:
Well, only one thing which you not done is: you not flashed new_boot.img!!! See your video at time 19:50 !!! :)
[Sony Cross-Device General] munjeni:
Just flash that new_boot.img using fastboot and you are done
[Sony Cross-Device General] munjeni:
New version is out, exported mising makecpio tool, now I have added small example how boot images which have two disks can be proccessed (see patch_things.sh comented lines)
[Sony Cross-Device General] 2ddssa:
19:33-19:48, log flashtoo there as seen in the last seconds with success
[Sony Cross-Device General] munjeni:
Sorry I see now. Hmm, one thing maybe... Do you have the same version rom (curently on your phone) and same version kernel? And does your rom (curent rom) modified? If all ok I am realy sorry I have no idea why thing not working! Please double chech all

Edit:

I going right now to download excatly the same rom and try things by self on my z1c, will let you know!
[Sony Cross-Device General] 2ddssa:
Yes, the same kernel and firmware versions, for the tests - using unmodified rom and unmodified kernel.

Just earlier the man said that he had to .236 this hack works is that surprises me no, he wrote that successfully created, and not about his work

When there is information about a similar hack - I edited the ramdisk manualy and... got the same thing on a stock kernel and custom firmware based on the .236, if I flash xzdr - hack worked DRM keys were seen, if i removing xzdr of nut - everything returned to none.

Once came across your great tool, I returned again to the experiments but on full stock, if i modified firmware installation xzdr - and now restores the operability of this hack

Update:

I probably will try on other versions of the firmware that I have on the PC, after the report on the results
[Sony Cross-Device General] munjeni:
MM? Sorry but where is seen, I can't see?

I see warning for sony ric, can't see warning for dm verity!

Sony RIC:
Warning, no ramdisk/init.sony-platform.rc !

thats mean that init.sony-platform.rc not exist while looking for that file and string "mount securityfs securityfs".

Guys, I can't support every kernel! Fill free to implement by self support for your type of kernel image, try to understand our scripts please! Simple research by self in your extracted ramdisk and modify scripts for your need, I realy have no free time to support scripts, fill free to modify, post, optimise, whatever you want with it, making signle script for all sony xperia kernel is possible but I realy not going to waste my time with it. Again, fill free to improve our scripts! All which I can do is poc improvements (exe), the rest you need to improve (thats a reason why I moved all things out of exe)
[Sony Cross-Device General] munjeni:
You are right! I have installed right now .236 and everything is working but keys "none", wth :eek:
[Sony Cross-Device General] x_one:
If anyone is interested in changing swappiness value here is small script to add based on [MENTION=3989065]serajr[/MENTION]'s scripts.

Copy it to scripts of the POC and add to script.bat this before last echo.:

:: change swappiness
echo.
busybox ash scripts\change_swappiness.sh %1 %2
if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )

updated as [MENTION=4120742]munjeni[/MENTION] said. :)
[Sony Cross-Device General] munjeni:
I am unable to figure out why none in keys, which I found is everything other than that is right, for example serviceinfo/configuration I can see "bootloader unlock allowed: yes" which mean trim area realy displays right info "not unlocked", other than that in simlock also I can see everything right, also I have mobile signal...etc, only that missing keys in security tests. I think its ok, probably an bug exists which I am unable to fix, sorry! In general I think poc is fully working without that keys "none". If you solve let me know please!
[Sony Cross-Device General] munjeni:
You must notify user if init_sony_platform.rc not exist, I found that but and fixed by this:

local rcfile=$(find_file $RAMDISK/init.sony-platform.rc)
[COLOR="Blue"]	if [ -z $rcfile ]; then
ui_print "Warning, no $RAMDISK/init.sony-platform.rc !"
exit 0
fi[/COLOR]

it just notify user about unsucesfull patch because missing file!
[Sony Cross-Device General] x_one:
Yes! Changing it..
[Sony Cross-Device General] munjeni:
I'm getting empty value:

Current value:
[Sony Cross-Device General] x_one:
What the... Erm..

Maybe it's because I couldn't solve it using "perform"..

I need check it :)
[Sony Cross-Device General] munjeni:
Maybe this better idea?

change_swappiness() {
local change=0
local rcfile=$(find_file $RAMDISK/init.sony-platform.rc)
[COLOR="SandyBrown"]	if [ -z $rcfile ]; then
ui_print "Warning, no $RAMDISK/init.sony-platform.rc !"
exit 0
fi[/COLOR]
swpin=$(grep 'swappiness' $rcfile | awk '{print $3}')
[COLOR="RoyalBlue"]	if [ "$swpin" == "" ]; then
ui_print "no swappiness in rc file."
exit 0;
fi[/COLOR]
echo "- Current value: $swpin"
read -p " Enter new value (0-100) or leave empty to skipp: " swpout
[ -z $swpout ] && echo " Skipping. . ." && return
ui_print " Setting new value: $swpout. . ."
perform sed -i -e "s!swappiness $swpin!swappiness $swpout!" $rcfile
}
[Sony Cross-Device General] levone1:
Request for anyone here... (I hate to be a pest to munjeni, with all else he has to deal with and all he's done for me already...) I understand that this proof-of-concept is a work in progress, and currently is only dependable with stock kernels, but that the hope is that it would be eventually able to work mounting stock ta onto custom kernels, (a dream come true for all). I'm not too interested in using with stock, since there is already tools/options available to do that, and my device, (Z1c), stopped receiving updates at LP, so I already have ta backed up, and rom backups with ta preserved, etc. I would like to do all I can to help with the next step. I have tested and experimented with 2 or 3 MM and N roms, using 3 different versions of the tool, and custom scripts that munjeni made me, which have to be slightly modded with different attempts. Currently, I can successfully get the tool to create new boot.img with custom, AOSP-based, MM and N roms, and flash the new boot img, and all boots ok. However, there is no change in camera, and no sim service. I have followed the thread, and try to apply new direction, ideas, etc, to my attempts, as we go, (for example, TA img in /data/local/tmp, with chown tad, etc...). The things I have tried seem to be successful, (no errors), but still no change... Munjeni has indicated that there is work to be done, and I should practice modding/creating scripts, etc., but I am very much not a dev, just an experienced tinkerer, learning as I go. I will try many things, but creating scripts is over my head atm... So my request - anyone with more insight than me, and willingness, give me some tips, pointers, push in the right direction, etc, of what to try from here. I am willing to help, but am in the dark.

Thank you all for your efforts...

BTW - I'm sure others better than me are already working on this anyway, but just putting it out there....
[Sony Cross-Device General] x_one:
For sure..

I thought that swappiness is always there.. I don't have much experience in boot editing :o

**file updated
[Sony Cross-Device General] 2ddssa:
Maybe next weekend I will try again to see what was making the installer xzdr if something will come out - inform u, but if not ... same result I got on all 5.x.x fw... .157 already works correctly
[Sony Cross-Device General] :
your latest patcher doing from

service tad_static /sbin/tad_static /dev/block/mmcblk0 1,16

next

service tad_static /sbin/tad_static /data/local/tmp/TA.img 1,16

plus adding empty block

if [ "$TAPARAM" == "1,16" ]; then
ui_print "found 1,16"
perform cat binaries/null_ta_block TA.img > $TAIMG
else
perform cp -fr TA.img $TAIMG
fi

and it is WRONG, even if it working on your phone !

proper patch will be :

service tad_static /sbin/tad_static /data/local/tmp/TA.img 0,16
[Sony Cross-Device General] munjeni:
Yes but what about kernel command line which on boot have appended serial number... ta_info=1,16,256, what about that? It must be also changed!?

Edit:

I'm realy lazy to download old kernel source just for analysing that part of kernel, instead I will revert to 0,16, have no sense wasting time on an legacy pre mm things, you are right! Things works even with 0,16, don't have any info/idea why kernel ta_param is appended to the command line and what use is of that
[Sony Cross-Device General] serajr:
Great one! :good:
[Sony Cross-Device General] munjeni:
You are already good in doing that! Few things or less things more and wholaa perfect. Effort is most important than anything, with an constant practise your skills will move up :)
[Sony Cross-Device General] Klaus N.:
On my nephew's Z1C device, after flashing the created new_boot.img and rebooting, under *#*#7378423#*#* > Security, there's "None" :confused:

The device is running the latest Sony stock fw (236).

Any help is appreciated!

Thanks in advance!
[Sony Cross-Device General] munjeni:
Oh mate but we speaking about it 3 pages allready, please go back 3 pages and read up everything until the ond, at the almost end you will find ansver for it :)
[Sony Cross-Device General] zacharias.maladroit:
https://xdaforums.com/showpost.php?p=71102559&postcount=284

is my position on this

even if I used it and had a backup of

my

TA partition, you sure I would want to share that specific "license" ?

nope ...
[Sony Cross-Device General] xRevengerZee:
look bro heres what i did step by step

1: unlock bootloader

2: get kernel elf from the rom i.am using

3:install you're "poc" tool only nothing else!

4:run it made new boot.img succesfuly

5:i type fast boot flash new_boot.img it wont work why?

6:phone z2 D6503 plz help>?
[Sony Cross-Device General] Klaus N.:
That's wrong:

'fast boot flash new_boot.img'

Correct:

'fastboot flash boot new_boot.img'

---------- Post added at 23:55 ---------- Previous post was at 23:45 ----------

Ok, as far as I've understood, my new_boot.img of my Z1C device has 2 ramdisks, and it points to the wrong one atm. And therefore I have to patch it.

Is this correct?

If yes, then I've to give up, unfortunately :p

Thanks in advance!
[Sony Cross-Device General] xRevengerZee:
ye bro i forgot to say i did it correct and flashed the new boot .img but phone turns on recovery led flash/s then bootloop and i said above the steps i did can someone say the whole step by step guide to get it fully working cause we need to help each other we cant relay on op to do everything
[Sony Cross-Device General] nosiobadx:
[MENTION=5396196]airlessproject[/MENTION] Maybe this tool can help you with the rom RR your building for Z3+
[Sony Cross-Device General] Helmut.Hartmann:
Helo munjeni,

with your new Version, everything works as expected. Thanks for your help.

Ha
[Sony Cross-Device General] 2ddssa:
on 5.x.x android fw from z1c(and maybe others phones?) incorrect work PoC(what we discussed in the last pages) why so - is unknown, whether fixed - is unknown, maybe if it was reported that there is not.

Regarding the 2 x ramdisk - in extreme cases it can still be perverted with the substitution, in another kernel, patched and return to the place in your kernel, if you do not want to manually patch the ramdisk, which is also an option