I'm seeing this error :
Caused by: android.view.InflateException: Binary XML file line #23: Binary XML file line #21: Error inflating class fragment Caused by: android.view.InflateException: Binary XML file line #21: Error inflating class fragment Caused by: java.io.IOException: Cannot run program "/system/xbin/su": error=13, Permission denied
for code:
override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { _binding = FragmentFirstBinding.inflate(inflater, container, false) Runtime.getRuntime().exec("/system/xbin/su") Runtime.getRuntime().exec("/system/bin/ifconfig eth0 up") return binding.root }
despite providing:
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/> <uses-permission android:name="android.permission.FACTORY_TEST" AND running: adb shell setenforce 0
What else can I try to get "su" working from within the app? I need that to disable/enable Ethernet interface. On the rooted device, I'm able to run su from the shell without any problem.