Unless you root your device, it is impossible to do any operations on the root directory on a non-rooted device because a third party app will run as a normal user and won't have the root permissions.
However, according to https://developer.android.com/reference/android/Manifest.permission, android.permission.FACTORY_TEST
can give you the root permission.
FACTORY_TEST added in API level 1
public static final String FACTORY_TEST
Run as a manufacturer test application, running as the
root user. Only available when the device is running in manufacturer
test mode.
Not for use by third-party applications.
Constant Value: "android.permission.FACTORY_TEST"
But note this can only be used by manufacturers by modifying the firmware, and this is not for any third part libraries or applications.