Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
344 commits
Select commit Hold shift + click to select a range
fe2cf09
Update socket TrafficRouter.kt
Guevara999 Aug 8, 2026
1a6626c
Update new CustomVpnService.kt
Guevara999 Aug 8, 2026
414d986
Update network TrafficRouter.kt
Guevara999 Aug 8, 2026
24c63f3
Update unfinished TrafficRouter.kt
Guevara999 Aug 8, 2026
325baad
Update correct CustomVpnService.kt
Guevara999 Aug 8, 2026
0ec3c33
Update for all TrafficRouter.kt
Guevara999 Aug 8, 2026
a89a6f4
Update CustomVpnService.kt
Guevara999 Aug 9, 2026
f6f92c1
Update TrafficRouter.kt
Guevara999 Aug 9, 2026
68ee0e2
Update LogManager.kt
Guevara999 Aug 9, 2026
039c98f
Update CustomVpnService.kt
Guevara999 Aug 9, 2026
ccc1a97
Update TrafficRouter.kt
Guevara999 Aug 9, 2026
2a51063
Update LogManager.kt
Guevara999 Aug 9, 2026
dd4c43d
Update HttpCustomActivity.kt
Guevara999 Aug 9, 2026
946199b
Update HttpCustomActivity.kt
Guevara999 Aug 9, 2026
c11456f
Update TrafficRouter.kt
Guevara999 Aug 10, 2026
53851dd
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
79d97c4
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
3cc6662
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
5b9105c
Update TrafficRouter.kt
Guevara999 Aug 10, 2026
b40e020
Update LogManager.kt
Guevara999 Aug 10, 2026
bf41b6e
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
1173cb2
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
8cf4840
Update activity_http_custom.xml
Guevara999 Aug 10, 2026
786dc98
Create fragment_config.xml
Guevara999 Aug 10, 2026
762bad0
Create fragment_logs.xml
Guevara999 Aug 10, 2026
ddc4004
Create ConfigFragment.kt
Guevara999 Aug 10, 2026
1c7fcfa
Create LogsFragment.kt
Guevara999 Aug 10, 2026
122ef68
Create ViewPagerAdapter.kt
Guevara999 Aug 10, 2026
49d92e6
Update HttpCustomActivity.kt
Guevara999 Aug 10, 2026
25653c9
Update build.gradle
Guevara999 Aug 10, 2026
850bfe1
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
05fff45
Update LogsFragment.kt
Guevara999 Aug 10, 2026
574fb34
Update ViewPagerAdapter.kt
Guevara999 Aug 10, 2026
0353c35
Update HttpCustomActivity.kt
Guevara999 Aug 10, 2026
90870b6
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
c114faa
Update LogsFragment.kt
Guevara999 Aug 10, 2026
f7e2a55
Update ViewPagerAdapter.kt
Guevara999 Aug 10, 2026
b8bba6d
Delete app/src/main/res/layout/app/src/main/java/com/example/sshproxy…
Guevara999 Aug 10, 2026
a8600d0
Create ConfigFragment.kt
Guevara999 Aug 10, 2026
b961614
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
6932fb8
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
117bf8f
Update README.md
Guevara999 Aug 10, 2026
59d9e5c
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
d2f5e61
Update fragment_config.xml
Guevara999 Aug 10, 2026
52b6680
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
a49900e
Update build.gradle
Guevara999 Aug 10, 2026
f6806bc
Create ConfigEntity.kt
Guevara999 Aug 10, 2026
7584c1d
Create ConfigDao.kt
Guevara999 Aug 10, 2026
e096c3b
Create ConfigDatabase.kt
Guevara999 Aug 10, 2026
500f538
Create ConfigRepository.kt
Guevara999 Aug 10, 2026
5faf29c
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
a1b9d57
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
0c6b17e
Delete app/app/src/main/java/com/example/sshproxy/data/ConfigEntity.kt
Guevara999 Aug 10, 2026
b41dd1c
Create ConfigEntity.kt
Guevara999 Aug 10, 2026
566bbee
Update PayloadProcessor.java
Guevara999 Aug 10, 2026
2243546
Update fragment_config.xml
Guevara999 Aug 10, 2026
cd2b11c
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
d3895bd
Update ConfigRepository.kt
Guevara999 Aug 10, 2026
57f6415
Update ConfigEntity.kt
Guevara999 Aug 10, 2026
e05df06
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
db4eaeb
Update fragment_config.xml
Guevara999 Aug 10, 2026
c64d8ea
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
ebe9ceb
Update TrafficRouter.kt
Guevara999 Aug 10, 2026
41233f2
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
7068a17
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
2b1340b
Update ConfigEntity.kt
Guevara999 Aug 10, 2026
6605fbe
Update ConfigDao.kt
Guevara999 Aug 10, 2026
156d7ed
Update ConfigDatabase.kt
Guevara999 Aug 10, 2026
aea6747
Update ConfigRepository.kt
Guevara999 Aug 10, 2026
8b5c4e9
Update fragment_config.xml
Guevara999 Aug 10, 2026
a8badd4
Update ConfigEntity.kt
Guevara999 Aug 10, 2026
80b8266
Update ConfigDao.kt
Guevara999 Aug 10, 2026
78b3550
Update ConfigDatabase.kt
Guevara999 Aug 10, 2026
28d3ba7
Update ConfigRepository.kt
Guevara999 Aug 10, 2026
a551d67
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
e2bd41e
Update fragment_config.xml
Guevara999 Aug 10, 2026
f49aeab
Update ConfigEntity.kt
Guevara999 Aug 10, 2026
4145db4
Update ConfigDatabase.kt
Guevara999 Aug 10, 2026
97ee856
Update ConfigDao.kt
Guevara999 Aug 10, 2026
992c040
Update ConfigRepository.kt
Guevara999 Aug 10, 2026
1448dc7
Update fragment_config.xml
Guevara999 Aug 10, 2026
41ad667
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
cf34c24
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
977ba32
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
a1212b8
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
60fcf67
Update TrafficRouter.kt
Guevara999 Aug 10, 2026
b810374
Update HttpCustomActivity.kt
Guevara999 Aug 10, 2026
4014285
Update CustomVpnService.kt
Guevara999 Aug 10, 2026
24bb680
Update ConfigFragment.kt
Guevara999 Aug 10, 2026
7182621
Update CustomVpnService.kt
Guevara999 Aug 11, 2026
81a9fd0
Update ConfigFragment.kt
Guevara999 Aug 11, 2026
72a3edd
Update ConfigEntity.kt
Guevara999 Aug 11, 2026
16dadef
Update ConfigRepository.kt
Guevara999 Aug 11, 2026
67f7e7e
Update ConfigFragment.kt
Guevara999 Aug 11, 2026
f881ba3
Update ConfigFragment.kt
Guevara999 Aug 11, 2026
1b6b096
Update fragment_config.xml
Guevara999 Aug 11, 2026
9978ec8
Update CustomVpnService.kt
Guevara999 Aug 11, 2026
eb98aeb
Update ConfigFragment.kt
Guevara999 Aug 11, 2026
0e84cf7
Update CustomVpnService.kt
Guevara999 Aug 11, 2026
46f6cc3
Update TrafficRouter.kt
Guevara999 Aug 11, 2026
f18659e
Update ConfigFragment.kt
Guevara999 Aug 11, 2026
6557ae4
Update ConfigFragment.kt
Guevara999 Aug 11, 2026
02dc046
Update fragment_config.xml
Guevara999 Aug 11, 2026
ce2817b
Update CustomVpnService.kt
Guevara999 Aug 11, 2026
c4698df
Update TrafficRouter.kt
Guevara999 Aug 11, 2026
9540044
Create ProxyAuth.kt
Guevara999 Aug 12, 2026
0cbcffa
Update ProxyAuth.kt
Guevara999 Aug 12, 2026
d81a484
Create ProxyException.kt
Guevara999 Aug 12, 2026
89f5802
Delete app/src/main/java/com/example/sshproxy/proxy/proxy directory
Guevara999 Aug 12, 2026
139f25e
Create ProxyException.kt
Guevara999 Aug 12, 2026
d96e364
Create ProxyConnector.kt
Guevara999 Aug 12, 2026
6b456c9
Update CustomVpnService.kt
Guevara999 Aug 12, 2026
fda19e3
Update TrafficRouter.kt
Guevara999 Aug 12, 2026
e42527a
Create ConfigManager.kt
Guevara999 Aug 12, 2026
6e81f93
Update ConfigFragment.kt
Guevara999 Aug 12, 2026
114bd19
Update ConfigFragment.kt
Guevara999 Aug 12, 2026
5904e82
Update ConfigFragment.kt
Guevara999 Aug 12, 2026
3033483
Update CustomVpnService.kt
Guevara999 Aug 12, 2026
76862aa
Update ProxyConnector.kt
Guevara999 Aug 12, 2026
b108fe5
Update ConfigFragment.kt
Guevara999 Aug 12, 2026
96c0344
Update ProxyConnector.kt
Guevara999 Aug 12, 2026
4389c85
Update CustomVpnService.kt
Guevara999 Aug 12, 2026
66012a5
Update ProxyConnector.kt
Guevara999 Aug 12, 2026
e76b8e8
Update ConfigFragment.kt
Guevara999 Aug 12, 2026
1fc1988
Update LogsFragment.kt
Guevara999 Aug 12, 2026
4ef3d8c
Update fragment_log.xml
Guevara999 Aug 12, 2026
7d4a1d5
Update ConfigManager.kt
Guevara999 Aug 12, 2026
e9615d3
Update CustomVpnService.kt
Guevara999 Aug 12, 2026
a12c9fc
Update ProxyConnector.kt
Guevara999 Aug 12, 2026
551e68f
Update fragment_config.xml
Guevara999 Aug 12, 2026
4b5de45
Update ConfigFragment.kt
Guevara999 Aug 12, 2026
1cf95cf
Update LogsFragment.kt
Guevara999 Aug 12, 2026
1cbaa15
Update LogManager.kt
Guevara999 Aug 12, 2026
e087046
Update ConfigManager.kt
Guevara999 Aug 12, 2026
b7e5b26
Update ConfigFragment.kt
Guevara999 Aug 12, 2026
7fa1657
Update ConfigFragment.kt
Guevara999 Aug 12, 2026
43b03b7
Update CustomVpnService.kt
Guevara999 Aug 12, 2026
abc8f51
Update ProxyConnector.kt
Guevara999 Aug 12, 2026
7b2e4e2
Update ConfigManager.kt
Guevara999 Aug 12, 2026
dfddaf9
Update TrafficRouter.kt
Guevara999 Aug 12, 2026
28a76bc
Update LogsFragment.kt
Guevara999 Aug 12, 2026
2f9c5ac
Update fragment_log.xml
Guevara999 Aug 12, 2026
6a20096
Update fragment_config.xml
Guevara999 Aug 12, 2026
c269b7f
Update PayloadProcessor.java
Guevara999 Aug 12, 2026
56a61b9
Update ProxyConnector.kt
Guevara999 Aug 12, 2026
21396e2
Update CustomVpnService.kt
Guevara999 Aug 12, 2026
581e05a
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
10108f9
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
6affecc
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
24c5d23
Create ConnectionStrategy.kt
Guevara999 Aug 13, 2026
fc94fd3
Update CustomVpnService.kt
Guevara999 Aug 13, 2026
d1a7292
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
897896a
Update ConnectionStrategy.kt
Guevara999 Aug 13, 2026
0cbf976
Update CustomVpnService.kt
Guevara999 Aug 13, 2026
e9b2680
Update ConfigFragment.kt
Guevara999 Aug 13, 2026
05bd7a6
Update ConfigManager.kt
Guevara999 Aug 13, 2026
36c0a71
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
72b91b2
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
8da769c
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
63c475a
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
e581d83
Update ConnectionStrategy.kt
Guevara999 Aug 13, 2026
49a1aaf
Update CustomVpnService.kt
Guevara999 Aug 13, 2026
e8668a6
Update PayloadProcessor.java
Guevara999 Aug 13, 2026
d898ca5
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
0b35867
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
d9400d5
Update ConfigFragment.kt
Guevara999 Aug 13, 2026
b750a3e
Update CustomVpnService.kt
Guevara999 Aug 13, 2026
876f76a
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
f303f85
Update ConfigManager.kt
Guevara999 Aug 13, 2026
f362407
Update fragment_config.xml
Guevara999 Aug 13, 2026
8506d76
Update ConfigFragment.kt
Guevara999 Aug 13, 2026
7488874
Update CustomVpnService.kt
Guevara999 Aug 13, 2026
274936b
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
a319e17
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
6a98d8b
Update ProxyConnector.kt
Guevara999 Aug 13, 2026
9a7267c
Update ProxyConnector.kt
Guevara999 Aug 14, 2026
f71c8b1
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
6d1e407
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
33cf084
Update ProxyConnector.kt
Guevara999 Aug 14, 2026
4a139c4
Update TrafficRouter.kt
Guevara999 Aug 14, 2026
fa8acff
Update fragment_config.xml
Guevara999 Aug 14, 2026
fe37f46
Update ConfigFragment.kt
Guevara999 Aug 14, 2026
d8d69c3
Create LocalSocks5Proxy.kt
Guevara999 Aug 14, 2026
33597c5
Update build.gradle
Guevara999 Aug 14, 2026
dc73685
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
0cfcb9d
Delete TrafficRouter.kt
Guevara999 Aug 14, 2026
41f3f04
Create .gitkeep
Guevara999 Aug 14, 2026
f0671e4
Create app/src/main/jniLibs/armeabi-v7a/.gitkeep
Guevara999 Aug 14, 2026
f2c4bb8
Create app/src/main/jniLibs/x86/.gitkeep
Guevara999 Aug 14, 2026
ed1fd20
Create app/src/main/jniLibs/x86_64/.gitkeep
Guevara999 Aug 14, 2026
c38a286
Create arm64-v8a/.gitkeep
Guevara999 Aug 14, 2026
22b7b4e
Create .gitkeep
Guevara999 Aug 14, 2026
2a29f7c
Create .gitkeep
Guevara999 Aug 14, 2026
01ac5f0
Create .gitkeep
Guevara999 Aug 14, 2026
c3989bc
Add files via upload
Guevara999 Aug 14, 2026
256af36
Delete app/src/app/src/main/jniLibs directory
Guevara999 Aug 14, 2026
1446a54
Add files via upload
Guevara999 Aug 14, 2026
4757b4f
Add files via upload
Guevara999 Aug 14, 2026
68995c2
Add files via upload
Guevara999 Aug 14, 2026
8e283f5
Delete hev-socks5-tunnel-android-arm64-v8a
Guevara999 Aug 14, 2026
597ca41
Add files via upload
Guevara999 Aug 14, 2026
3afd5be
Add files via upload
Guevara999 Aug 14, 2026
5f7f3b0
Add files via upload
Guevara999 Aug 14, 2026
dd120c1
Add files via upload
Guevara999 Aug 14, 2026
6d57730
Delete hev-socks5-tunnel-android-armeabi-v7a
Guevara999 Aug 14, 2026
e058391
Delete hev-socks5-tunnel-android-x86
Guevara999 Aug 14, 2026
86c2154
Delete hev-socks5-tunnel-android-x86_64
Guevara999 Aug 14, 2026
8bba932
Create app/src/main/java/com/example/sshproxy/tun2socks/HevSocks5Tunn…
Guevara999 Aug 14, 2026
f778ba3
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
304c5e1
Update build.gradle
Guevara999 Aug 14, 2026
c8b5fa1
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
23bb11b
Update HevSocks5Tunnel.kt
Guevara999 Aug 14, 2026
7c93def
Update HevSocks5Tunnel.kt
Guevara999 Aug 14, 2026
16009f4
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
99b52ac
Delete app/src/main/java/com/example/sshproxy/tun2socks/HevSocks5Tunn…
Guevara999 Aug 14, 2026
664046b
Create HevSocks5Tunnel.kt
Guevara999 Aug 14, 2026
86a2031
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
c4e5499
Update HevSocks5Tunnel.kt
Guevara999 Aug 14, 2026
da49eab
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
a4c1c42
Update HevSocks5Tunnel.kt
Guevara999 Aug 14, 2026
f8e596f
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
b89214a
Delete libhev-socks5-tunnel.so
Guevara999 Aug 14, 2026
146b294
Delete libhev-socks5-tunnel.so
Guevara999 Aug 14, 2026
ea6c475
Delete libhev-socks5-tunnel.so
Guevara999 Aug 14, 2026
9dffe11
Delete libhev-socks5-tunnel.so
Guevara999 Aug 14, 2026
c4722ee
Add files via upload
Guevara999 Aug 14, 2026
716abf4
Add files via upload
Guevara999 Aug 14, 2026
4ed79b6
Add files via upload
Guevara999 Aug 14, 2026
8ef2db8
Add files via upload
Guevara999 Aug 14, 2026
0dc0752
Update ProxyConnector.kt
Guevara999 Aug 14, 2026
7634a09
Create TProxyService.java
Guevara999 Aug 14, 2026
d6e31f5
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
1994a31
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
476633f
Update CustomVpnService.kt
Guevara999 Aug 14, 2026
e5a0ba0
Delete TProxyService.java
Guevara999 Aug 15, 2026
a0106ce
Create app/src/main/java/hev/sockstun/TProxyService.java
Guevara999 Aug 15, 2026
151071c
Update CustomVpnService.kt
Guevara999 Aug 15, 2026
4155c1b
Update TProxyService.java
Guevara999 Aug 15, 2026
fc2648f
Update fragment_log.xml
Guevara999 Aug 15, 2026
048b957
Update LogsFragment.kt
Guevara999 Aug 15, 2026
9355264
Update TProxyService.java
Guevara999 Aug 15, 2026
486a096
Update CustomVpnService.kt
Guevara999 Aug 15, 2026
2e560a2
Update TProxyService.java
Guevara999 Aug 15, 2026
ee9e6a0
Update TProxyService.java
Guevara999 Aug 16, 2026
5d6cf2a
Update TProxyService.java
Guevara999 Aug 16, 2026
45dab70
Update CustomVpnService.kt
Guevara999 Aug 16, 2026
f5df094
Update CustomVpnService.kt
Guevara999 Aug 16, 2026
51f85e6
Update TProxyService.java
Guevara999 Aug 16, 2026
6197d63
Update CustomVpnService.kt
Guevara999 Aug 17, 2026
7bcdaae
Update CustomVpnService.kt
Guevara999 Aug 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Debug APK

