Programmatically configure PPTP/ L2TP VPN in Android - java

I have read about VpnService and VpnService.Builder but could not get any method to set vpn type to PPTP or L2TP, even I didn't get any method where I can set user/ password.
Note: There are many questions in SO I read them but didn't find solution. I looked into ToyVpn application but this there are only 3 parameters we set in this application.
Please help. If there is 3party API, please give the reference.

Yes and all answers in stackoverflow should have told you that VPNService API is for creating your own VPN application with its own VPN stack (which could happen to be PPTP/LT2P/ToyVPN/OpenVPN/MyOwnVerySecure VPN protocol) and not to configure the system VPN.
An API to configure the System VPNs is simple not included in the SDK.

Related

Is there a way to add custom routing rules to an Android VPN natively or with a library?

I am trying to route my traffic with custom IP routes within a VPN. I have already had a similar issue with a windows VPN client and I was able to just write a batch file that runs when launching the client and it just runs route add commands.
The problem is it seems that this is impossible to do for Android. I am aware that there is the adb approach, but it gives me permissions errors when attempting to custom add routes. Upon further research it seemed in order to change the routing rules for the IP tables I would have to root my device, this is not an option in my case.
I have looked at the VPN service on the Android Developer page, but I didn't see any way to start adding custom routes to a VPN. I also saw no libraries readily available that provide a method for additionally routing traffic. Perhaps I am missing a piece of the puzzle.
I am still learning about Android Development and this is an issue that I would like to have some input on as I will not be able to run my application through the default VPN without adding my custom rules, and I do not have the ability to change the VPN subnets around to get rid of this issue at the moment.
I had a similar problem.
Android SDK has addRoute API to add a route policy through VPN.
But there is no remove route API in the public document.
Here is the addRoute documents:
Add a network route to the VPN interface. Both IPv4 and IPv6 routes are supported. Adding a route implicitly allows traffic from that address family (i.e., IPv4 or IPv6) to be routed over the VPN.

Need to call from jxfs client to jxfs server

I am very new to jxfs things. I have a requirement to call jxfs server which is in cloud server from the jxfs client which is in ATM environment.. How can i call?.. I need to call this one through the Jxfs RMI concept. It would be appreciated one if any example code is available. If atleast you are having code for calling from jxfs server to jxfs client, please post it.
Thanks in advance guys.
One of the interesting things about J/XFS and remote device access (based on RMI) is that it is just matter of configuration.
You need to configure a J/XFS repository in order to handle a remote device (basically set 'remoteAccess' to true).
Then accessing these devices from the programming point of view is just the same as they were local devices.
Architecture is explained here: ftp://ftp.cencenelec.eu/CWA/CEN/WS-J-XFS/cwa14923/cwa14923-01-2004-May.pdf
Details, when programming may differ depending on the J/XFS implementation you are using.
Trying to answer your question below:
Whenever you want to access a device remotely in J/XFS, RMI is used. You need to make the following setup:
On a server (should be accessible) you need to start a JxfsServer. The JxfsServer will use a Read.repository
whith all the ATM's and devices configured on them as workstations, with the right IP addresses.
On the ATM, you need to install:
J/XFS libs
J/XFS device services for the devices on the ATM
Setup the DSstarter:
Will use the SpecificDeviceManagerRMI connecting to the JxfsServer you started before.
On your server (cloud) wherever you are going to use the J/XFS client you can get the remote controls by performing
the J/XFS initialization as follows:
jxfsDM_ = JxfsDeviceManager.getReference();
jxfsDM_.initialize("com.jxfs.forum.communication.rmi.SpecificDeviceManagerRMI,<atmWorkstation>,AppTest,2006;<jxfsserverhostname>,");
Then you can get the remote device controls with getDevice(...), and start using them as if they were local devices.
Please, note that handling RMI ports can be tricky, specially in a secured environment as ATM network. Make sure all the ports you need are open.

Unable to capture request responses of metro apps - proxy configuration

I am new to using Fiddler and I have a windows 8 metro application to be tested. I want to use fiddler to see the requests and responses from that application. I have configured fiddler by running AppContainer Loopback Exemption Utility and checking the box against my app name. Also I have unchecked all use a proxy server for my LAN (but fiddler some how checks it though) ....... Anyways I was able to see the requests sent by IE and desktop apps, but unable to see the requests of metro apps ...... Please tell me how to solve this issue
How is "java", which you tagged in your question, involved here? Metro apps are not written in Java.
Fiddler works by acting as the system's proxy. If you manually change the system's proxy configuration, Fiddler will not capture anything.
You should follow the steps described here: https://groups.google.com/forum/#!topic/httpfiddler/SsZnGxdxklg to get information which can help resolve your issue.

Getting which application uses a specific port on android

I have an android native application which hosts a web server inside it.
I want to know which application makes requests before they are processed by my application.
What I have is the port of the calling application.
How can I find out which application is using this port?
I've tried looking for all processes (cat /proc/net/tcp6), but the application with the port I have is not listed (on a rooted device it is).
I also tried playing with lots of options of the netstat command, but I don't get any valuable information.
I need to find a way to find the calling application name on a regular device (not rooted).
The uid is a field in /proc/net/tcp6, which at least of the moment is readable from an unprivileged app.
Then you can use PackageManager.getNameForUid()
That said, your goal seems like an odd design.

Connect to VPN from BlackBerry

Is there any way to create a connection to a virtual private network using the BlackBerry APIs?
My understanding is that to connect to a VPN on BlackBerry you need to use bes, create a vpn profile, and so on. I am looking for a pure app-driven alternative.
Is it possible to do this by using something from the BBOS 5.0 packages or something else?
Here is the answer in case someone needs it:
There is no API which allows you to create/configure VPN profile. AFAIK if you are in the BES infrastructure it is possible profiles to be created on the server side from administrator and then pushed to clients via Blackberry Push Services. I haven't tried it though!
However you can also configure a VPN profile on your blackberry device and set it to a wi-fi connection. Then the Wi-Fi connection automatically goes into VPN as well as all the data you transfer in your app(make sure not to forget to add ;interface=wifi when you call Connector#open())

Categories

Resources