Closed deletexl closed 1 year ago
Please provide a full log.
Also please note that this is an application not a library and only reports for my actual app are valid here. I am frustrated and sick of supporting people stealing my source code and creating closed source apps from it and then having the audacity to then ask for help doing it.
@schwabe Hello, I am developing my application with the help of C++ and JNI using a different IDE, not Android Studio. This is not a closed source application, I'm just writing an article on how to do this kind of thing using JNI. So I'm not sure how I can view the detailed logs. How can I do this? This is my code that creates VPN connection
` public native void vpnStatusChanged(String status);
public VPNWrapper(Activity ac, Context ctx) {
this.tmpActivity = ac;
this.tmpContext = ctx;
vpnIntent = VpnService.prepare(tmpContext);
LocalBroadcastManager.getInstance(ctx).registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String stage = intent.getStringExtra("state");
vpnStatusChanged(stage);
}
}, new IntentFilter("connectionState"));
}
public void startVPN(String ovpn, Context context) {
try {
if(this.netCheck(context)) {
this.checkPermissions();
ConfigParser cf = new ConfigParser();
cf.parseConfig(new StringReader(ovpn));
this.vpnProfile = cf.convertProfile();
vpnIntent = VpnService.prepare(context);
if(vpnIntent != null) {
this.tmpActivity.startActivityForResult(vpnIntent, 1);
}
if (vpnProfile.checkProfile(context) != de.blinkt.openvpn.R.string.no_error_found) {
throw new RemoteException(this.tmpActivity.getString(vpnProfile.checkProfile(context)));
}
ProfileManager.setTemporaryProfile(context, vpnProfile);
VPNLaunchHelper.startOpenVpn(vpnProfile, context);
} else {
Toast.makeText(context, "No internet connection ", Toast.LENGTH_LONG);
}
} catch (IOException e) {
e.printStackTrace();
} catch (ConfigParser.ConfigParseError configParseError) {
configParseError.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
}
public void stopVPN() {
try {
OpenVPNThread.stop();
} catch (Exception e) {
e.printStackTrace();
}
}
`
@deletexl I am skeptical. You also only provide details on how you trying to do on an absolute minimum, which typically people do that want to hide something. So you are writing an article but report bugs to my tracker without opening with that? And what article that tries to demonstrate that uses OpenVPN instead a simple toy VPN. This raises more questions than it answers.
I don't understand what this means, but thank you anyway. I would solve the problem myself if you at least leave a comment for the codes. I'll post the solution here.
@deletexl that means that I have been treated very badly by people in the past and you could not convince me that you are any better, sorry.
@schwabe Ok, thank you, I'll update this if I get a result.
To make issues more manageable, I would appreciate it if you fill out the following details as applicable:
General information
Description of the issue
hello i want to establish a vpn connection there is an ovpn file i can successfully connect with openvpn connect on desktop and mobile. But when I run it with the help of the library, sometimes the connection is provided without any problems, and sometimes I see a result like the following. Any ideas?
Log (if applicable)
Configuration file