Bug Fixes

Bug Fixes
master
Abdul Mannan Saeed 2023-01-01 16:53:56 +05:00
parent 11cfc81a3c
commit c1a2796ccd
33 changed files with 441 additions and 57 deletions

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\msman\.android\avd\Pixel_2_API_32.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-12-31T19:50:31.396108Z" />
</component>
</project>

View File

@ -1,3 +1,3 @@
#Thu Dec 29 13:28:14 PKT 2022 #Sun Jan 01 02:47:09 PKT 2023
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000= \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
json=1845496062 json=1692972943

View File

@ -1,5 +1,5 @@
# #
#Thu Dec 29 13:41:56 PKT 2022 #Sun Jan 01 02:48:31 PKT 2023
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000= \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
sdk_analysis_plugin_version=4.8.1 sdk_analysis_plugin_version=4.8.1
set_multidex=true set_multidex=true

View File

@ -127,6 +127,11 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity
android:name="com.hiddenservices.onionservices.appManager.orbotRequestManager"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name="com.hiddenservices.onionservices.appManager.settingManager.generalManager.settingGeneralController" android:name="com.hiddenservices.onionservices.appManager.settingManager.generalManager.settingGeneralController"
android:configChanges="uiMode" android:configChanges="uiMode"

View File

@ -3,6 +3,7 @@ package com.hiddenservices.onionservices.appManager;
import android.app.Service; import android.app.Service;
import android.content.Intent; import android.content.Intent;
import android.os.Binder; import android.os.Binder;
import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.util.Log; import android.util.Log;
@ -30,12 +31,13 @@ public class activityStateManager extends Service {
@Override @Override
public int onStartCommand(Intent intent, int flags, int startId) { public int onStartCommand(Intent intent, int flags, int startId) {
return Service.START_STICKY_COMPATIBILITY; return Service.START_STICKY;
} }
@Override @Override
public void onDestroy() { public void onDestroy() {
Log.i("aaaaaaaa", "aaaaaaaa"); orbotLocalConstants.mAppForceExit = true;
status.sNoTorTriggered = false;
NotificationManagerCompat.from(this).cancel(1025); NotificationManagerCompat.from(this).cancel(1025);
NotificationManagerCompat.from(this).cancel(1030); NotificationManagerCompat.from(this).cancel(1030);
Intent mServiceIntent = new Intent(this.getApplicationContext(), OrbotService.class); Intent mServiceIntent = new Intent(this.getApplicationContext(), OrbotService.class);
@ -47,14 +49,14 @@ public class activityStateManager extends Service {
status.sSettingIsAppStarted = false; status.sSettingIsAppStarted = false;
orbotLocalConstants.mAppStarted = false; orbotLocalConstants.mAppStarted = false;
super.onDestroy(); super.onDestroy();
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
} }
@Override @Override
public void onTaskRemoved(Intent rootIntent) { public void onTaskRemoved(Intent rootIntent) {
Log.i("aaaaaaaa", "aaaaaaaa"); orbotLocalConstants.mAppForceExit = true;
status.sNoTorTriggered = false;
NotificationManagerCompat.from(this).cancel(1025); NotificationManagerCompat.from(this).cancel(1025);
NotificationManagerCompat.from(this).cancel(1030); NotificationManagerCompat.from(this).cancel(1030);
Intent mServiceIntent = new Intent(this.getApplicationContext(), OrbotService.class); Intent mServiceIntent = new Intent(this.getApplicationContext(), OrbotService.class);
@ -66,9 +68,8 @@ public class activityStateManager extends Service {
status.sSettingIsAppStarted = false; status.sSettingIsAppStarted = false;
orbotLocalConstants.mAppStarted = false; orbotLocalConstants.mAppStarted = false;
stopSelf(); stopSelf();
super.onDestroy(); super.onDestroy();
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
} }
} }

View File

@ -2,6 +2,7 @@ package com.hiddenservices.onionservices.appManager.externalCommandManager;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.view.View; import android.view.View;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
@ -40,12 +41,15 @@ public class externalShortcutController extends AppCompatActivity {
if (mShortcutCommands != null) { if (mShortcutCommands != null) {
mIntent.putExtra(EXTERNAL_SHORTCUT_COMMAND, mShortcutCommands); mIntent.putExtra(EXTERNAL_SHORTCUT_COMMAND, mShortcutCommands);
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION); pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
switch (mShortcutCommands) { switch (mShortcutCommands) {
case CONST_EXTERNAL_SHORTCUT_COMMAND_ERASE: case CONST_EXTERNAL_SHORTCUT_COMMAND_ERASE:
setContentView(R.layout.popup_data_cleared_shortcut); setContentView(R.layout.popup_data_cleared_shortcut);
panicExitInvoked(); panicExitInvoked();
helperMethod.onDelayHandler(this, 3000, () -> { helperMethod.onDelayHandler(this, 3000, () -> {
finishAndRemoveTask(); finishAndRemoveTask();
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
return null; return null;
}); });

View File

@ -9,6 +9,8 @@ import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.example.myapplication.R;
import com.hiddenservices.onionservices.appManager.activityContextManager; import com.hiddenservices.onionservices.appManager.activityContextManager;
import com.hiddenservices.onionservices.appManager.advertManager.advertController; import com.hiddenservices.onionservices.appManager.advertManager.advertController;
import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeController; import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeController;
@ -79,5 +81,6 @@ public class externalURLNavigationContoller extends AppCompatActivity {
}, 100); }, 100);
finish(); finish();
overridePendingTransition(R.anim.fade_out , R.anim.fade_out);
} }
} }

View File

