yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] FakeMobile:
Hello , after flashing the new kernel i have no sim problem .

I have Xperia xz (F8331) , i use kernel from MM_39.0.A.3.30.

I attach the output below.

P.s

I tried to disable RIC and dm-verity at first and got the same no sim problem.

then I tried without disable anything and I got the same problem
[Sony Cross-Device General] munjeni:
Without dmesg I can't help you
[Sony Cross-Device General] munjeni:
Thanks! This one extracts sin and makes flashable zip (curently 80% done) :) Can we contact Igor Pavlov to implement selabels list print into 7z ?

Edit:

improved tool, was missed folders where symlinks need to be created :)
[Sony Cross-Device General] serajr:
Bro, if this is the only way to achieve that, why not?

I don't know if this will work, but, is there a way to mount ext4 image into a folder, collect desired info and/or make changes and then unmount it?

Something like this (linux):

mkdir -p /virtualdisk
mount -o loop system/system.sin.ext4 /virtualdisk
cd /virtualdisk

(COLLECT INFO)

umount /virtualdisk

busybox.exe has no mount applet, maybe mount.exe/unmount.exe from cygwin. Just guessing!!
[Sony Cross-Device General] munjeni:
Thats not posible since linux kernel is need for mount, there is some apps for windows which can mount ext but dont't know if even we can use it somehow with script, I have registered account on sourceforge and opened a thread in 7z, waiting thread approval, hope we get reaply :) Ideal thing would be having selabels list from 7z
[Sony Cross-Device General] FakeMobile:
here 3 log , a stock one and the one I used with your tool