on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: gradle

- name: Make gradlew executable
run: chmod +x gradlew

- name: Build debug APK
run: ./gradlew assembleDebug --no-daemon

- name: Upload debug APK
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/*.apk
retention-days: 14
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Debug APK

on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: gradle

- name: Make gradlew executable
run: chmod +x gradlew

- name: Clean build
run: ./gradlew clean

- name: Build debug APK
run: ./gradlew assembleDebug --no-daemon --no-build-cache

- name: Upload debug APK
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/*.apk
retention-days: 14
112 changes: 0 additions & 112 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,113 +1 @@
# Android SSH Proxy

Android application (Android 10+) for system-wide HTTP traffic proxying through an SSH local port-forwarding tunnel using `VpnService.setHttpProxy`.

## ✨ Features

* **🚀 System-wide HTTP/HTTPS Proxy:** Tunnels all HTTP/HTTPS traffic through an SSH server.
* **🔑 Secure Key Management:** Generates and stores SSH keys securely using the Android Keystore.
* **🛡️ Host Key Verification:** Protects against MITM attacks by verifying server host keys.
* **🔄 Automatic Reconnection:** Automatically reconnects to the server with an exponential backoff strategy.
* **🧪 Connection Quality Monitoring:** Monitors connection latency and quality in real-time.
* **🌐 "Test All Servers" Feature:** Tests the latency of all configured servers.
* **✅ "Test Connection" without VPN:** Allows testing the internet connection without an active VPN.
* **📱 Multi-language Support:** Available in English and Russian.
* **🎨 Themes:** Supports system, light, and dark themes.

## 📱 How to Use

1. **📲 Install the application** on an Android 10+ device.
2. **🔑 On the first launch:**
* The application will automatically generate a new SSH key pair.
* Copy the public key from the setup wizard or the "Keys" section.
3. **📋 Provide the public key** to your server administrator to add it to `~/.ssh/authorized_keys`.
4. **🌐 Add your server:**
* Go to the "Servers" section and click the "+" button.
* Enter your server's details (name, host, port, and username).
5. **🔌 Connect:**
* Select your server from the list and tap the "Connect" button.
* Grant VPN permission to the application.
* Wait for the status to change to "Connected".
6. **✅ Done!** All your HTTP/HTTPS traffic is now routed through your SSH server.

## 🔧 Server Setup (for Administrators)

To set up your own proxy server, you can use the provided setup script in the "Instructions" section of the app. The script will automatically:

* Create a restricted user for SSH tunneling.
* Install and configure Tinyproxy as the HTTP proxy.
* Set up the SSH key for authentication.
* Restrict the user's access to only local port-forwarding.

**Server Structure:**

```bash
# Restricted user
/home/username/.ssh/authorized_keys # Your public key

# HTTP proxy (Tinyproxy) listening on 127.0.0.1:8118
# SSH forwarding: phone:8080 -> server:8118
```

**Security Considerations:**

* The user has minimal privileges (port-forwarding only).
* The proxy is only accessible locally (127.0.0.1).
* SSH keys are encrypted using the Android Keystore (AES-256-GCM).
* Host keys are validated to prevent MITM attacks.
* IPv6 is supported to prevent VPN bypass.

## 🔐 Security Features

### Private Key Encryption

* **Android Keystore:** All private keys are encrypted and stored in the Android Keystore.
* **AES-256-GCM:** Modern symmetric encryption is used.
* **TEE/Secure Element:** Encryption keys are protected at the hardware level.
* **Zero-knowledge:** Private keys cannot be extracted, even with root access.

### Host Key Validation (Known Hosts)

* **Automatic Saving:** Host keys are automatically saved on the first connection.
* **SHA-256 Fingerprints:** Servers are identified by their SHA-256 fingerprints.
* **MITM Protection:** The connection is blocked if the host key changes.
* **User Confirmation:** A dialog is shown to the user to accept host key changes.

## ⚠️ Limitations

* **HTTP Proxy Only:** The application does not modify HTTPS/TLS traffic directly and relies on system support for proxying.
* **Android 10+ Required:** The `setHttpProxy` API is only available on Android 10 and above.
* **No Per-app Exclusions:** The VPN is configured without routes, and the HTTP proxy is applied globally.
* **Server Script:** The server setup script requires root/sudo privileges and should be reviewed before execution.

## 🛠️ Building from Source

```bash
./gradlew assembleDebug
# or
./gradlew assembleRelease
```

## 🐛 Debugging

```bash
# Main components
adb logcat -s SshProxyService AppLog ConnectionHealthMonitor

# Security
adb logcat -s SecureHostKeyVerifier KnownHostsManager KeystoreManager

# Ping and IP monitoring
adb logcat -s PingMonitor IpLocationService

# All application components
adb logcat | grep -E "(SshProxy|SSH|VPN|Ping|android-ssh-proxy)"
```

## 📄 Disclaimer

This software is provided "as is", without warranty of any kind. Use at your own risk. The use of this application may violate the policies of your network or service provider. This application implements cryptographic functions; ensure compliance with local laws.

## 📜 License

Apache-2.0
45 changes: 28 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ android {
defaultConfig {
applicationId "com.example.sshproxy"
minSdk 24
targetSdk 34
versionCode 5
versionName "1.4"
targetSdk 34
versionCode 6
versionName "1.5"
}

signingConfigs {
Expand Down Expand Up @@ -51,33 +51,44 @@ android {
}

dependencies {
// Core Android
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.fragment:fragment-ktx:1.6.2'

// Material Design & UI
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.viewpager2:viewpager2:1.1.0'

// Lifecycle & Navigation
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.7.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
implementation "androidx.fragment:fragment-ktx:1.6.2" // Add this line for by viewModels()

// SSH libraries
implementation 'com.jcraft:jsch:0.1.55'
// Local Broadcast Manager
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'

// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'

// SSH Library (modern JSch)
implementation 'com.github.mwiede:jsch:0.2.16'

// Alternative SSH library (optional – can be removed)
implementation 'com.hierynomus:sshj:0.38.0'
// Bouncycastle for cryptography

// Cryptography
implementation 'org.bouncycastle:bcprov-jdk18on:1.75'
implementation 'org.bouncycastle:bcpkix-jdk18on:1.75'
// Gson for JSON

// JSON
implementation 'com.google.code.gson:gson:2.10.1'

// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'

// Room database

// Room Database
def room_version = "2.6.1"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
}
}
54 changes: 13 additions & 41 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,41 @@

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.SshProxy"
tools:targetApi="28">
android:theme="@style/Theme.MaterialComponents.Light.NoActionBar"
android:usesCleartextTraffic="true"
tools:targetApi="31">

<activity
android:name=".MainActivity"
android:name=".HttpCustomActivity"
android:exported="true"
android:launchMode="singleTask">
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- Transparent activity for VPN permission from widget -->
<activity
android:name=".VpnPermissionActivity"
android:exported="false"
android:theme="@style/Theme.SshProxy.Transparent"
android:excludeFromRecents="true"
android:taskAffinity=""
android:launchMode="singleInstance">
</activity>

<!-- ❌ REMOVE THIS IF IT EXISTS (no android:name) -->
<!-- <activity android:exported="true"></activity> -->

<service
android:name=".SshProxyService"
android:enabled="true"
android:exported="false"
android:foregroundServiceType="dataSync"
android:name=".CustomVpnService"
android:permission="android.permission.BIND_VPN_SERVICE"
tools:targetApi="p">
android:exported="false"
android:foregroundServiceType="dataSync">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
</service>

<receiver android:name="com.example.sshproxy.widget.VPNStatusWidgetProvider" android:exported="true" tools:ignore="ExportedReceiver">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="com.example.sshproxy.widget.ACTION_TOGGLE_VPN" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_vpn_status" />
</receiver>
</application>

</application>
</manifest>
31 changes: 0 additions & 31 deletions app/src/main/java/com/example/sshproxy/AppLog.kt

This file was deleted.

Loading