@ -4,6 +4,7 @@ package com.hiddenservices.onionservices.appManager.homeManager.geckoManager;
import static android.app.PendingIntent.FLAG_IMMUTABLE; import static android.app.PendingIntent.FLAG_IMMUTABLE;
import static android.content.Context.NOTIFICATION_SERVICE; import static android.content.Context.NOTIFICATION_SERVICE;
import static com.hiddenservices.onionservices.appManager.homeManager.geckoManager.geckoPromptView.LOGTAG; import static com.hiddenservices.onionservices.appManager.homeManager.geckoManager.geckoPromptView.LOGTAG;
import android.app.Activity; import android.app.Activity;
import android.app.Notification; import android.app.Notification;
import android.app.NotificationChannel; import android.app.NotificationChannel;
@ -12,21 +13,17 @@ import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Build; import android.os.Build;
import android.util.Log; import android.util.Log;
import android.widget.RemoteViews; import android.widget.RemoteViews;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat; import androidx.core.app.NotificationManagerCompat;
import com.example.myapplication.R; import com.example.myapplication.R;
import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeController;
import com.hiddenservices.onionservices.constants.status; import com.hiddenservices.onionservices.constants.status;
import com.hiddenservices.onionservices.helperManager.helperMethod; import com.hiddenservices.onionservices.helperManager.helperMethod;
import com.hiddenservices.onionservices.pluginManager.pluginReciever.mediaNotificationReciever; import com.hiddenservices.onionservices.pluginManager.pluginReciever.mediaNotificationReciever;
import org.mozilla.geckoview.GeckoSession; import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.Image;
public class mediaDelegate implements GeckoSession.MediaDelegate { public class mediaDelegate implements GeckoSession.MediaDelegate {
private Integer mLastNotificationId = 100; private Integer mLastNotificationId = 100;
@ -113,14 +110,17 @@ public class mediaDelegate implements GeckoSession.MediaDelegate {
return; return;
} }
RemoteViews contentView; RemoteViews contentView;
if (android.os.Build.VERSION. SDK_INT > Build.VERSION_CODES.N_MR1 ) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ) {
contentView = new RemoteViews(context.getPackageName() , R.layout. media_notification_no_background ) ;
}else if (android.os.Build.VERSION. SDK_INT > Build.VERSION_CODES.N_MR1){
contentView = new RemoteViews(context.getPackageName() , R.layout. media_notification_layout ) ; contentView = new RemoteViews(context.getPackageName() , R.layout. media_notification_layout ) ;
}else { }else {
contentView = new RemoteViews(context.getPackageName() , R.layout. media_notification_layout_small ) ; contentView = new RemoteViews(context.getPackageName() , R.layout. media_notification_layout_small ) ;
} }
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S ) {
contentView.setInt(R.id.layout,"setBackgroundResource", R.color.c_tab_background); contentView.setInt(R.id.layout,"setBackgroundResource", R.color.c_tab_background);
}
contentView.setTextViewText(R.id.header, title); contentView.setTextViewText(R.id.header, title);
contentView.setTextViewText(R.id.body, "☍ " + url); contentView.setTextViewText(R.id.body, "☍ " + url);
@ -133,11 +133,19 @@ public class mediaDelegate implements GeckoSession.MediaDelegate {
if (not_status){ if (not_status){
PendingIntent pIntent = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_play", 0); PendingIntent pIntent = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_play", 0);
contentView.setOnClickPendingIntent(R.id.trigger, pIntent); contentView.setOnClickPendingIntent(R.id.trigger, pIntent);
contentView.setImageViewResource(R.id.trigger, R.drawable.ic_baseline_play_arrow); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ) {
contentView.setImageViewResource(R.id.trigger, R.drawable.ic_baseline_play_arrow_no_tint);
}else {
contentView.setImageViewResource(R.id.trigger, R.drawable.ic_baseline_play_arrow);
}
}else { }else {
PendingIntent pIntent = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_pause", 1); PendingIntent pIntent = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_pause", 1);
contentView.setOnClickPendingIntent(R.id.trigger, pIntent); contentView.setOnClickPendingIntent(R.id.trigger, pIntent);
contentView.setImageViewResource(R.id.trigger, R.drawable.ic_baseline_pause); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ) {
contentView.setImageViewResource(R.id.trigger, R.drawable.ic_baseline_pause_no_tint);
}else {
contentView.setImageViewResource(R.id.trigger, R.drawable.ic_baseline_pause);
}
} }
PendingIntent pIntentPrev = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_next", 2); PendingIntent pIntentPrev = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_next", 2);
@ -150,11 +158,16 @@ public class mediaDelegate implements GeckoSession.MediaDelegate {
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext, "1030" ) ; NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext, "1030" ) ;
mBuilder.setContent(contentView) ;
mBuilder.setPriority(Notification.PRIORITY_LOW); mBuilder.setPriority(Notification.PRIORITY_LOW);
mBuilder.setAutoCancel(true); mBuilder.setAutoCancel(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S){
mBuilder.setCustomBigContentView(contentView);
mBuilder.setStyle(new NotificationCompat.DecoratedCustomViewStyle());
}else {
mBuilder.setContent(contentView);
}
mBuilder.setSmallIcon(R.drawable.ic_genesis_logo ) ; mBuilder.setSmallIcon(R.drawable.ic_baseline_media) ;
mBuilder.setAutoCancel( true ) ; mBuilder.setAutoCancel( true ) ;
if (android.os.Build.VERSION. SDK_INT >= android.os.Build.VERSION_CODES. O ) { if (android.os.Build.VERSION. SDK_INT >= android.os.Build.VERSION_CODES. O ) {
int importance = NotificationManager.IMPORTANCE_LOW ; int importance = NotificationManager.IMPORTANCE_LOW ;

View File

@ -225,6 +225,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@RequiresApi(api = Build.VERSION_CODES.M) @RequiresApi(api = Build.VERSION_CODES.M)
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
orbotLocalConstants.mAppForceExit = false;
orbotLocalConstants.mForcedQuit = false;
onInitTheme(); onInitTheme();
onInitBooleans(); onInitBooleans();
orbotLocalConstants.mHomeIntent = getIntent(); orbotLocalConstants.mHomeIntent = getIntent();
@ -262,7 +264,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
initBundle(); initBundle();
initTor(); initTor();
initNotification(); initNotification();
onHideDefaultNotification();
} }
public void initNotification() { public void initNotification() {
@ -578,6 +579,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void initPreFixes() { public void initPreFixes() {
try { try {
if(status.mThemeApplying){
onShowDefaultNotification();
}else {
onHideDefaultNotification();
}
String strManufacturer = android.os.Build.MANUFACTURER; String strManufacturer = android.os.Build.MANUFACTURER;
if ((Build.VERSION.SDK_INT == Build.VERSION_CODES.O || Build.VERSION.SDK_INT == Build.VERSION_CODES.O_MR1) && strManufacturer.equals("samsung")) { if ((Build.VERSION.SDK_INT == Build.VERSION_CODES.O || Build.VERSION.SDK_INT == Build.VERSION_CODES.O_MR1) && strManufacturer.equals("samsung")) {
PackageManager packageManager = getApplicationContext().getPackageManager(); PackageManager packageManager = getApplicationContext().getPackageManager();
@ -832,11 +839,17 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoClient.onClearAll(); mGeckoClient.onClearAll();
status.sSettingIsAppStarted = false; status.sSettingIsAppStarted = false;
orbotLocalConstants.mAppStarted = false; orbotLocalConstants.mAppStarted = false;
new Handler().postDelayed(() ->
{
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
}, 100);
} }
NotificationManager manager = null; NotificationManager manager = null;
public void showDefaultNotification(Context context, String title) { public void showDefaultNotification(Context context, String title) {
if(status.sTorBrowsing && status.sBridgeNotificationManual != 0){ if(!status.mThemeApplying && status.sTorBrowsing && status.sBridgeNotificationManual != 0){
return; return;
} }
@ -889,7 +902,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
notification.fullScreenIntent = dummyIntent; notification.fullScreenIntent = dummyIntent;
notification.flags |= Notification.FLAG_NO_CLEAR; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
notification.flags = Notification.FLAG_AUTO_CANCEL|Notification.FLAG_ONGOING_EVENT;
}else {
notification.flags |= Notification.FLAG_NO_CLEAR;
}
int notificationCode = 1025; int notificationCode = 1025;
@ -900,7 +917,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1); long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);
DownloadManager dMgr = (DownloadManager) getSystemService(DOWNLOAD_SERVICE); DownloadManager dMgr = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
Cursor c = Objects.requireNonNull(dMgr).query(new DownloadManager.Query().setFilterById(id)); Cursor c = Objects.requireNonNull(dMgr).query(new DownloadManager.Query().setFilterById(id));
@ -958,13 +974,17 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
@Override @Override
protected void onDestroy() { protected void onDestroy() {
status.sNoTorTriggered = false;
orbotLocalConstants.mAppForceExit = true;
NotificationManagerCompat.from(this).cancel(1030); NotificationManagerCompat.from(this).cancel(1030);
if(manager!=null){ if(manager!=null){
manager.cancel(1025); manager.cancel(1025);
} }
NotificationManagerCompat.from(this).cancel(1025); NotificationManagerCompat.from(this).cancel(1025);
mGeckoClient.getSession().onDestroyMedia(); if(mGeckoClient.getSession() !=null){
onHideDefaultNotification(); mGeckoClient.getSession().onDestroyMedia();
onHideDefaultNotification();
}
pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_DESTROY); pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_DESTROY);
if (!status.sSettingIsAppStarted) { if (!status.sSettingIsAppStarted) {
super.onDestroy(); super.onDestroy();
@ -993,6 +1013,16 @@ public class homeController extends AppCompatActivity implements ComponentCallba
activityContextManager.getInstance().getHomeController().onResetData(); activityContextManager.getInstance().getHomeController().onResetData();
NotificationManagerCompat.from(this).cancel(1030); NotificationManagerCompat.from(this).cancel(1030);
if (!status.mThemeApplying) {
new Handler().postDelayed(() ->
{
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
}, 100);
finishAffinity();
finishAndRemoveTask();
}
super.onDestroy(); super.onDestroy();
} }
@ -1686,6 +1716,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override @Override
public void onResume() { public void onResume() {
orbotLocalConstants.mAppForceExit = false;
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME); pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
activityContextManager.getInstance().setCurrentActivity(this); activityContextManager.getInstance().setCurrentActivity(this);
@ -1932,7 +1963,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
{ {
if(!mBackground){ if(!mBackground){
Intent intent = new Intent(this, activityStateManager.class); Intent intent = new Intent(this, activityStateManager.class);
bindService(intent, connection, 0); bindService(intent, connection, BIND_AUTO_CREATE);
startService(intent); startService(intent);
} }
}, 500); }, 500);
@ -1965,7 +1996,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION); pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
activityContextManager.getInstance().getHomeController().onShowDefaultNotification(); activityContextManager.getInstance().getHomeController().onShowDefaultNotification();
} else { } else {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION); new Handler().postDelayed(() ->
{
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION);
}, 2000);
} }
} }
@ -2174,6 +2208,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
status.sSettingIsAppStarted = false; status.sSettingIsAppStarted = false;
orbotLocalConstants.mAppStarted = false; orbotLocalConstants.mAppStarted = false;
new Handler().postDelayed(() ->
{
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
}, 100);
} else if (menuId == R.id.pMenuFind) { } else if (menuId == R.id.pMenuFind) {
helperMethod.hideKeyboard(this); helperMethod.hideKeyboard(this);
mHomeViewController.onUpdateFindBar(true); mHomeViewController.onUpdateFindBar(true);
@ -2237,6 +2277,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.closeMenu(); mHomeViewController.closeMenu();
} }
public void onNewCircuitInvoked(){
try {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT);
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_NEW_IDENTITY);
mGeckoClient.onReloadDelay(mGeckoView, this, false);
onLoadURL(mSearchbar.getText().toString());
}catch (Exception ex){}
}
private void onInitTheme() { private void onInitTheme() {
if (status.sSettingIsAppStarted) { if (status.sSettingIsAppStarted) {

View File

@ -1345,8 +1345,10 @@ class homeViewController {
} }
void progressBarReset() { void progressBarReset() {
mProgressBar.setProgress(0); if(mSearchbar.getText().toString().equals("about:blank")){
mProgressBar.setVisibility(View.INVISIBLE); mProgressBar.setProgress(0);
mProgressBar.setVisibility(View.INVISIBLE);
}
} }
public void onFirstPaint() { public void onFirstPaint() {
@ -1440,6 +1442,11 @@ class homeViewController {
alpha.start(); alpha.start();
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) {
final Handler handler = new Handler();
handler.postDelayed(() -> {
mEvent.invokeObserver(data, e_type);
}, 450);
scaleDown.addListener(new Animator.AnimatorListener() { scaleDown.addListener(new Animator.AnimatorListener() {
@Override @Override
public void onAnimationStart(Animator animation, boolean isReverse) { public void onAnimationStart(Animator animation, boolean isReverse) {
@ -1447,6 +1454,8 @@ class homeViewController {
@Override @Override
public void onAnimationEnd(Animator animation, boolean isReverse) { public void onAnimationEnd(Animator animation, boolean isReverse) {
scaleDown.removeAllListeners();
handler.removeCallbacksAndMessages(null);
mEvent.invokeObserver(data, e_type); mEvent.invokeObserver(data, e_type);
} }
@ -1456,15 +1465,18 @@ class homeViewController {
@Override @Override
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
//scaleDown.removeAllListeners();
//mEvent.invokeObserver(data, e_type);
} }
@Override @Override
public void onAnimationCancel(Animator animation) { public void onAnimationCancel(Animator animation) {
Log.i("","");
} }
@Override @Override
public void onAnimationRepeat(Animator animation) { public void onAnimationRepeat(Animator animation) {
Log.i("","");
} }
}); });
}else { }else {

View File

@ -0,0 +1,44 @@
package com.hiddenservices.onionservices.appManager;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static com.hiddenservices.onionservices.constants.keys.EXTERNAL_SHORTCUT_COMMAND_NAVIGATE;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeController;
import com.hiddenservices.onionservices.constants.constants;
import com.hiddenservices.onionservices.constants.status;
import com.hiddenservices.onionservices.helperManager.helperMethod;
import org.torproject.android.service.wrapper.orbotExternalCommands;
public class orbotRequestManager extends AppCompatActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
finish();
int m_command = getIntent().getIntExtra("command", 0);
if(m_command == orbotExternalCommands.S_NEW_CIRCUIT){
Intent mIntent = new Intent(this, homeController.class);
helperMethod.openIntent(mIntent, this, constants.CONST_LIST_EXTERNAL_SHORTCUT);
activityContextManager.getInstance().getHomeController().onNewCircuitInvoked();
}
else if(m_command == orbotExternalCommands.S_NOTIFICATION_SETTINGS){
try {
Intent intent;
intent = new Intent(this, Class.forName("com.hiddenservices.onionservices.appManager.settingManager.notificationManager.settingNotificationController"));
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
getApplicationContext().startActivity(intent);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
}

View File

@ -1,5 +1,7 @@
package com.hiddenservices.onionservices.appManager.settingManager.searchEngineManager; package com.hiddenservices.onionservices.appManager.settingManager.searchEngineManager;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_GENESIS_SEARCH_DISABLED;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
@ -130,6 +132,9 @@ public class settingSearchController extends AppCompatActivity {
public void onSelectSearchEngine(View view) { public void onSelectSearchEngine(View view) {
if (view.getId() == R.id.pSearchSettingOption1) { if (view.getId() == R.id.pSearchSettingOption1) {
if(!status.sTorBrowsing){
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_GENESIS_SEARCH_DISABLED);
}
mSettingSearchModel.onTrigger(settingSearchEnums.eSearchModel.M_SET_SEARCH_ENGINE, Collections.singletonList(constants.CONST_BACKEND_GENESIS_URL)); mSettingSearchModel.onTrigger(settingSearchEnums.eSearchModel.M_SET_SEARCH_ENGINE, Collections.singletonList(constants.CONST_BACKEND_GENESIS_URL));
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE, status.sSettingDefaultSearchEngine)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE, status.sSettingDefaultSearchEngine));
} else if (view.getId() == R.id.pSearchSettingOption2) { } else if (view.getId() == R.id.pSearchSettingOption2) {

View File

@ -1,5 +1,8 @@
package com.hiddenservices.onionservices.appManager.settingManager.searchEngineManager; package com.hiddenservices.onionservices.appManager.settingManager.searchEngineManager;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_GENESIS_SEARCH_DISABLED;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_MAX_TAB_REACHED;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.os.Build; import android.os.Build;
import android.view.View; import android.view.View;
@ -17,8 +20,10 @@ import com.hiddenservices.onionservices.constants.status;
import com.hiddenservices.onionservices.eventObserver; import com.hiddenservices.onionservices.eventObserver;
import com.example.myapplication.R; import com.example.myapplication.R;
import com.google.android.material.switchmaterial.SwitchMaterial; import com.google.android.material.switchmaterial.SwitchMaterial;
import com.hiddenservices.onionservices.pluginManager.pluginController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
class settingSearchViewController { class settingSearchViewController {
@ -65,7 +70,7 @@ class settingSearchViewController {
} }
if (!status.sTorBrowsing) { if (!status.sTorBrowsing) {
mSearchSettingOption1.setVisibility(View.GONE); mSearchSettingOption1.setAlpha(0.3f);
} }
} }

View File

@ -407,10 +407,13 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
new Handler().postDelayed(() -> new Handler().postDelayed(() ->
{ {
ImageButton mOrbotRowRemove = itemView.findViewById(R.id.pOrbotRowRemove);
itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getHomeController(), R.color.clear_alpha)); itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getHomeController(), R.color.clear_alpha));
mOrbotRowRemove.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_background));
if (!status.sTabGridLayoutEnabled) { if (!status.sTabGridLayoutEnabled) {
if (getLayoutPosition() == 0) { if (getLayoutPosition() == 0) {
itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getHomeController(), R.color.c_list_item_current)); itemView.setBackgroundColor(ContextCompat.getColor(activityContextManager.getInstance().getHomeController(), R.color.c_list_item_current));
mOrbotRowRemove.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.c_list_item_current));
} }
} }

View File

@ -1112,6 +1112,7 @@ public class helperMethod {
activityContextManager.getInstance().getHomeController().overridePendingTransition(R.anim.popup_scale_in, R.anim.popup_scale_out); activityContextManager.getInstance().getHomeController().overridePendingTransition(R.anim.popup_scale_in, R.anim.popup_scale_out);
} }
}); });
Runtime.getRuntime().exit(0); Runtime.getRuntime().exit(0);
System.exit(1); System.exit(1);
} }

