Tun2ray state callback
Calling Libcore.newTun2ray(config) will cause the tun to get killed after a delay and not getting initialized as expected. A Thread.sleep(2000) after calling newTun2ray will make it initialized and everything getting work very well. I have created a new project and implemented everything from scratch, so i'm pretty sure the newTun2ray will get killed without a sleep after it (you can try it yourself) I have also read the sagernet android app's source code and there are loops (sleeps) after this method which make it work (not getting killed). I think should be a callback from the newTun2ray to be able to wait from kotlin side for tun to get initialized
SN does not have this behavior.
yes, you're right, i will investigate more why my implementation dies you can close the issue