For RootlessJB and root-based jailbreaks (unc0ver and Electra)
Only works on iPhones and iPod Touches for now. DOES NOT WORK ON IPHONE X.
Download the github repo on your phone, and unzip BetterRes-master.zip. Find the BetterRes folder and copy it to "/var/mobile/".
SSH into your phone as root, cd to the directory you copied BetterRes to, and run "chmod 0777 install.sh". After that, type "./install.sh" and wait for the script to finish installing.
Go to /private/var/mobile/Library/Preferences/ and open com.apple.iokit.IOMobileGraphicsFamily.plist.setrestarget.bak with a text editor. Change the canvas_height and canvas_width to the values you want (make sure they apply to your phone's aspect ratio). Save the file and close it.
Reboot the device and rejailbreak for your custom resolution to take effect!
I am not responsible for any damages you may inflict on your device by installing and/or misusing this tool on your device.
/u/mahmoudnasha for SetRes, the basis for BetterRes.