Try https://github.com/libimobiledevice/ifuse. You can check if the device is allowed access to the root folder. If you can access the root folder, then it is definitely hacked.
It is true that jailbreak does not necessarily mean that you can access the entire file system, but all modern jailbreak solutions install the AFC2 service, which provides full access to the file system.
source share