(I don't know how it work so i attached 2 log of poc one after boot, and one minute after boot)
[Sony Cross-Device General] munjeni:
I didn't see any problem in your dmesg! See:

[ 22.415154] init: Service 'exec 24 (/init.ta.sh)' (pid 819) exited with status 0

That mean ok. Make sure you use right kernel and make sure your TA.img is excatly from that phone! And probably you will need to wipe data factory reset in case no one of this working for you. Other that that maybe you have old TA.img in /data/local/tmp in case old parameters is 0,16 but new one probably reguested 1,16... so try to remove TA.img from /data/local/tmp and reboot! Anyway I saw some dinials in your dmesg and add to the new version, try new veersion!
[Sony Cross-Device General] FakeMobile:
The new version attached to the first post?
[Sony Cross-Device General] FakeMobile:
I tried your tool with another stock (F8331_39.0.A.1.213_1305-9052_R3B) , i tried first with stock kenel

and then with custom kernel , both the TA work , but It still say I don't have SIM,i attached dmesg from custom kernel with poc

anyway I wanted to say thank you very much !
[Sony Cross-Device General] munjeni:
Nothing other that this error:

init: Service 'tad_static' (pid 2167) exited with status 1

Have some questions:

1. do you have right TA.img ? Hope you know allready that TA is unique per device and can't be used TA from another phone.

2. can you post init.ta-log.txt from /data/local/tmp ?

3. did you deleted old TA.img from /data/local/tmp ?

4. are you sure you have compatible kernel with F8331_39.0.A.1.213_1305-9052_R3B ?

5. I saw you have installed supersu, so can you try only poc without any external tool??
[Sony Cross-Device General] FakeMobile:
1. I backup up 3 TA from the same version before unlock the bootloader .

2. I will post , i saw the file and it had only 1 line that said something like unable to find TA in /srf or somthing like that.

3. I didn't delete but i redo the push command (i guess it override).

4. I took the kernel from the ftf (kernel.sin)

5.the supersu I install in the end of all the procces just to check the log in /data/local/tmp. (all the test was only stock framework + kernel from rom with your tool)

i installed the supersu to change selinux , but I didn't succeeded.

Is there something i can do to help you (like another logs ) ? (I will send init.ta-log.txt in a few minutes)

in all the test i did this

install stock framework with Flashtool with hard reset (full wipe + storage wipe), flash modified kernel with your tool , wipe data , and reboot.
[Sony Cross-Device General] filjusz:
So, Your amazing tool makes possible flashing .sin files in recovery? E.g appslog_partition.sin? If yes, it will be very helpfull
[Sony Cross-Device General] munjeni:
This can do it (in case 32 bit device) https://xdaforums.com/crossdevice-dev/sony/tool-unpack-format-sony-kernel-image-t3530077
[Sony Cross-Device General] munjeni:
2. I need log

3. Why you didn't deleted as per my sugestion? Tool didn't overide old TA.img !

5. you no need root to read context of the /data/local/tmp folder! So my sugestion try poc without any external thing
[Sony Cross-Device General] FakeMobile:
3. forogot to say , everytime I flashed the kernel i boot did adb push TA.img /data/local/tmp.

5. I tried your tool without anything at the first 3 test.

this is log from custom ROM with stock kernel .

like rest of the tests everything work , (WIDEVINE: Key on Active & CKB: key on Active, bravia engine , camera).

but I still get the NO SIM bug and "emergency call only".

EDIT:

after flashing the modified in setting > about in Baseband version it show unknown
[Sony Cross-Device General] x_one:
Did you place TA.img to ta_poc folder? your log says that You don't have TA.img repacked into your ramdisk.

You don't need push TA.img to /data/local/tmp if you repack boot with your TA inside.

Maybe you don't have right permissions and owner of the file? Your file inside /data/local/tmp is named TA.img (case sensitive)?
[Sony Cross-Device General] munjeni:
Oh man why? Do not do it, tool copy TA.img to the right place and right permissions for you, you no need to push anything, just patch kernel, install and boot it
[Sony Cross-Device General] mobiware:
TWRP incompatible with Xperia Z5?

Hi [MENTION=4120742]munjeni[/MENTION],

Thanks for your work. I was wondering, does your tool achieve everything that Tobias Waldvogel tool does, from what you are saying here?

Also, somewhere else you suggested to a user to run your PoC first and then Tobias' script, but from what I understand [MENTION=3989065]serajr[/MENTION] suggests to run Tobias' script first and then yours. What do you think?

Thanks in advance,

MW
[Sony Cross-Device General] munjeni:
That was old posts, newer poc avhieving recovery and almost all from tobias, so you have choice between mine and tobias but not booth
[Sony Cross-Device General] serajr:
Bro, again the same answer I stated here! Run one of the tools, not both!
[Sony Cross-Device General] wzhy:
My XP use this seems has some problem. Using stock kernel and FW version is 39.2.A.0.374_R13C.

My kernel's cmdline has ta_info=1,16,256 and rc file use 1,16 argument too.

Then my TA img has try have dummy block or not.

adb logcat show me this:

Kernel dmesg:

Full kernel dmesg please download dmesg.txt

It seems works like I receive some app update from "Software update". Service Menu - Configuration - Rooting status shows Bootloader unlock allowed: yes.

But the DRM keys seems be lost. My TA is backup using dirtycow on the last FW on MM.
[Sony Cross-Device General] munjeni:
We have discused about it in this thread but I forgot what you need to delete from /data ... please search! Something like /data/credmgr /data/drm ...etc if I am not wrong!

Poc detects ta_param from .rc files and uses it as a reference so it will work in all cases. But seems on yours it uses 0,16?? Can you post your kernel?
[Sony Cross-Device General] Dilesh Perera:
hi bro [MENTION=4120742]munjeni[/MENTION]

while using the newest POC i have discovered when checking the service menu - Service Info/software info i see last item " current modem Config - as ""Unknown "

i have reproduce this by flashing Stock Rom few times and everytime after i use POC its like that . any idea?

my phone works without any issue but im testing VOLTE so i need to change the Modem and while its in Unknown i cant change it thats my concern
[Sony Cross-Device General] x_one:
I have the same "config: unknown"

I wonder if it was the same when we mounted TA.img into loop. Unfortunately I've just deleted all earlier copies of tapoc so I can't check it.

Maybe someone have version with loop mount to test?
[Sony Cross-Device General] Dilesh Perera:
which release? i think i have more than 10 older versions to the latest POC
[Sony Cross-Device General] x_one:
Release where TA.img was mounted into loop5 instead using it directly into tad_static.
[Sony Cross-Device General] munjeni:
Have no idea, on my z1c all ok
[Sony Cross-Device General] munjeni:
Can you check existence of the mbn in /system/etc/customisation/modem/
[Sony Cross-Device General] x_one:
I have bunch of files, but I have CE1 installed and my device is Polkomtel... Hmm..
[Sony Cross-Device General] Dilesh Perera:
i have all the mbn files too

---------- Post added at 01:34 AM ---------- Previous post was at 12:52 AM ----------

i have made boot image using POC released on Feb 27 ( it didnt had option to add twrp) and tested. again "config: unknown"
[Sony Cross-Device General] x_one:
I think you should check earlier release. I'm still using release pre twrp because I don't need it and I have that problem with modem config. I think it wasn't like that earlier, but I don't know it for sure and don't know with release was good.. I'll make some tests tomorrow.
[Sony Cross-Device General] Dilesh Perera:
thats what i said . i tried earlier version , Pre TWRP . what happens is once this "config: unknown" shows up after using POC system restore with backup will not make it to show modem name again. means it needs rom install again :(
[Sony Cross-Device General] mobiware:
Need to unlock bootloader a second time?

If I use ToC script, since it locks bootloader after it runs, do I need to unlock it before I flash a new ROM?
[Sony Cross-Device General] munjeni:
Unlocked bootloader is need
[Sony Cross-Device General] mobiware:
Latest TWRP 3.1.0

Thanks for this. So if I put the latest recovery.img in the TA_POC subdirectory, the script will pick it up and use that one? If so, why isn't there a recovery.img in the original distribution of files?
[Sony Cross-Device General] munjeni:
Because it is not part of the Sony things
[Sony Cross-Device General] shoey63:
There is. It's called FOTAKernel. But it is only used to apply OTA updates. That's what we overwrite it with a TWRP recovery.img. Far more useful:cowboy:

So have you created and flashed a PoC kernel yet? If not, why are you still procrastinating?
[Sony Cross-Device General] Dilesh Perera:
hi again [MENTION=4120742]munjeni[/MENTION] i tested with tobias tool. modem unknown is not happening with it. it happens only with POC :( and i prefer ur tool :(
[Sony Cross-Device General] munjeni:
I can't help with it since for me on z1c no problems with it! Maybe try this https://xdaforums.com/showpost.php?p=71208170&postcount=751
[Sony Cross-Device General] shoey63:
z1c is amami right?

I just built a 3.1.0 recovery.img for you https://www.androidfilehost.com/?fid=745425885120716409

Its has all the Latest Commits(including ones from [MENTION=4878287]_that[/MENTION], which I always cherry-pick immediately), plus backup and restore TA and raw system images.

Also Flash image section can be use to flash TA and system.img, even system.ext4 if you rename it;)
[Sony Cross-Device General] munjeni:
Thanks but it not working :(

/dev/block/bootdevice not exist on z1c! You must change all that /dev/block/bootdevice to /dev/block/platform/msm_sdcc.1 and it will work. I have tried to dirty fix it but no go since some binary files (red) contain it and I can't hexmodify it, this is a list of files which need to be changed:

~/Desktop/ta_poc $ grep -rl bootdevice recovery
recovery/etc/recovery.fstab@0644
recovery/etc/twrp.fstab@0644
recovery/file_contexts@0644
recovery/fstab.rhine@0640
recovery/init.recovery.amami.rc@0750
[COLOR="Red"]recovery/init@0750[/COLOR]

Edit:

Ah I see, its solved with this:

on init
symlink /dev/block/platform/msm_sdcc.1 /dev/block/bootdevice

anyway didn't boot and there is no last_kmsg :( no way to debug since no adb too :(

Edit:

Working flawles if flashed but using it with poc getting boot loop

Edit:

boot loop reason... seems old stock z1c kernel didn't like newer selinux version? Have no idea why it didn't work with poc
[Sony Cross-Device General] Dilesh Perera:
I will see again and report

[MENTION=964248]shoe63[/MENTION] if possible and have time can u make TWRP 3.1 for z2 with additional options to back up and restore as attached. I have 3.0.2 with all these options. The one u made for z2 dose not have those . Thanks
[Sony Cross-Device General] nolawardana:
Can you give me link twrp 3.0.2 for z2 that support backup ta, fota kernel, etc,,,, ???? Thank u

---------- Post added at 06:53 PM ---------- Previous post was at 06:52 PM ----------

Can you give me link twrp 3.0.2 for z2 that support backup ta, fota kernel, etc,,,, ???? Thank u
[Sony Cross-Device General] wzhy:
I use XP with stock kernel and PoC. Also has the modem problem and I got a error report in /cache/modem

I seems be TA problem that system read unit 2404 from TA failed.
[MENTION=4660353]Dilesh Perera[/MENTION] look at your /cache/modem/modem_switcher_report and confirm is it read fail with unit 2404?

Here is the full log:
[Sony Cross-Device General] Dilesh Perera:
Yes correct

Report of UA Modem Switcher UA Modem Switcher status: 2 Current Modem Config : default Last log messages: Info [496] Logging OK WARN [374] Could not read modem command unit. Code: 1 ERROR [596] Could not read active customization unit. Code: 1 ERROR [545] Failed to read active customization status ERROR [78] Failed to contact TAD within 1000 ms, giving up ERROR [154] tad not launched ERROR [161] Read failed (unit 2404) ERROR [73] Could not get size of TA_FOTA_INTERNAL

We are not alone as per now this modem issue reported on Z2 / Z3c / XP
[Sony Cross-Device General] Dilesh Perera:
i have done. still modem switcher report same
[Sony Cross-Device General] Dilesh Perera:
yes as u said

edited the lines

removed Ta from data/local/tmp

reboot

and i have my Ta image back in data/local/tmp

but still the modem switcher reports gives errors as shown in previous post
[Sony Cross-Device General] Dilesh Perera:
:(

maybe [MENTION=3989065]serajr[/MENTION] or [MENTION=4675598]shoey63[/MENTION] can help us :crying:
[Sony Cross-Device General] x_one:
Is it possible to revert tad_static as stock and later change it to using TA.img after /data is mounted?
[Sony Cross-Device General] Edjee:
It may have been asked before, but can I use this with non stock roms?
[Sony Cross-Device General] whalesplaho:
Before tha TA.img was permanently there.... How come its changing?
[Sony Cross-Device General] munjeni:
New version is out! Hope all working now
[Sony Cross-Device General] Dilesh Perera:
nope ... still the same
[Sony Cross-Device General] munjeni:
It must work now. Delete TA.img first from /data/local/tmp & reboot! And please all logs if possible (init.ta.log & dmesg to http://www.pastebin.com)!
[Sony Cross-Device General] wzhy:
Can we try another way? Just copy unit 2404 from TA.img to the real ta partition?
[Sony Cross-Device General] munjeni:
We do not using real ta partition!
[Sony Cross-Device General] wzhy:
but ua modem switcher run before tad, so is it read from the real partition?
[Sony Cross-Device General] munjeni:
ua modem switcher starts after tad!
[Sony Cross-Device General] shoey63:
Backup all that? Shirley you can't be Sirius :D

I made one that backs up TA, Recovery, and Raw System Image.

Also, you can flash them in the "Select Image" section

https://www.androidfilehost.com/?fid=673368273298940068
[Sony Cross-Device General] munjeni:
We probably need to mount /data partition "on init" because tad starts "on init" so fota-ua fail because tad is not started "on init" :(
[Sony Cross-Device General] Dilesh Perera:
http://pastebin.com/GBM2wvB1

init.ta.log says init.ta.sh
[Sony Cross-Device General] shoey63:
I have the modem bug on my Z5 too. I just never noticed it because it doesn't affect WIFI or mobile data.
[Sony Cross-Device General] Hiku:
E6683 can't recognize external sdcard, have anyone else reported that? Sorry if I do a spurious job.
[Sony Cross-Device General] Dilesh Perera:
hey bro :) it is Sirus of course :)

many thanks again :) :good:
[Sony Cross-Device General] shoey63:
We will have a look at that later, after the modem bug has been fixed.
[Sony Cross-Device General] wzhy:
on init the userdata didnt mount correctly. I found these lines in init.rc

and from 6.0 on, the userdata has encrypt, so we cannot mount it simplely
[Sony Cross-Device General] serajr:
Yes, good point! A workaround is still needed.

Also, the "unknown" modem issue is present if using rootkernel tool too, this is not TA PoC exclusivity (I've double checked it)!
[Sony Cross-Device General] Hamidreza2010:
bro whats the result of this tool?

did you done it or working on it?

special thanks to you

you give relife sony forum with your tool/tools
[Sony Cross-Device General] munjeni:
I have managed all that things but making universal patcher for thing will not be easy! What I done is moved all tad things from section "on init" to section "on fs" so it looks something like:

on fs
# Part of the TA PoC
wait /dev/block/platform/msm_sdcc.1/by-name/userdata
mkdir /data 0771 system system
mount ext4 /dev/block/platform/msm_sdcc.1/by-name/userdata /data
exec /init.ta.sh
class_start trimarea
exec /sbin/wait4tad_static
exec /sbin/checkabortedflash

But this is not workaround and can't be easily translated into universal patcher script since its so hard translating because rom diferencies. Which I think now maybe better idea getting which of the binaries generates this log -> https://xdaforums.com/showpost.php?p=71492680&postcount=1054 and execute that binary after init.ta.sh executed.

Anybody give me pre poc version before last two changes?
[Sony Cross-Device General] Dilesh Perera:
Hi Using rootkernel dose not give modem unknown issue. I have tried many times. try wipe cache after flashing boot image flashing - from rootkeenel tool
[Sony Cross-Device General] munjeni:
I am working on it! Curently waiting Igor Pavlov to implement thing which I need for finishing tool -> https://sourceforge.net/p/sevenzip/discussion/45797/thread/13070b32/
[Sony Cross-Device General] munjeni:
Hey, maybe it might be only if modem_switcher_status gets removed from /cache/recovery/fota ?? Can you test? This is context of the modem_switcher_status file:

0,default

Can you give me scripts folder of the old ta_poc before all today changes? I am lost it :(
[Sony Cross-Device General] x_one:
this?
[Sony Cross-Device General] esps:
Full yesterday one (18/3/17)
[Sony Cross-Device General] Dilesh Perera:
context of modem_switcher_status is 2,default but when i use rootkernel context comes as amss_fsg_sirius_volte_base_operator_trials_tar.mbn ( /cache/modem )

edit- and i dont have anything inside /cache/recovery/fota other than file called triggerfota
[Sony Cross-Device General] munjeni:
Ok, I found excatly the same log https://xdaforums.com/showpost.php?p=71492680&postcount=1054 when I delete TA.img from data/local/tmp and kill tad_static & run /sbin/ua-modem-switcher from terminal emulator as a root user! Can you try to run /sbin/ua-modem-switcher , it will generate modem_switcher_status and probably solve your problem with modem! Let me know please!

Edit:

I have current modem config unknown when I delete modem_switcher_status :) But when I run /sbin/ua-modem-switcher it start working immediatelly!
[Sony Cross-Device General] Dilesh Perera:
i have run /sbin/ua-modem-switcher. modem_switcher_status changes to the .mbn file

but when i check with service menu it still shows unknown :eek:
[Sony Cross-Device General] munjeni:
For me it worked! Maybe some other binaries is responsible for update modem status? Maybe try run /sbin/wait4tad_static
[Sony Cross-Device General] munjeni:
I have reverted ta_poc to yesterday version!
[Sony Cross-Device General] munjeni:
Runing /sbin/ua-modem-switcher with terminal emulator fixes isu, but how you set that .mbn file? Can you explain more details? Can you try setup an normal modem config instead of using that .mbn and run /sbin/ua-modem-switcher?
[Sony Cross-Device General] x_one:
If I just run /sbin/ua-modem-switcher nothing changing.. Still unknown..

But if I delete modem_switcher_status and run /sbin/ua-modem-switcher everything is ok, also in service menu.

After reboot I still have unknown status.

Solution could be deleting modem_switcher_status file and reinitialising ua-modem-switcher after ta.img is copied? Maybe inside init.ta.sh?
[Sony Cross-Device General] munjeni:
Puting command into init.ta.sh have no sense, we need to execute it after tad service start, probably on postfs data or probably on boot! I have tried to solve thing and had no way . Only solution is using old loop method & manual TA.img to data copy, than it will work for sure without any hacks. Anyway that unknown is not isue, it just displays curent modem config
[Sony Cross-Device General] x_one:
I've tried method using loop5. Made it from scratch. I had all keys but modem was still unknown.
[Sony Cross-Device General] serajr:
Great found bro!

This is the part of the code that fails checking this out:

int tmpStatus = Integer.parseInt(values[0]);
if (tmpStatus != 0) {
throw new IOException("Modem switcher status is error: " + tmpStatus);
}

Status must always be 0. 2 (or any other number) just throws an error and "unknown" string will be outputed at the end of the process (in the UI).

This is the debug logcat with the tag "Servicemenu.FOTA MS" before and after recreating modem_switcher_status file:

[COLOR="Red"]03-19 17:23:29.020: D/Servicemenu.FOTA MS(6113): Status file found: /cache/modem/modem_switcher_status
03-19 17:23:29.021: D/Servicemenu.FOTA MS(6113): Read line: 2,default[/COLOR]
[COLOR="Blue"]03-19 17:25:48.717: D/Servicemenu.FOTA MS(6113): Status file found: /cache/modem/modem_switcher_status
03-19 17:25:48.718: D/Servicemenu.FOTA MS(6113): Read line: 0,amss_fsg_dora_tar.mbn
03-19 17:25:48.718: D/Servicemenu.FOTA MS(6113): Target filename of: amss_fsg_dora_tar.mbn is: amss_fsg_dora_tar.mbn[/COLOR]

Thank you for the research :good:

We'll check it out, but I think so (init.ta.sh)!
[Sony Cross-Device General] munjeni:
I forgot how it worked but probably you are right in case loop was not mounted before tad started, probably tad always start successfull on seccond time, first time it always fail till when fota-ua need that because path which we uses for picking up TA.img is not available "on init" when tad service starts. We have no solution to start tad in the right timing since we can't mount TA.img during "on init" because data partition is not mounted in that time, I have managed to mount /data partition but unable to setup flag encriptable-footer because mount command gives me an error, but if I mount it without encriptable-footer flag mount succed but on boot getting an boot menu to type password for encription, can't solve, the most hard thing is making things universal for all roms compatibility, imposible. We just need to figure out what is usage of the modem .mbn symlink in /system/etc/customization/modem/ , seems it is used for something important? Or maybe only for displaying current modem status in service menu?
[Sony Cross-Device General] munjeni:
It will not do a job since tad is started after init.ta.sh ! When tad is not started fota-ua , wait4tad and ua-modem-switcher fails! Curently non fixable by ta_poc script, solution is moving manualy all that things from section "on init" to the section "on fs" AFTER init.ta.sh start && after tad start. Making universal compatible script which will handle & move that strings in cm, aosp, custom rom , stock rom, ramdisk which have two ramdisks... is sooooo hard, I have no solution :(