[Galaxy Note II N7105 Android Development] :
ok, well - here it is.

I assume no responsibility if you brick your device.Back up any info.

a.You should be on the latest firmware:

Latest Samsung GALAXY Note Ⅱ firmware

Download the latest Samsung firmware for GALAXY Note Ⅱ with model code GT-N7100. Check out our free download or super fast premium options.

www.sammobile.com

b. You need the latest TWRP:

Samsung Galaxy Note 2 N7105

Disclaimer:Team Win strives to provide a quality product. However, it is your decision to install our software on your device. Team Win takes no ...

twrp.me

c. You need adb tools:

SDK Platform Tools release notes | Android Studio | Android Developers

Android SDK Platform-Tools is a component for the Android SDK.

developer.android.com

ca. You may need Samsung drivers if on Windows

d. You need parted static binary for arm - download and unzip:

https://xdaforums.com/attachment.php?attachmentid=4494671&d=1525641258

_ _ _

1. Connect usb and boot in TWRP recovery on Note 2

2. In terminal type

adb devices #Will show phone in recovery mode
adb push location/of/parted /
adb shell
chmod +x parted
umount /system
umount /data
umount /cache
umount /sdcard
./parted /dev/block/mmcblk0

Now you're in parted console

3. In console type

unit MB

print free

It will show something like for 16GB internal storage :

Model: MMC MAG4FB (sd/mmc)
Disk /dev/block/mmcblk0: 15758MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
0.02MB 4.19MB 4.18MB Free Space
1 4.19MB 8.39MB 4.19MB BOTA0
2 8.39MB 12.6MB 4.19MB BOTA1
3 12.6MB 33.6MB 21.0MB ext4 EFS
4 33.6MB 37.7MB 4.19MB m9kefs1
5 37.7MB 41.9MB 4.19MB m9kefs2
6 41.9MB 46.1MB 4.19MB m9kefs3
7 46.1MB 54.5MB 8.39MB PARAM
8 54.5MB 62.9MB 8.39MB BOOT
9 62.9MB 71.3MB 8.39MB RECOVERY
10 71.3MB 164MB 92.3MB fat16 RADIO
11 164MB 432MB 268MB ext4 TOMBSTONES
12 432MB 944MB 512MB ext4 CACHE
13 944MB 2944MB 2000MB ext2 SYSTEM
14 2944MB 3531MB 587MB ext2 HIDDEN
15 3531MB 3539MB 8.00MB OTA
16 3539MB 15758MB 12219MB ext4 USERDATA

Only modify partitions from 12 -16 :

Otherwise, you will have to flash stock .pit/rom to fix and start over

Your partition sizes will be the original values from stock if you never modified them. Below are mine after I modified them.

12 432MB 944MB 512MB ext4 CACHE
13 944MB 2944MB 2000MB ext2 SYSTEM
14 2944MB 3531MB 587MB ext2 HIDDEN
15 3531MB 3539MB 8.00MB OTA
16 3539MB 15758MB 12219MB ext4 USERDATA

You can resize how ever you want but it's important to grow the HIDDEN (to use as vendor partition for treble) and SYSTEM (for gapps/future use) partition. I took space from CACHE partition as I don't think it's necessary anymore.

4.Partitions must be contiguous and in order so can't resize without deletion- type

rm 12
rm 13
rm 14
rm 15
rm 16

5. Now the partitions must be recreated in the same order as deletion - type

mkpart primary ext4 432 944 #End of partition 11/in example above#
name 12 CACHE

mkpart primary ext4 944 2944
name 13 SYSTEM

mkpart primary ext4 2944 3531
name 14 HIDDEN

mkpart primary 3531 3539
name 15 OTA

mkpart primary ext4 3539 15758
name 16 USERDATA

6. Now quit parted console - type

quit

7. Make sure partitions are formatted correctly - type

mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p12
mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p13
mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p14
mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p16

Now check to make sure it looks right - type

./parted /dev/block/mmcblk0 p free
exit

Then reboot TWRP and flash the rom.

You might see some errors in TWRP so, you'll want to go to Wipe > Advanced Wipe > check "System" then head to "Repair or Change File System", > then tap on "Resize File System." Do the same for the other partitions.