Lost APFS partition after resizing partition in windows

Your partition table seems screwed:

Your first partition on disk1 is a Windows Recovery partition, the second is an EFI partition. Then either Microsoft Reserved (E3C9E316-0B5C-4DB8-817D-F92DF00215AE), Basic data (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7) or Windows Recovery (DE94BBA4-06D1-4D40-A16A-BFD50179D6AC) partitions.

But the hexdump of block 335874048 (the first block of the 6th partition) looks promising:

...
0000020 4e 58 53 42 00 10 00 00 29 ea 22 01 00 00 00 00
...
  • 4e 58 53 42: magic string of an APFS container
  • 00 10 00 00: APFS block size: 4096
  • 29 ea 22 01 00 00 00 00 APFS container size in APFS blocks: 19065385 (=152523080 512-blocks)

    After re-arranging the Bytes 29 ea 22 01 00 00 00 00 > 00 00 00 00 29 ea 22 01 > 00 00 00 00 01 22 ea 29, you can get the decimal value here:

    enter image description here

The sixth partition obviously has the wrong type!

The partition type has to be modified with gpt then:

  • Disable SIP in Recovery Mode (the recovery system version has to be 10.11 or newer)
  • Boot to your external drive or Internet Recovery Mode.
  • Open Terminal and get some details:

    diskutil list
    sudo gpt -r show /dev/disk1
    
  • remove the 6th partition:

    sudo gpt remove -i 6 /dev/disk1
    
  • restore the same partition with the proper type:

    sudo gpt add -i 6 -b 335874048 -s 152523080 -t 7C3457EF-0000-11AA-AA11-00306543ECAC /dev/disk1
    
  • check the APFS container

    diskutil verifyVolume disk1s6
    
  • Enable SIP in Recovery Mode

The partition layout is still uncommon since macOS usually requires an EFI partition as first partition.

The non-default layout may prevent firmware updates in the future!