前往 Medium 文章查看如何配置项目https://medium.com/@kuruppu.gayan/develop-a-vpn-app-in-java-using-android-studio-6f1f2d66031e?sk=57ebd1c9175d5f56bd8e328731b5ac74

客户端应用基于 OpenVPN 协议,您可以创建自己的安卓 VPN 应用,如 Turbo VPN、Thunder VPN 或 Hotspot Shield Free VPN。

该应用程序可以计算每天的数据使用量,连接时间,从通知中检查连接速度,将界面更改为夜间模式,多服务器,远程配置和视觉效果。

不支持安卓10

服务器现在离线!所以服务器正在等待连接。获取一个 OpenVPN 文件并将该文件粘贴到filedetails.json中。创建您自己的 JSON 文件并托管在服务器中。

在 GitHub 上关注https://github.com/gayanvoice

#1 从版本控制中选择签出项目

step-1-checkout-project-from-version-control

#2 输入仓库的链接,选择项目文件夹

step-2-enter-the-link-of-the-git-repository

#3 单击“是”打开项目上的存储库

step-3-click-yes-to-open-the-repository

#4 构建开始

step-4-build-started

#5 构建完成

step-5-build-finished

部署

  • 在部署您的应用之前,请从您的应用中删除 google-services.json 文件。谷歌服务.json

通过几个步骤为多个用户安装 OpenVPN 服务器。转到此存储库并克隆。为多个用户运行脚本OpenVPN 安装

远程配置

应用详情

从以下链接app details加载应用程序的详细信息。转到appdetails.json。

文件详情

从以下链接文件详细信息加载 OpenVPN 文件。转到filedetails.json。

配置 appdetails.json

{
  "ads":"true",
  "update":[{
    "version":"2.8.1600",
    "title":"This app is now Open Source",
    "description":"The App is available at github.com/gayankuruppu/android-vpn-client-ics-openvpn",
    "size":"https://git.io/JeY69"
  }],
  "blocked":[
    {"id":0, "app":"com.android.game"},
    {"id":1, "app":"com.utorrent.client"},
    {"id":2, "app":"com.torrent.client"},
    {"id":3, "app":"com.tor.client"},
    {"id":4, "app":"com.insta.client"},
    {"id":5, "app":"com.facebook.client"},
    {"id":6, "app":"com.get.client"}
  ],
  "free":[
    {"id":0, "file":0, "city":"Essen","country":"Germany","image":"germany","ip":"51.68.191.75","active":"true","signal":"a"},
    {"id":1, "file":0, "city":"Hamburg","country":"Germany","image":"germany","ip":"51.68.191.75","active":"true","signal":"b"},
    {"id":2, "file":1, "city":"Los Angeles CA","country":"United States","image":"unitedstates","ip":"205.185.119.100","active":"true","signal":"c"}
  ]
}

appdetails.json 文件有四个主要部分。

  • 值为adsa boolean value,可以选择true或false。如果值为true,应用程序将在会话开始时展示广告。否则,如果值为 ,则广告不会展示false。

  • 该数组update具有三个值。version 是String value应用程序的最新版本。当会话启动应用程序时,检查版本值是否等于应用程序的版本。如果这些值彼此不匹配,则会显示更新视图。值title、description和size是更新视图中显示的值。

  • 该数组blocked具有 JSON 对象,其值id和package name. 您可以添加 Torrent 等应用程序,以避免经常通过下载数字媒体而滥用的点对点文件共享。

  • 该数组free具有服务器名称的值。该值city显示server name并且该值image是标志的名称。该值signal是 的值strength of the signal。该值file是 中的index值。source OVPN filefiledetails.json

  • 更改 JSON 值并上传到您的服务器或将其托管在分叉存储库(https://raw.githubusercontent.com/gayanvoice/android-vpn-client-ics-openvpn/images/appdetails.json)并添加链接WelcomeActivity.java 文件中的 JSON 文件

    android-vpn-client-ics-openvpn/app/src/main/java/com/buzz/vpn/WelcomeActivity.java

    59号线 c35b88b

      StringGetAppURL = "https://gayankuruppu.github.io/oml/buzz/appdetails.json" ;

     

配置文件details.json

{
  "ovpn_file":[
    {"id":0,"file":"client
    dev tun
    proto udp
    ...
    d4ec4105a39c814bd980c9c0e0b8efb4
    -----END OpenVPN Static key V1-----
    </tls-auth>"},
    {"id":1,"file":""}]
}
  • filedetails.json 文件存储了用于设置 Internet 连接OpenVPN source file的值。String
  • 复制文本OVPN file并将其粘贴到 JSON 字符串中 ( https://raw.githubusercontent.com/gayanvoice/android-vpn-client-ics-openvpn/images/filedetails.json )
  • 在 WelcomeActivity.java 中添加链接地址

    android-vpn-client-ics-openvpn/app/src/main/java/com/buzz/vpn/WelcomeActivity.java

    60 号线 c35b88b

      StringGetConnectionURL = "https://gayankuruppu.github.io/oml/buzz/filedetails.json" ;

运行应用程序

  • 就这些。现在可以更改应用程序 UI 并部署应用程序。
  • 部署前删除 Google 服务 JSON 文件 ( https://github.com/gayankuruppu/android-vpn-client-ics-openvpn/blob/master/app/google-services.json ) Github https://github.com/ gayanvoice/android-vpn-client-ics-openvpn