|
@ -84,6 +84,7 @@
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.darkweb.genesissearchengine.appManager.settingManager.notificationManager.settingNotificationController"
|
android:name="com.darkweb.genesissearchengine.appManager.settingManager.notificationManager.settingNotificationController"
|
||||||
|
android:launchMode="singleTop"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
<activity
|
<activity
|
||||||
|
@ -220,6 +221,16 @@
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
|
<provider
|
||||||
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
android:authorities="com.darkweb.genesissearchengine.fileprovider"
|
||||||
|
android:exported="false"
|
||||||
|
android:grantUriPermissions="true">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
|
android:resource="@xml/provider_paths" />
|
||||||
|
</provider>
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="com.darkweb.genesissearchengine.provider"
|
android:authorities="com.darkweb.genesissearchengine.provider"
|
||||||
|
|
|
@ -426,7 +426,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
||||||
public void run(){
|
public void run(){
|
||||||
try {
|
try {
|
||||||
mHindTypeIconTemp.setImageDrawable(null);
|
mHindTypeIconTemp.setImageDrawable(null);
|
||||||
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "https://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
|
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "http://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
|
||||||
while (true){
|
while (true){
|
||||||
int mCounter=0;
|
int mCounter=0;
|
||||||
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
|
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
|
||||||
|
|
|
@ -2,8 +2,10 @@ package com.darkweb.genesissearchengine.appManager.historyManager;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -29,7 +31,9 @@ import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import systems.intelligo.slight.ImageLoader;
|
import systems.intelligo.slight.ImageLoader;
|
||||||
|
|
||||||
|
@ -56,6 +60,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
||||||
private eventObserver.eventListener mEvent;
|
private eventObserver.eventListener mEvent;
|
||||||
private String mFilter = strings.GENERIC_EMPTY_STR;
|
private String mFilter = strings.GENERIC_EMPTY_STR;
|
||||||
private boolean mLongPressedMenuActive = false;
|
private boolean mLongPressedMenuActive = false;
|
||||||
|
private Map<String, Drawable> mWebIcon = new HashMap<>();
|
||||||
|
|
||||||
/*Local Variables*/
|
/*Local Variables*/
|
||||||
|
|
||||||
|
@ -273,6 +278,10 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onClearAdapter(){
|
||||||
|
mWebIcon.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
public void onSwipe(View pItemView, String pUrl, View pMenuItem, ImageView pLogoImage, int pId, Date pDate){
|
public void onSwipe(View pItemView, String pUrl, View pMenuItem, ImageView pLogoImage, int pId, Date pDate){
|
||||||
|
|
||||||
|
@ -473,7 +482,11 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
||||||
|
|
||||||
if(model.getDescription().contains("boogle.store") || model.getDescription().contains("genesis.onion")){
|
if(model.getDescription().contains("boogle.store") || model.getDescription().contains("genesis.onion")){
|
||||||
mFaviconLogo.setImageDrawable(itemView.getResources().getDrawable(R.drawable.genesis));
|
mFaviconLogo.setImageDrawable(itemView.getResources().getDrawable(R.drawable.genesis));
|
||||||
}else{
|
}
|
||||||
|
else if(mWebIcon.containsKey(model.getDescription())){
|
||||||
|
mFaviconLogo.setImageDrawable(mWebIcon.get(model.getDescription()));
|
||||||
|
}
|
||||||
|
else{
|
||||||
new Thread(){
|
new Thread(){
|
||||||
public void run(){
|
public void run(){
|
||||||
try {
|
try {
|
||||||
|
@ -482,19 +495,35 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
||||||
while (true){
|
while (true){
|
||||||
int mCounter=0;
|
int mCounter=0;
|
||||||
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
|
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
|
||||||
sleep(50);
|
sleep(10);
|
||||||
mCounter+=1;
|
mCounter+=1;
|
||||||
}else {
|
}else {
|
||||||
|
Log.i("BREAK","");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(mCounter>6){
|
if(mCounter>6){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mContext.runOnUiThread(() -> {
|
mContext.runOnUiThread(() -> {
|
||||||
Bitmap mBitmap = helperMethod.drawableToBitmap(mHindTypeIconTemp.getDrawable());
|
mFaviconLogo.setColorFilter(null);
|
||||||
mFaviconLogo.setImageBitmap(mBitmap);
|
mFaviconLogo.clearColorFilter();
|
||||||
|
mFaviconLogo.setImageTintList(null);
|
||||||
|
mFaviconLogo.setClipToOutline(true);
|
||||||
|
mWebIcon.put(model.getDescription(),mHindTypeIconTemp.getDrawable());
|
||||||
|
if(mHindTypeIconTemp.getDrawable() != null){
|
||||||
|
mFaviconLogo.setImageDrawable(mHindTypeIconTemp.getDrawable());
|
||||||
|
}else {
|
||||||
|
Resources res = itemView.getContext().getResources();
|
||||||
|
try {
|
||||||
|
mFaviconLogo.setImageDrawable(Drawable.createFromXml(res, res.getXml(R.xml.ic_baseline_browser)));
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@ import android.content.Intent;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
|
@ -62,7 +64,9 @@ import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@ -663,19 +667,37 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean createAndSaveFileFromBase64Url(String url) {
|
private void saveImage(Bitmap finalBitmap) {
|
||||||
|
|
||||||
if(!url.startsWith("data") && !url.startsWith("blob")){
|
String root = Environment.getExternalStorageDirectory().toString();
|
||||||
return false;
|
File myDir = new File(root + "/saved_images");
|
||||||
|
myDir.mkdirs();
|
||||||
|
|
||||||
|
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
|
||||||
|
String fname = "Shutta_"+ timeStamp +".jpg";
|
||||||
|
|
||||||
|
File file = new File(myDir, fname);
|
||||||
|
if (file.exists()) file.delete ();
|
||||||
|
try {
|
||||||
|
FileOutputStream out = new FileOutputStream(file);
|
||||||
|
finalBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
|
||||||
|
out.flush();
|
||||||
|
out.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
else if(url.startsWith("blob")){
|
}
|
||||||
Toast toast = Toast.makeText(mContext.get().getApplicationContext(),
|
|
||||||
"Unable to download urls that contain prefix blob. Not Supported",
|
|
||||||
Toast.LENGTH_SHORT);
|
|
||||||
|
|
||||||
toast.show();
|
/* Checks if external storage is available for read and write */
|
||||||
|
public boolean isExternalStorageWritable() {
|
||||||
|
String state = Environment.getExternalStorageState();
|
||||||
|
if (Environment.MEDIA_MOUNTED.equals(state)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean createAndSaveFileFromBase64Url(String url) {
|
||||||
|
|
||||||
try{
|
try{
|
||||||
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||||
|
@ -731,7 +753,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
String channel_id = createNotificationChannel(mContext.get().getApplicationContext());
|
String channel_id = createNotificationChannel(mContext.get().getApplicationContext());
|
||||||
assert channel_id != null;
|
assert channel_id != null;
|
||||||
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(mContext.get().getApplicationContext(), channel_id)
|
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(mContext.get().getApplicationContext(), channel_id)
|
||||||
.setSmallIcon(R.xml.ic_download)
|
.setSmallIcon(R.drawable.ic_download)
|
||||||
.setContentTitle(filename)
|
.setContentTitle(filename)
|
||||||
.setContentIntent(pIntent);
|
.setContentIntent(pIntent);
|
||||||
|
|
||||||
|
@ -741,7 +763,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
NotificationManager notificationManager = (NotificationManager) mContext.get().getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager notificationManager = (NotificationManager) mContext.get().getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
notificationManager.notify(notificationId, notificationBuilder.build());
|
notificationManager.notify(notificationId, notificationBuilder.build());
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ public class hintAdapter extends RecyclerView.Adapter<hintAdapter.listViewHolder
|
||||||
public void run(){
|
public void run(){
|
||||||
try {
|
try {
|
||||||
mHindTypeIconTemp.setImageDrawable(null);
|
mHindTypeIconTemp.setImageDrawable(null);
|
||||||
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "https://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
|
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "http://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
|
||||||
while (true){
|
while (true){
|
||||||
int mCounter=0;
|
int mCounter=0;
|
||||||
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
|
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
|
||||||
|
|
|
@ -846,7 +846,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
|
|
||||||
mEdittextChanged.removeCallbacks(postToServerRunnable);
|
mEdittextChanged.removeCallbacks(postToServerRunnable);
|
||||||
mSuggestions = (ArrayList<historyRowModel>)dataController.getInstance().invokeSuggestions(dataEnums.eSuggestionCommands.M_GET_SUGGESTIONS, Collections.singletonList(mText));
|
mSuggestions = (ArrayList<historyRowModel>)dataController.getInstance().invokeSuggestions(dataEnums.eSuggestionCommands.M_GET_SUGGESTIONS, Collections.singletonList(mText));
|
||||||
mEdittextChanged.postDelayed(postToServerRunnable, 150);
|
mEdittextChanged.postDelayed(postToServerRunnable, 350);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(mSuggestions.size()>0){
|
if(mSuggestions.size()>0){
|
||||||
|
@ -859,7 +859,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mSearchBarLoading = true;
|
mSearchBarLoading = true;
|
||||||
mEdittextChanged.postDelayed(postToServerRunnable, 0);
|
mEdittextChanged.postDelayed(postToServerRunnable, 0);
|
||||||
}else{
|
}else{
|
||||||
mEdittextChanged.postDelayed(postToServerRunnable, 150);
|
mEdittextChanged.postDelayed(postToServerRunnable, 350);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -952,7 +952,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
handler.postDelayed(() -> {
|
handler.postDelayed(() -> {
|
||||||
mSearchBarLoading = false;
|
mSearchBarLoading = false;
|
||||||
}, 150);
|
}, 350);
|
||||||
};
|
};
|
||||||
|
|
||||||
public void onSearchBarInvoked(View view){
|
public void onSearchBarInvoked(View view){
|
||||||
|
@ -1377,6 +1377,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_INIT_LOCALE);
|
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_INIT_LOCALE);
|
||||||
mHomeViewController.onUpdateSearchEngineBar(false, 0);
|
mHomeViewController.onUpdateSearchEngineBar(false, 0);
|
||||||
mNewTab.setPressed(false);
|
mNewTab.setPressed(false);
|
||||||
|
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||||
}
|
}
|
||||||
|
|
||||||
status.mThemeApplying = false;
|
status.mThemeApplying = false;
|
||||||
|
|
|
@ -206,7 +206,7 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
|
||||||
|
|
||||||
if(pQuery.length()>0){
|
if(pQuery.length()>0){
|
||||||
if(!pQuery.equals("about:blank")){
|
if(!pQuery.equals("about:blank")){
|
||||||
mCurrentList.add( mSize,new historyRowModel(pQuery, strings.GENERIC_EMPTY_STR,-1));
|
mCurrentList.add( 0,new historyRowModel(pQuery, strings.GENERIC_EMPTY_STR,-1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(mCurrentList.size()<=0) {
|
if(mCurrentList.size()<=0) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import android.app.NotificationManager;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
|
@ -53,10 +54,11 @@ class notifictionManager
|
||||||
private Notification getNotification () {
|
private Notification getNotification () {
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(mAppContext.get().getApplicationContext(), CONST_NOTIFICATION_ID_NAME) ;
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(mAppContext.get().getApplicationContext(), CONST_NOTIFICATION_ID_NAME) ;
|
||||||
builder.setContentTitle(CONST_NOTIFICATION_TITLE) ;
|
builder.setContentTitle(CONST_NOTIFICATION_TITLE) ;
|
||||||
builder.setSmallIcon(R.drawable.notification_logo);
|
builder.setSmallIcon(R.mipmap.ic_stat_tor_logo);
|
||||||
builder.setAutoCancel(true) ;
|
builder.setAutoCancel(true);
|
||||||
builder.setChannelId(CONST_NOTIFICATION_ID_NAME) ;
|
builder.setColor(Color.parseColor("#84989f"));
|
||||||
return builder.build() ;
|
builder.setChannelId(CONST_NOTIFICATION_ID_NAME);
|
||||||
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*External Triggers*/
|
/*External Triggers*/
|
||||||
|
|
|
@ -20,7 +20,7 @@ class orbotManager
|
||||||
|
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
|
|
||||||
private WeakReference<Context> mAppContext;
|
private WeakReference<AppCompatActivity> mAppContext;
|
||||||
private boolean mLogsStarted = false;
|
private boolean mLogsStarted = false;
|
||||||
|
|
||||||
/*Initialization*/
|
/*Initialization*/
|
||||||
|
@ -46,7 +46,7 @@ class orbotManager
|
||||||
orbotLocalConstants.mIsManualBridge = status.sBridgeGatewayManual;
|
orbotLocalConstants.mIsManualBridge = status.sBridgeGatewayManual;
|
||||||
orbotLocalConstants.mManualBridgeType = status.sBridgeCustomType;
|
orbotLocalConstants.mManualBridgeType = status.sBridgeCustomType;
|
||||||
Prefs.putBridgesEnabled(status.sBridgeStatus);
|
Prefs.putBridgesEnabled(status.sBridgeStatus);
|
||||||
Intent mServiceIntent = new Intent(mAppContext.get().getApplicationContext(), OrbotService.class);
|
Intent mServiceIntent = new Intent(mAppContext.get(), OrbotService.class);
|
||||||
mServiceIntent.setAction(ACTION_START);
|
mServiceIntent.setAction(ACTION_START);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
mAppContext.get().getApplicationContext().startForegroundService(mServiceIntent);
|
mAppContext.get().getApplicationContext().startForegroundService(mServiceIntent);
|
||||||
|
|
Before Width: | Height: | Size: 996 B |
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 511 B |
After Width: | Height: | Size: 523 B |
Before Width: | Height: | Size: 978 B After Width: | Height: | Size: 978 B |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 831 B |
|
@ -53,6 +53,5 @@ dependencies {
|
||||||
implementation 'com.offbynull.portmapper:portmapper:2.0.5'
|
implementation 'com.offbynull.portmapper:portmapper:2.0.5'
|
||||||
implementation 'info.guardianproject:jtorctl:0.4'
|
implementation 'info.guardianproject:jtorctl:0.4'
|
||||||
implementation 'com.github.tladesignz:IPtProxy:0.5.2'
|
implementation 'com.github.tladesignz:IPtProxy:0.5.2'
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,8 @@ import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
import IPtProxy.IPtProxy;
|
import IPtProxy.IPtProxy;
|
||||||
|
|
||||||
|
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||||
|
|
||||||
public class OrbotService extends VpnService implements TorServiceConstants, OrbotConstants {
|
public class OrbotService extends VpnService implements TorServiceConstants, OrbotConstants {
|
||||||
|
|
||||||
public final static String BINARY_TOR_VERSION = org.torproject.android.binary.TorServiceConstants.BINARY_TOR_VERSION;
|
public final static String BINARY_TOR_VERSION = org.torproject.android.binary.TorServiceConstants.BINARY_TOR_VERSION;
|
||||||
|
@ -195,7 +197,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showConnectedToTorNetworkNotification() {
|
private void showConnectedToTorNetworkNotification() {
|
||||||
showToolbarNotification(getString(R.string.status_activated), NOTIFY_ID, R.drawable.ic_stat_tor_logo);
|
showToolbarNotification(getString(R.string.status_activated), NOTIFY_ID, R.mipmap.ic_stat_tor_logo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean findExistingTorDaemon() {
|
private boolean findExistingTorDaemon() {
|
||||||
|
@ -262,7 +264,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
.setCategory(Notification.CATEGORY_SERVICE)
|
.setCategory(Notification.CATEGORY_SERVICE)
|
||||||
.setContentTitle("Genesis")
|
.setContentTitle("Genesis")
|
||||||
.setColor(Color.parseColor("#84989f"))
|
.setColor(Color.parseColor("#84989f"))
|
||||||
.setSmallIcon(R.drawable.ic_stat_tor_logo)
|
.setSmallIcon(R.mipmap.ic_stat_tor_logo)
|
||||||
.setOngoing(Prefs.persistNotifications());
|
.setOngoing(Prefs.persistNotifications());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,9 +272,13 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
if (conn != null) { // only add new identity action when there is a connection
|
if (conn != null) { // only add new identity action when there is a connection
|
||||||
Intent intentRefresh = new Intent(CMD_NEWNYM);
|
Intent intentRefresh = new Intent(CMD_NEWNYM);
|
||||||
PendingIntent pendingIntentNewNym = PendingIntent.getBroadcast(this, 0, intentRefresh, PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent pendingIntentNewNym = PendingIntent.getBroadcast(this, 0, intentRefresh, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
mNotifyBuilder.addAction(R.drawable.ic_refresh_white_24dp, getString(R.string.menu_new_identity), pendingIntentNewNym);
|
mNotifyBuilder.addAction(0, getString(R.string.menu_new_identity), pendingIntentNewNym);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Intent intentRefresh = new Intent(CMD_setting);
|
||||||
|
PendingIntent pendingIntentNewNym = PendingIntent.getBroadcast(this, 0, intentRefresh, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
mNotifyBuilder.addAction(0, "Notification Settings", pendingIntentNewNym);
|
||||||
|
|
||||||
mNotifyBuilder.setContentText(notifyMsg)
|
mNotifyBuilder.setContentText(notifyMsg)
|
||||||
.setSmallIcon(icon)
|
.setSmallIcon(icon)
|
||||||
.setTicker(notifyType != NOTIFY_ID ? notifyMsg : null);
|
.setTicker(notifyType != NOTIFY_ID ? notifyMsg : null);
|
||||||
|
@ -320,7 +326,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
public void onTaskRemoved(Intent rootIntent) {
|
public void onTaskRemoved(Intent rootIntent) {
|
||||||
Log.d(OrbotConstants.TAG, "task removed");
|
Log.d(OrbotConstants.TAG, "task removed");
|
||||||
Intent intent = new Intent(this, DummyActivity.class);
|
Intent intent = new Intent(this, DummyActivity.class);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,6 +518,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
|
|
||||||
IntentFilter filter = new IntentFilter();
|
IntentFilter filter = new IntentFilter();
|
||||||
filter.addAction(CMD_NEWNYM);
|
filter.addAction(CMD_NEWNYM);
|
||||||
|
filter.addAction(CMD_setting);
|
||||||
filter.addAction(CMD_ACTIVE);
|
filter.addAction(CMD_ACTIVE);
|
||||||
mActionBroadcastReceiver = new ActionBroadcastReceiver();
|
mActionBroadcastReceiver = new ActionBroadcastReceiver();
|
||||||
registerReceiver(mActionBroadcastReceiver, filter);
|
registerReceiver(mActionBroadcastReceiver, filter);
|
||||||
|
@ -1158,12 +1165,16 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void notificationSetting() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void newIdentity() {
|
public void newIdentity() {
|
||||||
if (conn != null) { // it is possible to not have a connection yet, and someone might try to newnym
|
if (conn != null) { // it is possible to not have a connection yet, and someone might try to newnym
|
||||||
new Thread() {
|
new Thread() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
int iconId = R.drawable.ic_stat_tor_logo;
|
int iconId = R.mipmap.ic_stat_tor_logo;
|
||||||
|
|
||||||
if (conn != null) {
|
if (conn != null) {
|
||||||
if (mCurrentStatus.equals(STATUS_ON) && Prefs.expandedNotifications())
|
if (mCurrentStatus.equals(STATUS_ON) && Prefs.expandedNotifications())
|
||||||
|
@ -1774,7 +1785,10 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
requestTorRereadConfig();
|
requestTorRereadConfig();
|
||||||
} else if (action.equals(CMD_NEWNYM)) {
|
} else if (action.equals(CMD_NEWNYM)) {
|
||||||
newIdentity();
|
newIdentity();
|
||||||
} else if (action.equals(CMD_ACTIVE)) {
|
} else if (action.equals(CMD_setting)) {
|
||||||
|
notificationSetting();
|
||||||
|
}
|
||||||
|
else if (action.equals(CMD_ACTIVE)) {
|
||||||
sendSignalActive();
|
sendSignalActive();
|
||||||
} else if (action.equals(CMD_SET_EXIT)) {
|
} else if (action.equals(CMD_SET_EXIT)) {
|
||||||
setExitNode(mIntent.getStringExtra("exit"));
|
setExitNode(mIntent.getStringExtra("exit"));
|
||||||
|
@ -1857,6 +1871,17 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onSettingRegister(){
|
||||||
|
try {
|
||||||
|
Intent intent = null;
|
||||||
|
intent = new Intent(this, Class.forName("com.darkweb.genesissearchengine.appManager.settingManager.notificationManager.settingNotificationController"));
|
||||||
|
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
getApplicationContext().startActivity(intent);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void disableNotification(){
|
public void disableNotification(){
|
||||||
if(mNotificationManager!=null){
|
if(mNotificationManager!=null){
|
||||||
mNotificationManager.cancel(NOTIFY_ID);
|
mNotificationManager.cancel(NOTIFY_ID);
|
||||||
|
@ -1867,12 +1892,12 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
|
|
||||||
public void enableTorNotificationNoBandwidth(){
|
public void enableTorNotificationNoBandwidth(){
|
||||||
orbotLocalConstants.mNotificationStatus = 1;
|
orbotLocalConstants.mNotificationStatus = 1;
|
||||||
showToolbarNotification("Connected to the Tor network", HS_NOTIFY_ID, R.drawable.ic_stat_tor_logo);
|
showToolbarNotification("Connected to the Tor network", HS_NOTIFY_ID, R.mipmap.ic_stat_tor_logo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification(){
|
public void enableNotification(){
|
||||||
orbotLocalConstants.mNotificationStatus = 1;
|
orbotLocalConstants.mNotificationStatus = 1;
|
||||||
showToolbarNotification(0+"kbps ⇣ / " +0+"kbps ⇡", HS_NOTIFY_ID, R.drawable.ic_stat_tor_logo);
|
showToolbarNotification(0+"kbps ⇣ / " +0+"kbps ⇡", HS_NOTIFY_ID, R.mipmap.ic_stat_tor_logo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ActionBroadcastReceiver extends BroadcastReceiver {
|
private class ActionBroadcastReceiver extends BroadcastReceiver {
|
||||||
|
@ -1882,6 +1907,10 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
newIdentity();
|
newIdentity();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CMD_setting: {
|
||||||
|
onSettingRegister();
|
||||||
|
break;
|
||||||
|
}
|
||||||
case CMD_ACTIVE: {
|
case CMD_ACTIVE: {
|
||||||
sendSignalActive();
|
sendSignalActive();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -92,11 +92,11 @@ public class TorEventHandler implements EventHandler, TorServiceConstants {
|
||||||
|
|
||||||
if (lastWritten > BW_THRESDHOLD || lastRead > BW_THRESDHOLD) {
|
if (lastWritten > BW_THRESDHOLD || lastRead > BW_THRESDHOLD) {
|
||||||
|
|
||||||
int iconId = R.drawable.ic_stat_tor_logo;
|
int iconId = R.mipmap.ic_stat_tor_logo;
|
||||||
|
|
||||||
if (read > 0 || written > 0){
|
if (read > 0 || written > 0){
|
||||||
if(orbotLocalConstants.mIsTorInitialized){
|
if(orbotLocalConstants.mIsTorInitialized){
|
||||||
iconId = R.drawable.ic_stat_tor_logo;
|
iconId = R.mipmap.ic_stat_tor_logo;
|
||||||
}else {
|
}else {
|
||||||
iconId = R.drawable.ic_stat_starting_tor_logo;
|
iconId = R.drawable.ic_stat_starting_tor_logo;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,7 @@ public interface TorServiceConstants {
|
||||||
// actions for internal command Intents
|
// actions for internal command Intents
|
||||||
String CMD_SIGNAL_HUP = "signal_hup";
|
String CMD_SIGNAL_HUP = "signal_hup";
|
||||||
String CMD_NEWNYM = "newnym";
|
String CMD_NEWNYM = "newnym";
|
||||||
|
String CMD_setting = "setting";
|
||||||
String CMD_SET_EXIT = "setexit";
|
String CMD_SET_EXIT = "setexit";
|
||||||
String CMD_ACTIVE = "ACTIVE";
|
String CMD_ACTIVE = "ACTIVE";
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 766 B |
After Width: | Height: | Size: 511 B |
After Width: | Height: | Size: 978 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.1 KiB |