Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 0 additions & 16 deletions controller/app/src/main/java/org/iiab/controller/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import android.net.VpnService;
import android.os.Build;
import android.os.Handler;
import android.os.PowerManager;
Expand Down Expand Up @@ -99,7 +98,6 @@ public void setUsageFragment(UsageFragment fragment) {
private String currentTargetUrl = null;
private long pulseStartTime = 0;

private ActivityResultLauncher<Intent> vpnPermissionLauncher;
private ActivityResultLauncher<String[]> requestPermissionsLauncher;
private ActivityResultLauncher<Intent> batteryOptLauncher;

Expand Down Expand Up @@ -535,16 +533,6 @@ public boolean onTouch(View v, MotionEvent event) {
viewPager.setCurrentItem(0, false);

// 1. Initialize Result Launchers
vpnPermissionLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
result -> {
if (result.getResultCode() == RESULT_OK && prefs.getEnable()) {
connectVpn();
}
BatteryUtils.checkAndPromptOptimizations(MainActivity.this, batteryOptLauncher);
}
);

batteryOptLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
result -> {
Expand Down Expand Up @@ -747,10 +735,6 @@ public void stopLogSizeUpdates() {
sizeUpdateHandler.removeCallbacks(sizeUpdateRunnable);
}

private void connectVpn() {
addToLog(getString(R.string.vpn_permission_granted));
}

@Override
protected void onPause() {
super.onPause();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/*
* ============================================================================
* Name : ServiceReceiver.java
* Author : IIAB Project
* Copyright : Copyright (c) 2026 IIAB Project
* Description : Broadcast receiver for system events
* Author : AppDevForAll
* Copyright : Copyright (c) 2026 AppDevForAll
* Description : Broadcast receiver for system events. Currently a placeholder
* for boot auto-start (ADFA-3340). The old VpnService/TProxyService
* auto-start was removed with the dead VPN tunnel (ADFA-4552); the
* receiver is kept as the seam where the future auto-start will hook.
* ============================================================================
*/

Expand All @@ -12,31 +15,19 @@
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.VpnService;
import android.os.Build;

public class ServiceReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction() == null) {
return;
}
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
Preferences prefs = new Preferences(context);

/* Auto-start */
if (prefs.getEnable()) {
// Initialize the service automatically on boot
/*
Intent i = VpnService.prepare(context);
if (i != null) {
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
i = new Intent(context, TProxyService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(i.setAction(TProxyService.ACTION_CONNECT));
} else {
context.startService(i.setAction(TProxyService.ACTION_CONNECT));
}
*/
// TODO(ADFA-3340): auto-start K2Go on boot. The previous
// VpnService/TProxyService implementation was removed (ADFA-4552,
// dead tunnel); the replacement start path will hook in here.
}
}
}
Expand Down
1 change: 0 additions & 1 deletion controller/app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@

<string name="user_initiated_conn">Conexión iniciada por el usuario</string>
<string name="vpn_description">Habilite URLs amigables. Bloquee las amenazas.</string>
<string name="vpn_permission_granted">Permiso de VPN concedido. Conectando...</string>
<string name="vpn_starting">Iniciando VPN...</string>
<string name="vpn_stopping">Deteniendo VPN...</string>

Expand Down
1 change: 0 additions & 1 deletion controller/app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@

<string name="user_initiated_conn">Connexion initiée par l\'utilisateur</string>
<string name="vpn_description">Activez des URL conviviales. Bloquez les menaces.</string>
<string name="vpn_permission_granted">Autorisation VPN accordée. Connexion en cours...</string>
<string name="vpn_starting">Démarrage du VPN...</string>
<string name="vpn_stopping">Arrêt du VPN...</string>

Expand Down
1 change: 0 additions & 1 deletion controller/app/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@

<string name="user_initiated_conn">उपयोगकर्ता द्वारा आरंभ किया गया कनेक्शन</string>
<string name="vpn_description">अनुकूल URL सक्षम करें। खतरों को ब्लॉक करें।</string>
<string name="vpn_permission_granted">VPN अनुमति दी गई। कनेक्ट हो रहा है...</string>
<string name="vpn_starting">VPN शुरू हो रहा है...</string>
<string name="vpn_stopping">VPN बंद हो रहा है...</string>

Expand Down
1 change: 0 additions & 1 deletion controller/app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@

<string name="user_initiated_conn">Conexão iniciada pelo usuário</string>
<string name="vpn_description">Ative URLs amigáveis. Bloqueie as ameaças.</string>
<string name="vpn_permission_granted">Permissão de VPN concedida. Conectando...</string>
<string name="vpn_starting">Iniciando VPN...</string>
<string name="vpn_stopping">Parando VPN...</string>

Expand Down
1 change: 0 additions & 1 deletion controller/app/src/main/res/values-ru-rRU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@

<string name="user_initiated_conn">Соединение инициировано пользователем</string>
<string name="vpn_description">Включить безопасные URL. Блокировать угрозы.</string>
<string name="vpn_permission_granted">Разрешение VPN получено. Подключение...</string>
<string name="vpn_starting">Запуск VPN...</string>
<string name="vpn_stopping">Остановка VPN...</string>

Expand Down
1 change: 0 additions & 1 deletion controller/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@

<string name="user_initiated_conn">User initiated connection</string>
<string name="vpn_description">Enable friendly URLs. Lock out the threats.</string>
<string name="vpn_permission_granted">VPN Permission Granted. Connecting...</string>
<string name="vpn_starting">VPN Starting...</string>
<string name="vpn_stopping">VPN Stopping...</string>

Expand Down