View File

@ -104,7 +104,7 @@ public class appLovinManager implements MaxAdViewAdListener {
public void onAdLoadFailed(String adUnitId, MaxError error) { public void onAdLoadFailed(String adUnitId, MaxError error) {
new Handler().postDelayed(() -> new Handler().postDelayed(() ->
{ {
if (mRequestCount <= 10) { if (mRequestCount <= 50) {
mRequestCount += 1; mRequestCount += 1;
bannerAdRequested = true; bannerAdRequested = true;
mBannerAds.get().loadAd(); mBannerAds.get().loadAd();

View File

@ -866,6 +866,11 @@ public class messageManager implements View.OnClickListener, DialogInterface.OnD
onShowToast(R.layout.popup_toast_generic, R.xml.ax_background_generic, 1000, mContext.getString(R.string.TOAST_ALERT_URL_COPIED), mContext.getString(R.string.ALERT_DISMISS), null); onShowToast(R.layout.popup_toast_generic, R.xml.ax_background_generic, 1000, mContext.getString(R.string.TOAST_ALERT_URL_COPIED), mContext.getString(R.string.ALERT_DISMISS), null);
break; break;
case M_GENESIS_SEARCH_DISABLED:
/*VERIFIED*/
onShowToast(R.layout.popup_toast_warning, R.xml.ax_background_warning, 2000, "Warning! Start Browser with tor browsing enabled", mContext.getString(R.string.ALERT_DISMISS), null);
break;
case M_UPDATE_BOOKMARK: case M_UPDATE_BOOKMARK:
/*VERIFIED*/ /*VERIFIED*/
onShowToast(R.layout.popup_toast_generic, R.xml.ax_background_generic, 2000, mContext.getString(R.string.TOAST_ALERT_BOOKMARK_UPDATE), mContext.getString(R.string.ALERT_DISMISS), null); onShowToast(R.layout.popup_toast_generic, R.xml.ax_background_generic, 2000, mContext.getString(R.string.TOAST_ALERT_BOOKMARK_UPDATE), mContext.getString(R.string.ALERT_DISMISS), null);

View File

@ -26,7 +26,7 @@ public class pluginEnums {
/*Message Manager*/ /*Message Manager*/
public enum eMessageManager { public enum eMessageManager {
M_RESET, M_DATA_CLEARED, M_COPY, M_APPLICATION_CRASH, M_DELETE_BOOKMARK, M_UPDATE_BOOKMARK, M_IMAGE_UPDATE, M_OPEN_ACTIVITY_FAILED, M_OPEN_CICADA, M_TOR_SWITCH, M_SECURE_CONNECTION, M_SECURITY_INFO, M_POPUP_BLOCKED, M_PANIC, M_MAX_TAB_REACHED, M_ORBOT_LOADING, M_LOAD_NEW_TAB, M_UNDO, M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NEW_IDENTITY, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FAILURE, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_PANIC_RESET, M_DEFAULT_BROWSER, M_TOR_SWITCH_RESTART, M_RATE_SUCCESS, M_RATE_FAILURE, M_CLOSE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME M_RESET, M_DATA_CLEARED, M_COPY, M_APPLICATION_CRASH, M_DELETE_BOOKMARK, M_UPDATE_BOOKMARK, M_IMAGE_UPDATE, M_OPEN_ACTIVITY_FAILED, M_OPEN_CICADA, M_TOR_SWITCH, M_SECURE_CONNECTION, M_SECURITY_INFO, M_POPUP_BLOCKED, M_PANIC, M_MAX_TAB_REACHED, M_ORBOT_LOADING, M_GENESIS_SEARCH_DISABLED, M_LOAD_NEW_TAB, M_UNDO, M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NEW_IDENTITY, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FAILURE, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_PANIC_RESET, M_DEFAULT_BROWSER, M_TOR_SWITCH_RESTART, M_RATE_SUCCESS, M_RATE_FAILURE, M_CLOSE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME
} }
public enum eMessageManagerCallbacks { public enum eMessageManagerCallbacks {

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/c_holo_gray">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/c_holo_gray" />
<corners android:radius="5.5dp" />
</shape>
</item>
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="@color/warning_darker"
android:startColor="@color/warning_darker"
android:type="linear" />
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
</shape>
</item>
</ripple>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#768CB8"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,4H4C2.9,4 2,4.9 2,6v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6C22,4.9 21.1,4 20,4zM9.5,16.5v-9l7,4.5L9.5,16.5z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="@color/c_background_inverted"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/c_background_inverted" android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="@color/c_background_inverted"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/c_background_inverted" android:pathData="M8,5v14l11,-7z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="@color/c_background_inverted"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/c_background_inverted" android:pathData="M6,18l8.5,-6L6,6v12zM16,6v12h2V6h-2z"/>
</vector>

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/pDataCleared"
android:translationZ="5dp"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pPopupToastContainer"
android:layout_width="0dp"
app:layout_constraintHorizontal_weight="1"
android:layout_height="55dp"
android:layout_marginBottom="10dp"
android:background="@xml/ax_background_warning"
app:layout_constraintWidth_max="400dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/pPopupToastInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="100dp"
android:alpha="0.8"
android:maxWidth="400dp"
android:maxLines="1"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/GENERAL_DEFAULT_TEXT"
android:textAlignment="textStart"
android:textColor="@color/c_white"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/pPopupToastDivider"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="@+id/pPopupToastContainer"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SmallSp" />
<Button
android:id="@+id/pPopupToastTrigger"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@xml/ax_toast_alert_button"
android:padding="0dp"
android:text="@string/ALERT_DISMISS"
android:textAllCaps="false"
android:textColor="@color/c_white"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TouchTargetSizeCheck" />
<View
android:id="@+id/pPopupToastDivider"
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:background="@color/c_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/pPopupToastTrigger"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id = "@+id/layout"
android:layout_width = "fill_parent"
android:layout_height = "67dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical"
android:layout_toStartOf="@+id/controller"
android:layout_height="67dp">
<TextView
android:id = "@+id/header"
android:paddingTop="10dp"
android:layout_toEndOf = "@id/controller"
android:layout_width = "match_parent"
android:layout_height = "wrap_content"
android:maxHeight="28dp"
android:text = "Testing"
android:singleLine="true"
android:textSize = "13sp" />
<TextView
android:id="@+id/body"
android:layout_toEndOf = "@id/controller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/header"
android:layout_marginTop="4dp"
android:ellipsize="marquee"
android:singleLine="true"
android:text="Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever since the
1500s, when an unknown printer took a galley of type and scrambled it to make a type
specimen book. It has survived not only five centuries, but also the leap into
electronic typesetting, remaining essentially unchanged. It was popularised in the
1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more
recently with desktop publishing software like Aldus PageMaker including versions of
Lorem Ipsum. "
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:gravity="center"
android:id="@+id/controller"
android:orientation="horizontal">
<ImageButton
android:id = "@+id/trigger"
android:scaleX="1.4"
android:scaleY="1.4"
android:layout_width = "65dp"
android:layout_height = "35dp"
android:background="@color/clear_alpha"
android:contentDescription = "@string/app_name"
android:src = "@drawable/ic_baseline_play_arrow_no_tint"/>
<ImageButton
android:id = "@+id/next"
android:scaleX="1.4"
android:scaleY="1.4"
android:layout_width = "60dp"
android:layout_height = "35dp"
android:background="@color/clear_alpha"
android:contentDescription = "@string/app_name"
android:src = "@drawable/ic_baseline_skip_next_no_tint"/>
</LinearLayout>
</RelativeLayout>

View File

@ -191,15 +191,17 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="2" android:layout_weight="2"
android:background="@xml/hx_border"
android:contentDescription="@string/GENERAL_TODO" android:contentDescription="@string/GENERAL_TODO"
android:longClickable="true" android:longClickable="true"
android:padding="20dp" android:padding="20dp"
android:paddingTop="22dp" android:paddingTop="22dp"
android:background="@color/c_background"
android:paddingBottom="22dp" android:paddingBottom="22dp"
android:foreground="?attr/selectableItemBackgroundBorderless"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@xml/ic_baseline_cross" android:src="@xml/ic_baseline_cross"
android:translationZ="10dp" android:translationZ="10dp"
android:outlineProvider="none"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:tint="@color/c_navigation_tint" app:tint="@color/c_navigation_tint"

View File

@ -194,6 +194,7 @@
<color name="dark_purple">#ffffff</color> <color name="dark_purple">#ffffff</color>
<color name="warning">#ffc107</color> <color name="warning">#ffc107</color>
<color name="warning_dark">#997300</color> <color name="warning_dark">#997300</color>
<color name="warning_darker">#cc7a00</color>
<color name="connectors">#ffffff</color> <color name="connectors">#ffffff</color>
<color name="colorProgressGradientStart">#00d9ff</color> <color name="colorProgressGradientStart">#00d9ff</color>
<color name="colorProgressGradientEnd">#00a4fd</color> <color name="colorProgressGradientEnd">#00a4fd</color>

View File

@ -31,6 +31,7 @@ import android.net.NetworkInfo;
import android.net.Uri; import android.net.Uri;
import android.net.VpnService; import android.net.VpnService;
import android.os.Build; import android.os.Build;
import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.provider.BaseColumns; import android.provider.BaseColumns;
@ -41,6 +42,7 @@ import net.freehaven.tor.control.TorControlCommands;
import net.freehaven.tor.control.TorControlConnection; import net.freehaven.tor.control.TorControlConnection;
import org.torproject.android.service.wrapper.localHelperMethod; import org.torproject.android.service.wrapper.localHelperMethod;
import org.torproject.android.service.wrapper.logRowModel; import org.torproject.android.service.wrapper.logRowModel;
import org.torproject.android.service.wrapper.orbotExternalCommands;
import org.torproject.android.service.wrapper.orbotLocalConstants; import org.torproject.android.service.wrapper.orbotLocalConstants;
import org.torproject.android.service.util.CustomTorResourceInstaller; import org.torproject.android.service.util.CustomTorResourceInstaller;
import org.torproject.android.service.util.Prefs; import org.torproject.android.service.util.Prefs;
@ -184,8 +186,8 @@ public class OrbotService extends VpnService implements OrbotConstants {
boolean mToolbarUpdating = false; boolean mToolbarUpdating = false;
@SuppressLint({"NewApi", "RestrictedApi"}) @SuppressLint({"NewApi", "RestrictedApi"})
public void showToolbarNotification(String notifyMsg, int notifyType, int icon) { public void showToolbarNotification(String notifyMsg, int notifyType, int icon, boolean forced) {
if(!mToolbarUpdating && orbotLocalConstants.mNotificationStatus != 0 && orbotLocalConstants.mAppStarted){ if(!mToolbarUpdating && orbotLocalConstants.mNotificationStatus != 0 && (orbotLocalConstants.mAppStarted || forced)){
mToolbarUpdating = true; mToolbarUpdating = true;
}else { }else {
return; return;
@ -251,7 +253,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
} }
public int onStartCommand(Intent intent, int flags, int startId) { public int onStartCommand(Intent intent, int flags, int startId) {
showToolbarNotification(getString(org.torproject.android.service.R.string.newnym), NOTIFY_ID, org.torproject.android.service.R.drawable.ic_stat_starting_tor_logo); showToolbarNotification("orbot is connecting please wait!", NOTIFY_ID, org.torproject.android.service.R.drawable.ic_stat_starting_tor_logo, false);
createNetworkStateReciever(); createNetworkStateReciever();
IntentFilter mNetworkStateFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION); IntentFilter mNetworkStateFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
@ -345,8 +347,8 @@ public class OrbotService extends VpnService implements OrbotConstants {
//sendCallbackStatus(STATUS_OFF); //sendCallbackStatus(STATUS_OFF);
orbotLocalConstants.mTorLogsStatus = "No internet connection"; orbotLocalConstants.mTorLogsStatus = "No internet connection";
if(orbotLocalConstants.mNotificationStatus!=0 && orbotLocalConstants.mAppStarted){ if(orbotLocalConstants.mNotificationStatus!=0 && orbotLocalConstants.mAppStarted){
showToolbarNotification(getString(R.string.newnym), getNotifyId(), R.drawable.ic_stat_tor_off); showToolbarNotification(getString(R.string.newnym), getNotifyId(), R.drawable.ic_stat_tor_off, false);
showToolbarNotification("Genesis is sleeping | Internet connectivity issue",NOTIFY_ID,R.drawable.ic_stat_tor_off); showToolbarNotification("Genesis is sleeping | Internet connectivity issue",NOTIFY_ID,R.drawable.ic_stat_tor_off, false);
} }
} }
else else
@ -354,7 +356,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
//sendCallbackStatus(STATUS_STARTING); //sendCallbackStatus(STATUS_STARTING);
if(orbotLocalConstants.mNotificationStatus!=0 && orbotLocalConstants.mAppStarted){ if(orbotLocalConstants.mNotificationStatus!=0 && orbotLocalConstants.mAppStarted){
showToolbarNotification(getString(R.string.status_starting_up),NOTIFY_ID,R.drawable.ic_stat_starting_tor_logo); showToolbarNotification(getString(R.string.status_starting_up),NOTIFY_ID,R.drawable.ic_stat_starting_tor_logo, false);
} }
} }
@ -406,13 +408,16 @@ public class OrbotService extends VpnService implements OrbotConstants {
public void enableTorNotificationNoBandwidth(){ public void enableTorNotificationNoBandwidth(){
orbotLocalConstants.mNotificationStatus = 1; orbotLocalConstants.mNotificationStatus = 1;
showToolbarNotification("Connected to the Tor network", HS_NOTIFY_ID, R.mipmap.ic_stat_tor_logo); showToolbarNotification("Connected to the Tor network", HS_NOTIFY_ID, R.mipmap.ic_stat_tor_logo, false);
} }
public void enableNotification(){ public void enableNotification(){
if(mConnectivity && orbotLocalConstants.mIsTorInitialized){ if(mConnectivity && orbotLocalConstants.mIsTorInitialized){
orbotLocalConstants.mNotificationStatus = 1; orbotLocalConstants.mNotificationStatus = 1;
showToolbarNotification(0+"kbps ⇣ / " +0+"kbps ⇡", HS_NOTIFY_ID, R.mipmap.ic_stat_tor_logo); showToolbarNotification(0+"kbps ⇣ / " +0+"kbps ⇡", HS_NOTIFY_ID, R.mipmap.ic_stat_tor_logo, false);
}
else {
showToolbarNotification("orbot is connecting please wait!", NOTIFY_ID, org.torproject.android.service.R.drawable.ic_stat_starting_tor_logo, true);
} }
} }
@ -447,7 +452,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
stopTorAsync(false); stopTorAsync(false);
showToolbarNotification( showToolbarNotification(
getString(R.string.unable_to_start_tor) + ": " + message, getString(R.string.unable_to_start_tor) + ": " + message,
ERROR_NOTIFY_ID, R.drawable.ic_stat_notifyerr); ERROR_NOTIFY_ID, R.drawable.ic_stat_notifyerr, false);
} }
private static boolean useIPtObfsMeekProxy() { private static boolean useIPtObfsMeekProxy() {
@ -824,7 +829,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
if(orbotLocalConstants.mNotificationStatus != 0 && orbotLocalConstants.mAppStarted ) { if(orbotLocalConstants.mNotificationStatus != 0 && orbotLocalConstants.mAppStarted ) {
mNotifyBuilder.setProgress(100, 0, false); mNotifyBuilder.setProgress(100, 0, false);
} }
showToolbarNotification("", NOTIFY_ID, R.mipmap.ic_stat_tor_logo); showToolbarNotification("", NOTIFY_ID, R.mipmap.ic_stat_tor_logo, false);
startTorService(); startTorService();
@ -1052,7 +1057,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
try { try {
if (conn != null && mCurrentStatus.equals(STATUS_ON)) { if (conn != null && mCurrentStatus.equals(STATUS_ON)) {
mNotifyBuilder.setSubText(null); // clear previous exit node info if present mNotifyBuilder.setSubText(null); // clear previous exit node info if present
showToolbarNotification(getString(R.string.newnym), NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo); showToolbarNotification(getString(R.string.newnym), NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo, false);
conn.signal(TorControlCommands.SIGNAL_NEWNYM); conn.signal(TorControlCommands.SIGNAL_NEWNYM);
} }
} catch (Exception ioe) { } catch (Exception ioe) {
@ -1221,7 +1226,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
} }
} catch (Exception e) { } catch (Exception e) {
showToolbarNotification(getString(R.string.your_reachableaddresses_settings_caused_an_exception_), ERROR_NOTIFY_ID, R.drawable.ic_stat_notifyerr); showToolbarNotification(getString(R.string.your_reachableaddresses_settings_caused_an_exception_), ERROR_NOTIFY_ID, R.drawable.ic_stat_notifyerr, false);
return null; return null;
} }
@ -1238,7 +1243,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
} }
} catch (Exception e) { } catch (Exception e) {
showToolbarNotification(getString(R.string.your_relay_settings_caused_an_exception_), ERROR_NOTIFY_ID, R.drawable.ic_stat_notifyerr); showToolbarNotification(getString(R.string.your_relay_settings_caused_an_exception_), ERROR_NOTIFY_ID, R.drawable.ic_stat_notifyerr, false);
return null; return null;
} }
@ -1254,7 +1259,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
void showBandwidthNotification(String message, boolean isActiveTransfer) { void showBandwidthNotification(String message, boolean isActiveTransfer) {
if (!mCurrentStatus.equals(STATUS_ON) || !mConnectivity) return; if (!mCurrentStatus.equals(STATUS_ON) || !mConnectivity) return;
var icon = !isActiveTransfer ? R.mipmap.ic_stat_tor_logo : R.mipmap.ic_stat_tor_logo; var icon = !isActiveTransfer ? R.mipmap.ic_stat_tor_logo : R.mipmap.ic_stat_tor_logo;
showToolbarNotification(message, NOTIFY_ID, icon); showToolbarNotification(message, NOTIFY_ID, icon, false);
} }
public static String formatBandwidthCount(Context context, long bitsPerSecond) { public static String formatBandwidthCount(Context context, long bitsPerSecond) {
@ -1597,7 +1602,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
break; break;
case ACTION_STATUS: case ACTION_STATUS:
if (mCurrentStatus.equals(STATUS_OFF)) if (mCurrentStatus.equals(STATUS_OFF))
showToolbarNotification(getString(R.string.open_orbot_to_connect_to_tor), NOTIFY_ID, R.mipmap.ic_stat_tor_logo); showToolbarNotification(getString(R.string.open_orbot_to_connect_to_tor), NOTIFY_ID, R.mipmap.ic_stat_tor_logo, false);
replyWithStatus(mIntent); replyWithStatus(mIntent);
break; break;
@ -1608,7 +1613,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
newIdentity(); newIdentity();
break; break;
case CMD_SETTING: case CMD_SETTING:
onSettingRegister(); //onSettingRegister();
break; break;
case CMD_ACTIVE: case CMD_ACTIVE:
sendSignalActive(); sendSignalActive();
@ -1623,11 +1628,14 @@ public class OrbotService extends VpnService implements OrbotConstants {
} }
} }
public void onSettingRegister(){ public void onInvokeController(int pCommand){
try { try {
Intent intent; Intent intent;
intent = new Intent(this, Class.forName("com.hiddenservices.onionservices.appManager.settingManager.notificationManager.settingNotificationController")); intent = new Intent(this, Class.forName("com.hiddenservices.onionservices.appManager.orbotRequestManager"));
intent.setFlags(FLAG_ACTIVITY_NEW_TASK); intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
Bundle mBundle = new Bundle();
mBundle.putInt("command", pCommand);
intent.putExtras(mBundle);
getApplicationContext().startActivity(intent); getApplicationContext().startActivity(intent);
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
@ -1639,8 +1647,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
switch (intent.getAction()) { switch (intent.getAction()) {
case TorControlCommands.SIGNAL_NEWNYM: { case TorControlCommands.SIGNAL_NEWNYM: {
activityContextManager onInvokeController(orbotExternalCommands.S_NEW_CIRCUIT);
newIdentity();
break; break;
} }
case CMD_ACTIVE: { case CMD_ACTIVE: {
@ -1652,7 +1659,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
break; break;
} }
case CMD_SETTING: { case CMD_SETTING: {
onSettingRegister(); onInvokeController(orbotExternalCommands.S_NOTIFICATION_SETTINGS);
try{ try{
sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
}catch (Exception ex){} }catch (Exception ex){}

View File

@ -0,0 +1,7 @@
package org.torproject.android.service.wrapper;
public class orbotExternalCommands
{
public static int S_NEW_CIRCUIT = 1;
public static int S_NOTIFICATION_SETTINGS = 2;
}

View File

@ -12,6 +12,7 @@ public class orbotLocalConstants
public static String mTorLogsStatus = "Loading..."; public static String mTorLogsStatus = "Loading...";
public static boolean mIsTorInitialized = false; public static boolean mIsTorInitialized = false;
public static boolean mForcedQuit = false; public static boolean mForcedQuit = false;
public static boolean mAppForceExit = false;
public static int mNotificationStatus = 0; public static int mNotificationStatus = 0;
public static WeakReference<Context> mHomeContext; public static WeakReference<Context> mHomeContext;
public static Intent mHomeIntent = null; public static Intent mHomeIntent = null;
@ -22,6 +23,7 @@ public class orbotLocalConstants
public static boolean mAppStarted = false; public static boolean mAppStarted = false;
public static String mBridgesDefault = ""; public static String mBridgesDefault = "";
public static boolean mStartTriggered = false; public static boolean mStartTriggered = false;
public static boolean mNewCircuitRegistered = false;
public static int mHTTPPort = 8118; public static int mHTTPPort = 8118;
public static int mSOCKSPort = -1; public static int mSOCKSPort = -1;