From cb731a8034b6be9fa53db43b3cd9f0a3766d8465 Mon Sep 17 00:00:00 2001 From: msmannan00 Date: Mon, 19 Apr 2021 00:10:30 +0500 Subject: [PATCH] Bug FIxes Bug FIxes --- app/src/main/AndroidManifest.xml | 11 +++++ .../bookmarkManager/bookmarkAdapter.java | 2 +- .../historyManager/historyAdapter.java | 37 ++++++++++++-- .../geckoManager/geckoSession.java | 42 ++++++++++++---- .../homeManager/hintManager/hintAdapter.java | 2 +- .../homeController/homeController.java | 7 +-- .../dataManager/suggestionDataModel.java | 2 +- .../pluginManager/notifictionManager.java | 10 ++-- .../pluginManager/orbotManager.java | 4 +- .../res/drawable-hdpi/notification_logo.png | Bin 996 -> 0 bytes .../main/res/drawable-mdpi/genesis_logo.png | Bin .../res/drawable-mdpi/ic_genesis_logo.png | Bin 0 -> 523 bytes .../main/res/drawable-xhdpi/genesis_logo.png | Bin .../res/drawable-xhdpi/ic_genesis_logo.png | Bin 0 -> 1084 bytes .../main/res/drawable-xxhdpi/genesis_logo.png | Bin .../res/drawable-xxhdpi/ic_genesis_logo.png | Bin 0 -> 1930 bytes .../res/drawable-xxxhdpi/genesis_logo.png | Bin .../res/drawable-xxxhdpi/ic_genesis_logo.png | Bin 0 -> 2115 bytes .../main/res/mipmap-hdpi/ic_genesis_logo.png | Bin 0 -> 831 bytes orbotservice/build.gradle | 1 - .../android/service/OrbotService.java | 45 ++++++++++++++---- .../android/service/TorEventHandler.java | 4 +- .../android/service/TorServiceConstants.java | 1 + .../res/drawable-hdpi/ic_stat_tor_logo.png | Bin 766 -> 0 bytes .../main/res/mipmap-mdpi/ic_stat_tor_logo.png | Bin 0 -> 511 bytes .../res/mipmap-xhdpi/ic_stat_tor_logo.png | Bin 0 -> 978 bytes .../res/mipmap-xxhdpi/ic_stat_tor_logo.png | Bin 0 -> 1537 bytes .../res/mipmap-xxxhdpi/ic_stat_tor_logo.png | Bin 0 -> 2115 bytes 28 files changed, 131 insertions(+), 37 deletions(-) delete mode 100644 app/src/main/res/drawable-hdpi/notification_logo.png rename orbotservice/src/main/res/drawable-mdpi/ic_stat_tor_logo.png => app/src/main/res/drawable-mdpi/genesis_logo.png (100%) create mode 100644 app/src/main/res/drawable-mdpi/ic_genesis_logo.png rename orbotservice/src/main/res/drawable-xhdpi/ic_stat_tor_logo.png => app/src/main/res/drawable-xhdpi/genesis_logo.png (100%) create mode 100644 app/src/main/res/drawable-xhdpi/ic_genesis_logo.png rename orbotservice/src/main/res/drawable-xxhdpi/ic_stat_tor_logo.png => app/src/main/res/drawable-xxhdpi/genesis_logo.png (100%) create mode 100644 app/src/main/res/drawable-xxhdpi/ic_genesis_logo.png rename orbotservice/src/main/res/drawable-xxxhdpi/ic_stat_tor_logo.png => app/src/main/res/drawable-xxxhdpi/genesis_logo.png (100%) create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_genesis_logo.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_genesis_logo.png delete mode 100644 orbotservice/src/main/res/drawable-hdpi/ic_stat_tor_logo.png create mode 100644 orbotservice/src/main/res/mipmap-mdpi/ic_stat_tor_logo.png create mode 100644 orbotservice/src/main/res/mipmap-xhdpi/ic_stat_tor_logo.png create mode 100644 orbotservice/src/main/res/mipmap-xxhdpi/ic_stat_tor_logo.png create mode 100644 orbotservice/src/main/res/mipmap-xxxhdpi/ic_stat_tor_logo.png diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f408d141..690a16ab 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -84,6 +84,7 @@ android:windowSoftInputMode="adjustPan" /> + + + + mWebIcon = new HashMap<>(); /*Local Variables*/ @@ -273,6 +278,10 @@ public class historyAdapter extends RecyclerView.Adapter6){ break; } } + mContext.runOnUiThread(() -> { - Bitmap mBitmap = helperMethod.drawableToBitmap(mHindTypeIconTemp.getDrawable()); - mFaviconLogo.setImageBitmap(mBitmap); + mFaviconLogo.setColorFilter(null); + 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) { e.printStackTrace(); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java index cb49c0e3..c8802aa3 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java @@ -9,6 +9,8 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.graphics.Rect; import android.graphics.RectF; @@ -62,7 +64,9 @@ import java.io.IOException; import java.io.OutputStream; import java.lang.ref.WeakReference; import java.net.URLEncoder; +import java.text.SimpleDateFormat; import java.util.Arrays; +import java.util.Date; import java.util.List; 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")){ - return false; + String root = Environment.getExternalStorageDirectory().toString(); + 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 false; + } + + private boolean createAndSaveFileFromBase64Url(String url) { try{ 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()); assert channel_id != null; NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(mContext.get().getApplicationContext(), channel_id) - .setSmallIcon(R.xml.ic_download) + .setSmallIcon(R.drawable.ic_download) .setContentTitle(filename) .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.notify(notificationId, notificationBuilder.build()); - } catch (IOException e) { + } catch (Exception e) { e.printStackTrace(); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java index f4499558..86500968 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java @@ -183,7 +183,7 @@ public class hintAdapter extends RecyclerView.Adapter)dataController.getInstance().invokeSuggestions(dataEnums.eSuggestionCommands.M_GET_SUGGESTIONS, Collections.singletonList(mText)); - mEdittextChanged.postDelayed(postToServerRunnable, 150); + mEdittextChanged.postDelayed(postToServerRunnable, 350); return; } if(mSuggestions.size()>0){ @@ -859,7 +859,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mSearchBarLoading = true; mEdittextChanged.postDelayed(postToServerRunnable, 0); }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(); handler.postDelayed(() -> { mSearchBarLoading = false; - }, 150); + }, 350); }; 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); mHomeViewController.onUpdateSearchEngineBar(false, 0); mNewTab.setPressed(false); + pluginController.getInstance().onMessageManagerInvoke(null, M_RESET); } status.mThemeApplying = false; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java index fe74cf16..12d3d29a 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java @@ -206,7 +206,7 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess if(pQuery.length()>0){ 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) { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/notifictionManager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/notifictionManager.java index e769d571..65106f17 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/notifictionManager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/notifictionManager.java @@ -6,6 +6,7 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; +import android.graphics.Color; import android.os.SystemClock; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.NotificationCompat; @@ -53,10 +54,11 @@ class notifictionManager private Notification getNotification () { NotificationCompat.Builder builder = new NotificationCompat.Builder(mAppContext.get().getApplicationContext(), CONST_NOTIFICATION_ID_NAME) ; builder.setContentTitle(CONST_NOTIFICATION_TITLE) ; - builder.setSmallIcon(R.drawable.notification_logo); - builder.setAutoCancel(true) ; - builder.setChannelId(CONST_NOTIFICATION_ID_NAME) ; - return builder.build() ; + builder.setSmallIcon(R.mipmap.ic_stat_tor_logo); + builder.setAutoCancel(true); + builder.setColor(Color.parseColor("#84989f")); + builder.setChannelId(CONST_NOTIFICATION_ID_NAME); + return builder.build(); } /*External Triggers*/ diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java index e3692e81..04912183 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java @@ -20,7 +20,7 @@ class orbotManager /*Private Variables*/ - private WeakReference mAppContext; + private WeakReference mAppContext; private boolean mLogsStarted = false; /*Initialization*/ @@ -46,7 +46,7 @@ class orbotManager orbotLocalConstants.mIsManualBridge = status.sBridgeGatewayManual; orbotLocalConstants.mManualBridgeType = status.sBridgeCustomType; 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); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { mAppContext.get().getApplicationContext().startForegroundService(mServiceIntent); diff --git a/app/src/main/res/drawable-hdpi/notification_logo.png b/app/src/main/res/drawable-hdpi/notification_logo.png deleted file mode 100644 index 701eed46608944375b689260fe68eff36865dd66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 996 zcmVH~wfqvj4@P*&UKr65Z$dU2mWynOJ0_b!8rXRp3es${Oyri)-W*so7EFz~+4-^2I zK!7JF-&y3>bDT@hfud*)Nd%e{rPqNxzt=z`^El6?W-&YxV;Ae%%!l~r?X}Qy%u9e#20<)>E@ipx}b)FTFXvi4g6F(vPu$3 zxt7J_4ZK>;tI-7)DOjoTQ<%`2ExsVx{G<{|nHFQJfc*yk3eIiQ1^pCE*Z8ZI-FE;} z4NB7~FE*VDaMb1w;H5Eg2XukkLQK&3+qEm{0p|KKNJ1UBq|E)SCstXH{1M$CDGx)2 z9qcwZ?Hgc;mqGYFTX9%5@&bl6-pTs56Vi83VTmN!RjJ7!i5TFuVa}-Kg#I*lHXlmU z_^Ui}jokfSAj36?WnL%{>Xq#1O)XsFRru6iiXF$sHZwG6xsA+E!VB-&CeHPPX^v8HTV z&H-JPY`Y^ug9Q)w(|Api;vLUSNnGVFC3biL`yZl3Rv^TgGwEq^tC*zH1oH z;xpNXd{m_r)~&!f;1L@#`JM;10n?Og5q;%ar{MbJT0bp8qnjImnZQCO!q!M$9+-2A z24qm5+jkug=RMZ07$r{kQcs#;7?jQ)I;gb1Qm7NdQ6i1}6~!kGMe#0^e*Co7H6%x( zD1i>_zNc;g`F@{5G(=t|HpY@gG$6YysCn+ z{D*`1)fPib;qLsK_A+(pA)_%6GhPJc^ZBA^;etafz{AWtk_vVK3;y|ki2Vkf$N(gw S6%lv<00009;d+XHb^5lc5uEAf~7cY1zWT|~@Z59qr3(;KGJFR8MSOJ!NGWq;s!bwuIt|&-bS?AujBrAg?5mQ0y%kAR`o;EE@tZGO)1U6LPwEqjVSe z`FCVw0GZ94kavPxhXC}oVIjW}e)6UOvzp6xs0omy6QtN)nF6GRVoh^e=&~(~_jypS z*w9^hGcA$apa(M61o7&gg{)WEauhQ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Yn+JOna`o!Nwr7_FgpqaNwbptc*(0Fwh|}vXp5t? z&DyZJb1nn3y#c%WBh1pb^4z^39m~F&qZjEmeVDdlr)Ae_9iwsijSl%G8Tmz--dV?r zI8ArDx=Rkk{_0t*H@!zKlhVTuqMCnupY<9^J4P`o&v*P@rOZf1GLkOxFSo_xsP%-( QIRF3v07*qoM6N<$f}w|if&c&j literal 0 HcmV?d00001 diff --git a/orbotservice/src/main/res/drawable-xxxhdpi/ic_stat_tor_logo.png b/app/src/main/res/drawable-xxxhdpi/genesis_logo.png similarity index 100% rename from orbotservice/src/main/res/drawable-xxxhdpi/ic_stat_tor_logo.png rename to app/src/main/res/drawable-xxxhdpi/genesis_logo.png diff --git a/app/src/main/res/drawable-xxxhdpi/ic_genesis_logo.png b/app/src/main/res/drawable-xxxhdpi/ic_genesis_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ae5e1ad519baabf030447ee204bf4cd9e01f9940 GIT binary patch literal 2115 zcmV-J2)y@+P)M~qnMJ28YD;?V~!LZ1{z zW8ORGQ-H~#iH2b!=K-d1^DQ1ZXH0KgFEsBfaqfOAzcuAp6eY?!3h=xZP-j8;n83SS zXx?KezqAg}($8h%oko-V29PhnyC-0qpz=SFh;V_&Ie-TNe<$#M+w*)9Ef>!vne1Ue zfxsB;0q+VV-Y_-YS}1?DG)eAiiPr|WC&k470u*x{9ld2w62HCl#$ld+3g9-tErhW& z9@Y(3P=XDYh?x>kC-CS5_%MZ`Cwry*p@7qxTfL`*oO2Go{w{yhMrgkIfE}8C&N%^5eqX>I;rSgGDQ{BN&=!3S$n#nGHv*1Yn%@GhaGj}CXOl!CXTzP&)JACq z8)eQ;93f|Vl%E%goLwdnpYf(Y~QbXpOk~vG|91A*_Mh3v8 z^To!+eC3>|;ZUhf2RuIo--`iNXbhx|Elbrct&GP{mA`Vet2!hX%kU^A1B+B01+0imGiG;4456ri`OGiA7txAUy4ul_5mHs}S&uumLc>X)hq#c!mKE=?q{J ztzxl5v;i0R^#S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botservice/build.gradle index b4a3b569..3cf234ae 100755 --- a/orbotservice/build.gradle +++ b/orbotservice/build.gradle @@ -53,6 +53,5 @@ dependencies { implementation 'com.offbynull.portmapper:portmapper:2.0.5' implementation 'info.guardianproject:jtorctl:0.4' implementation 'com.github.tladesignz:IPtProxy:0.5.2' - testImplementation 'junit:junit:4.13.2' } diff --git a/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java b/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java index 9fb2873d..db244de3 100644 --- a/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java +++ b/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java @@ -90,6 +90,8 @@ import java.util.concurrent.TimeoutException; import IPtProxy.IPtProxy; +import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; + public class OrbotService extends VpnService implements TorServiceConstants, OrbotConstants { 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() { - 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() { @@ -262,7 +264,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb .setCategory(Notification.CATEGORY_SERVICE) .setContentTitle("Genesis") .setColor(Color.parseColor("#84989f")) - .setSmallIcon(R.drawable.ic_stat_tor_logo) + .setSmallIcon(R.mipmap.ic_stat_tor_logo) .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 Intent intentRefresh = new Intent(CMD_NEWNYM); 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) .setSmallIcon(icon) .setTicker(notifyType != NOTIFY_ID ? notifyMsg : null); @@ -320,7 +326,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb public void onTaskRemoved(Intent rootIntent) { Log.d(OrbotConstants.TAG, "task removed"); Intent intent = new Intent(this, DummyActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.addFlags(FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } @@ -512,6 +518,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb IntentFilter filter = new IntentFilter(); filter.addAction(CMD_NEWNYM); + filter.addAction(CMD_setting); filter.addAction(CMD_ACTIVE); mActionBroadcastReceiver = new ActionBroadcastReceiver(); registerReceiver(mActionBroadcastReceiver, filter); @@ -1158,12 +1165,16 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb } } + public void notificationSetting() { + + } + public void newIdentity() { if (conn != null) { // it is possible to not have a connection yet, and someone might try to newnym new Thread() { public void run() { try { - int iconId = R.drawable.ic_stat_tor_logo; + int iconId = R.mipmap.ic_stat_tor_logo; if (conn != null) { if (mCurrentStatus.equals(STATUS_ON) && Prefs.expandedNotifications()) @@ -1774,7 +1785,10 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb requestTorRereadConfig(); } else if (action.equals(CMD_NEWNYM)) { newIdentity(); - } else if (action.equals(CMD_ACTIVE)) { + } else if (action.equals(CMD_setting)) { + notificationSetting(); + } + else if (action.equals(CMD_ACTIVE)) { sendSignalActive(); } else if (action.equals(CMD_SET_EXIT)) { setExitNode(mIntent.getStringExtra("exit")); @@ -1857,6 +1871,17 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb 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(){ if(mNotificationManager!=null){ mNotificationManager.cancel(NOTIFY_ID); @@ -1867,12 +1892,12 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb public void enableTorNotificationNoBandwidth(){ 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(){ 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 { @@ -1882,6 +1907,10 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb newIdentity(); break; } + case CMD_setting: { + onSettingRegister(); + break; + } case CMD_ACTIVE: { sendSignalActive(); break; diff --git a/orbotservice/src/main/java/org/torproject/android/service/TorEventHandler.java b/orbotservice/src/main/java/org/torproject/android/service/TorEventHandler.java index cd141362..2f94f3bf 100755 --- a/orbotservice/src/main/java/org/torproject/android/service/TorEventHandler.java +++ b/orbotservice/src/main/java/org/torproject/android/service/TorEventHandler.java @@ -92,11 +92,11 @@ public class TorEventHandler implements EventHandler, TorServiceConstants { 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(orbotLocalConstants.mIsTorInitialized){ - iconId = R.drawable.ic_stat_tor_logo; + iconId = R.mipmap.ic_stat_tor_logo; }else { iconId = R.drawable.ic_stat_starting_tor_logo; } diff --git a/orbotservice/src/main/java/org/torproject/android/service/TorServiceConstants.java b/orbotservice/src/main/java/org/torproject/android/service/TorServiceConstants.java index e69d8ba6..d37fdacb 100755 --- a/orbotservice/src/main/java/org/torproject/android/service/TorServiceConstants.java +++ b/orbotservice/src/main/java/org/torproject/android/service/TorServiceConstants.java @@ -103,6 +103,7 @@ public interface TorServiceConstants { // actions for internal command Intents String CMD_SIGNAL_HUP = "signal_hup"; String CMD_NEWNYM = "newnym"; + String CMD_setting = "setting"; String CMD_SET_EXIT = "setexit"; String CMD_ACTIVE = "ACTIVE"; diff --git a/orbotservice/src/main/res/drawable-hdpi/ic_stat_tor_logo.png b/orbotservice/src/main/res/drawable-hdpi/ic_stat_tor_logo.png deleted file mode 100644 index ee9992fa73a01b1fa79649c916ceec1da3b14392..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmVb@(EqUQhOjEu}9_EP$ zGLt6ag%?Um%rMtSN=8f?8pQG6wI-)EYn`+Awaeua@z4ki)yU#l7tbJ0c|K{0( zASeUNKs&ew2EZpU0*1kJa03*;3ge%YkV?=3o&|0;2o8d*Z$VSR&7d^vHh(CIRhk4k z9fbS>$3fc1#V3Pl%Gf^eBSy?O&=m2*?@AszyEGO9h()Ba%fvjt!XsxCU)*DI2P4% zVC;2VE*hsE!ReGmCC;(qxiS88Xl1$eaK{e8=?$3Zxyd`AEcGwjZ{ilPw&_;s!~g&Q07*qoM6N<$g7`dSjQ{`u diff --git a/orbotservice/src/main/res/mipmap-mdpi/ic_stat_tor_logo.png b/orbotservice/src/main/res/mipmap-mdpi/ic_stat_tor_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..841491325dda3c5bd72fac22e1d416e0a97d990d GIT binary patch literal 511 zcmVaqW1|QbYOp>K3r%Gu7B-eq(9Q=*D<}lCQ&C9p zg_uedgv2L?od1OhjN|Ryc@|mt6*te@y_wnb`D(dL(~N>?um|qID|iF(A34Q=#e+k$LHb8{Q!eG-PcnZ`ryC7Hr9lGEla7NBK(8Y9q5C`2v zpOP_sBRC}AQ_CZRFe%>f2@JZ}wMuv?e3Q~B23{>G02t4z|%zmHAKfoAO(L0kD zc!Dxh%rSWnxUor~3L(zqIToj^OJInzZU$M41bJ0K!uDL3fFIGCrbm|9^Sta}JlBDu z?ugP%aVsmvR|_y%zsfg z?9^;uwYYRtPXxu}90n~+768ZEVMj*oB9NbMGn1O=il{bJO8EC`$F(M*;V`4ri0Jov zo3)8ip23(1-8L8HBynr#}54vL~HtI@(u3XD0#6LaaI5T002ovPDHLkV1l9r B<3|7h literal 0 HcmV?d00001 diff --git a/orbotservice/src/main/res/mipmap-xhdpi/ic_stat_tor_logo.png b/orbotservice/src/main/res/mipmap-xhdpi/ic_stat_tor_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..08161fcc99d3ba6a670c7116f9dd64d70669a3f2 GIT binary patch literal 978 zcmV;@115Xb#QL(P}yAt*qsE`PH4vNUEtU$}2 z)Osp1D}(AKGAffwThl(!-TntASeJ8W&bfQ{E`7Ve%iXXc)dnKL&bVOstJ357y4 zKp8j=Zh_}u5R4F?zzfh08bKwwq|1A+#y5tJy$K`l5)Bnvv0 zf_Gu#DjPQ08lOi2C{mQNGqF0ip|=_YG~+5;7T74dCoF^8UPn^sI{+q_F*{8a)fjHX zK9K8y;mP2v;g~fh0qUv6Y4QQAjKcU#%AHI_*_OyDEO&99kAbZ&jL!v+U5r=GDZS=0 zqE3Q(_U%j^XE}K9a;#QvI>)2TYc7Fw!FYANeve`dWn-pJaV679#el=~E6D>e+aanS zqS=x}a|?FuP>=j542f4#w5 z-w>8ca5L4RbKoV@p)jKDEYR(t18PGri)jCbY5z*+K!92QX`1$F;DQGZsHAP4rhO;l zz^KjvCmAwGw&gViwl@K!;b)71h4uiU*G=>gb5ge#+nzk{f(=MNk&lhs8F~_0+{7accmVn4_c+T>863tw*P$n65xi7t8;jHoGP8*J$MSWa~+xF1D@p;@YU$9k=v z_TckUQ9?X~>N{S1BkMLThJfc~93lqjSqnwkVyT8YE&q!A0W|-j#S{Jg_5c6?07*qoM6N<$f*#<^ AbpQYW literal 0 HcmV?d00001 diff --git a/orbotservice/src/main/res/mipmap-xxhdpi/ic_stat_tor_logo.png b/orbotservice/src/main/res/mipmap-xxhdpi/ic_stat_tor_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..0edd077babd129e10ad36eb9a02f59e9687f7e75 GIT binary patch literal 1537 zcmV+c2LAbpP)FQn#x>3l=djcWfW;+S}>@nj5H?1Ff~cCvVth3CTL@d%&AN)$I_%x zi=i@Tu`G*<0!JOqFtlv3O_QwY_MPTPukm%?J$HHY-t-^%K!*RGbKdvvJNKM(@3l}U zN>PeZl>d<^r3L_(0Cxh*fVDs)@HMb2g3Z7>U{E^K1wuKLYcCQ}aa3iNI3e50#$K%vzHRqTuA2{28Pz?*Yf=Wft{i zhtrbhfbMyVLEV5Qfr)7b?gl#MHBff|?g$i*eg!7Am!8>vo-SK4d^j`X<_H6*;@?}2kO6eoKC^#-472Oq{}8h!@*ff;RGZNq+l z;3GqyZ*Vm>2-qWx6^{X>ZA8upV28k83fco*46d|XZK!bUoiaIB0DCQbt#?_{U3xd0 zfMF>RLo3y-4%s?A<2W0`Z+S@SXi2RMNRCa)5GQX)4UhI%7VPIhU*egZqv*jr_LD|Q zjMoJyE+6+5ys0tfsceZ#ovHEOTuy|LHLeL7#$OEl6u>un<|9lTm>jr=(`1wCb1pOD(3xD7Djv^Wum6Cl*e=jo_AP1?$P*j46wyg_m{wMj(ZXrp(ALzK+*WfxQ@VG+#?nTZjC=9 zEy?)+IG%M(5ssa%BWQsj;vW_>{wj-f-#0eEG*nWX5LoH0eV8Ia6pXLd=&2VFv`P11raKR}87$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