Bug Fixes

Bug Fixes
master
msmannan00 2021-03-23 16:52:22 +05:00
parent 2cb59f8d0d
commit ea74b226c2
65 changed files with 747 additions and 356 deletions

View File

@ -130,6 +130,7 @@ dependencies {
// Android Support Repository dependencies
androidTestImplementation 'junit:junit:4.13.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.preference:preference:1.1.1'
@ -183,7 +184,6 @@ dependencies {
/*Helper Libraries*/
implementation 'com.chauthai.overscroll:overscroll-bouncy:0.1.1'
androidTestImplementation 'junit:junit:4.13.2'
implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
implementation 'com.android.support:design:28.0.0'
implementation "org.mozilla.components:browser-icons:9.0.0"
@ -194,10 +194,12 @@ dependencies {
/*Image Cache Libraries*/
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.github.intelligo-systems:slight:1.1.3'
implementation "org.mozilla.components:concept-fetch:70.0.5"
implementation "org.mozilla.components:concept-base:70.0.9"
implementation "org.mozilla.components:concept-fetch:73.0.9"
implementation "org.mozilla.components:concept-base:73.0.9"
implementation 'com.coolerfall:android-http-download-manager:1.6.3'
implementation "org.mozilla.components:support-utils:73.0.9"
}

View File

@ -45,8 +45,9 @@
<input type="hidden" size="32" value="1" name="p_num" />
<input type="hidden" size="32" value="all" name="s_type" />
<div class="hi_search__button-container gs-disable-highlight">
<input type="submit" class="hi_search__search-button hi_search__search-button--left-spacing" id="hi_search_button" value="Genesis Search">
<input type="submit" class="hi_search__search-button" id="hi_lucky_button" value="Feeling Lucky">
<input type="hidden" class="hi_search__search-button hi_search__search-button--left-spacing" id="hi_search_button" value="Genesis Search">
<input type="hidden" class="hi_search__search-button" id="hi_lucky_button" value="Feeling Lucky">
<br>
</div>

View File

@ -45,8 +45,9 @@
<input type="hidden" size="32" value="1" name="p_num" />
<input type="hidden" size="32" value="all" name="s_type" />
<div class="hi_search__button-container gs-disable-highlight">
<input type="submit" class="hi_search__search-button hi_search__search-button--left-spacing" id="hi_search_button" value="Genesis Search">
<input type="submit" class="hi_search__search-button" id="hi_lucky_button" value="Feeling Lucky">
<input type="hidden" class="hi_search__search-button hi_search__search-button--left-spacing" id="hi_search_button" value="Genesis Search">
<input type="hidden" class="hi_search__search-button" id="hi_lucky_button" value="Feeling Lucky">
<br>
</div>

View File

@ -218,6 +218,12 @@
font-size: 14px;
}
@media only screen and (max-width: 943px) {
#hi_search__search-button {
visibility: hidden;
}
}
@media only screen and (max-width: 943px) {
#hi_search_button {
font-size: 13px;

View File

@ -29,6 +29,12 @@
}
}
@media only screen and (max-width: 943px) {
#hi_search__search-button {
visibility: hidden;
}
}
.hi_logo_text{
max-width: 450px;
width: 90%;

View File

@ -21,6 +21,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -62,6 +63,8 @@ public class bridgeController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
public void initializeAppModel()

View File

@ -22,6 +22,7 @@ import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -63,6 +64,8 @@ public class helpController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void initializeAppModel()

View File

@ -36,6 +36,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -87,6 +88,8 @@ public class historyController extends AppCompatActivity
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
public void initializeListModel(){

View File

@ -29,6 +29,7 @@ import org.mozilla.geckoview.ContentBlocking;
import org.mozilla.geckoview.GeckoRuntime;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.WebResponse;
public class geckoClients
{
@ -143,6 +144,7 @@ public class geckoClients
return status.sSettingCookieStatus;
}
@SuppressLint("WrongConstant")
public void updateSetting(){
mRuntime.getSettings().setRemoteDebuggingEnabled(false);
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
@ -256,6 +258,10 @@ public class geckoClients
}
}
public boolean wasPreviousErrorPage(){
return mSession.wasPreviousErrorPage();
}
public boolean canGoForward(){
return mSession.canGoForward();
}
@ -342,10 +348,12 @@ public class geckoClients
{
if (e_type.equals(on_handle_external_intent))
{
GeckoSession.WebResponseInfo responseInfo = (GeckoSession.WebResponseInfo)data.get(0);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndTypeAndNormalize(Uri.parse(responseInfo.uri), responseInfo.contentType);
context.startActivity(intent);
try {
WebResponse responseInfo = (WebResponse)data.get(0);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndTypeAndNormalize(Uri.parse(responseInfo.uri), responseInfo.headers.get("Content-Type"));
context.startActivity(intent);
}catch (Exception ignored){}
} else
{
return event.invokeObserver(data, e_type);

View File

@ -3,6 +3,8 @@ package com.darkweb.genesissearchengine.appManager.homeManager.geckoManager;
import android.Manifest;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.util.Log;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
@ -10,8 +12,12 @@ import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.WebResponse;
import java.util.Arrays;
import mozilla.components.support.utils.DownloadUtils;
class geckoDownloadManager
{
private Uri downloadURL;
@ -21,7 +27,7 @@ class geckoDownloadManager
}
void downloadFile(GeckoSession.WebResponseInfo response, geckoSession session, AppCompatActivity context, eventObserver.eventListener event) {
void downloadFile(WebResponse response, geckoSession session, AppCompatActivity context, eventObserver.eventListener event) {
session
.getUserAgent()
.accept(userAgent -> downloadFile(response, userAgent,context,session,event),
@ -30,7 +36,7 @@ class geckoDownloadManager
});
}
private void downloadFile(GeckoSession.WebResponseInfo response, String userAgent, AppCompatActivity context, geckoSession session, eventObserver.eventListener event) {
private void downloadFile(WebResponse response, String userAgent, AppCompatActivity context, geckoSession session, eventObserver.eventListener event) {
if (ContextCompat.checkSelfPermission(context,
Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(context,
@ -39,9 +45,14 @@ class geckoDownloadManager
return;
}
downloadURL = Uri.parse(response.uri);
downloadFile = response.filename != null ? response.filename : downloadURL.getLastPathSegment();
try{
String mFileName = DownloadUtils.guessFileName(response.headers.get("Content-Disposition"),"",response.uri,null);
downloadURL = Uri.parse(response.uri);
downloadFile = mFileName;
}catch (Exception ex){
ex.printStackTrace();
Log.i("sadsad",ex.getMessage());
}
event.invokeObserver(Arrays.asList(0,session.getSessionID()), enums.etype.progress_update);
event.invokeObserver(Arrays.asList(downloadFile.toString(),session.getSessionID(),downloadURL.toString()), enums.etype.download_file_popup);

View File

@ -21,6 +21,7 @@ import android.util.Base64;
import android.util.Log;
import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -48,8 +49,11 @@ import org.mozilla.geckoview.Autofill;
import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.SessionFinder;
import org.mozilla.geckoview.SlowScriptResponse;
import org.mozilla.geckoview.WebRequestError;
import org.mozilla.geckoview.WebResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@ -61,6 +65,8 @@ import java.util.Objects;
import javax.crypto.spec.SecretKeySpec;
import mozilla.components.support.utils.DownloadUtils;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE_DARK;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED;
@ -97,6 +103,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
private boolean mIsLoaded = false;
private boolean isFirstPaintExecuted = false;
private boolean mIsProgressBarChanging = false;
private Handler mFindHandler;
geckoSession(eventObserver.eventListener event,String mSessionID,AppCompatActivity mContext, GeckoView pGeckoView){
@ -145,6 +152,13 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
}else {
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.ON_FIRST_PAINT);
}
mFindHandler = new Handler();
mFindHandler.postDelayed(() ->
{
mContext.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER);
}, 1500);
}
void initURL(String url){
@ -356,9 +370,9 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.on_playstore_load);
return GeckoResult.fromValue(AllowOrDeny.DENY);
}
else if(var1.uri.equals(constants.CONST_GENESIS_DOMAIN_URL_SLASHED)){
else if(var1.uri.equals(constants.CONST_GENESIS_DOMAIN_URL_SLASHED) || var1.uri.startsWith("https://boogle.store/?")){
initURL(constants.CONST_GENESIS_DOMAIN_URL);
loadUri("resource://android/assets/Homepage/homepage.html");
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_LOAD_HOMEPAGE_GENESIS);
return GeckoResult.fromValue(AllowOrDeny.DENY);
}
else if(var1.uri.equals("about:blank") && mIsLoaded){
@ -389,7 +403,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_EXPAND_TOP_BAR);
/* Its Absence causes delay on first launch*/
if(mCurrentURL.contains("boogle.store")){
if(!mCurrentURL.contains("boogle.store")){
mProgress = 5;
event.invokeObserver(Arrays.asList(5, mSessionID, mCurrentURL), enums.etype.progress_update_forced);
}
@ -425,15 +439,25 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
/*Content Delegate*/
@UiThread
@Override
public void onExternalResponse(@NonNull GeckoSession session, @NonNull GeckoSession.WebResponseInfo response) {
public void onExternalResponse(@NonNull GeckoSession session, @NonNull WebResponse response) {
try {
event.invokeObserver(Arrays.asList(response,mSessionID), enums.etype.on_handle_external_intent);
if(response.headers.containsKey("Content-Disposition")){
mDownloadManager.downloadFile(response,this,mContext,event);
}else if(response.headers.containsKey("Content-Type")){
event.invokeObserver(Arrays.asList(response,mSessionID), enums.etype.on_handle_external_intent);
stop();
}
} catch (ActivityNotFoundException e) {
mDownloadManager.downloadFile(response,this,mContext,event);
event.invokeObserver(Arrays.asList(response,mSessionID), enums.etype.on_handle_external_intent);
stop();
}
}
@UiThread
public void onExternalResponse(@NonNull GeckoSession session, @NonNull GeckoSession.WebResponseInfo response){
}
@UiThread
public void onFirstContentfulPaint(@NonNull GeckoSession var1) {
isFirstPaintExecuted = true;
@ -713,6 +737,10 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
return mCanGoBack;
}
boolean wasPreviousErrorPage(){
return mPreviousErrorPage;
}
boolean canGoForward(){
return mCanGoForward;
}
@ -737,19 +765,35 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
event.invokeObserver(Arrays.asList(null,mSessionID), enums.etype.on_close_sesson);
}
GeckoResult<FinderResult> mFinder = null;
public void findInPage(String pQuery, int pDirection){
mFinder = null;
mFinder = getFinder().find(pQuery, pDirection);
new Thread(){
public void run(){
try {
FinderResult mFinder = getFinder().find(pQuery, pDirection).poll(600);
if(mFinder!=null){
event.invokeObserver(Arrays.asList(mFinder.total, mFinder.current), enums.etype.FINDER_RESULT_CALLBACK);
int mCounter=0;
while (mFinder==null){
try {
mCounter+=1;
sleep(100);
if(mCounter>10){
return;
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
try {
FinderResult mResult = mFinder.poll();
event.invokeObserver(Arrays.asList(mResult.total, mResult.current), enums.etype.FINDER_RESULT_CALLBACK);
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
}.start();
}
void goBackSession(){

View File

@ -24,7 +24,9 @@ import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class hintAdapter extends RecyclerView.Adapter<hintAdapter.listViewHolder>
{
@ -33,7 +35,7 @@ public class hintAdapter extends RecyclerView.Adapter<hintAdapter.listViewHolder
private ArrayList<historyRowModel> mHintList;
private AppCompatActivity mContext;
private eventObserver.eventListener mEvent;
private ImageView[] mWebIcon = new ImageView[15];
private Map<String, Drawable> mWebIcon = new HashMap<>();
public hintAdapter(ArrayList<historyRowModel> pHintList, eventObserver.eventListener pEvent, AppCompatActivity pContext, String pSearch) {
this.mHintList = new ArrayList();
@ -52,6 +54,10 @@ public class hintAdapter extends RecyclerView.Adapter<hintAdapter.listViewHolder
notifyDataSetChanged();
}
public void onClearAdapter(){
mWebIcon.clear();
}
/*Initializations*/
@NonNull @Override
@ -100,23 +106,17 @@ public class hintAdapter extends RecyclerView.Adapter<hintAdapter.listViewHolder
mHintWebIcon = itemView.findViewById(R.id.pHintWebIcon);
mHindTypeIconTemp = new ImageView(mContext);
if(getLayoutPosition() < mWebIcon.length){
if(mWebIcon[getLayoutPosition()]!=null){
mHintWebIcon = itemView.findViewById(R.id.pHintWebIcon);
mHintWebIcon.setImageDrawable(mWebIcon[getLayoutPosition()].getDrawable());
mHindTypeIconTemp.setImageDrawable(mWebIcon[getLayoutPosition()].getDrawable());
}
mWebIcon[getLayoutPosition()] = mHintWebIcon;
}
String mURLLink;
if(model.getDescription().equals(strings.GENERIC_EMPTY_STR)){
mHeaderSingle.setText(model.getHeader());
mURLLink = model.getHeader();
mHeaderSingle.setText(model.getHeader().replace("+"," ").replace("%", "+"));
mHeaderSingle.setVisibility(View.VISIBLE);
mHeader.setVisibility(View.GONE);
mURL.setVisibility(View.GONE);
mHintWebIcon.setVisibility(View.GONE);
mHindTypeIcon.setVisibility(View.VISIBLE);
}else {
mURLLink = model.getDescription();
mHeaderSingle.setVisibility(View.GONE);
mHeader.setVisibility(View.VISIBLE);
mURL.setVisibility(View.VISIBLE);
@ -124,6 +124,13 @@ public class hintAdapter extends RecyclerView.Adapter<hintAdapter.listViewHolder
mHindTypeIcon.setVisibility(View.GONE);
}
if(mWebIcon.containsKey(mURLLink)){
mHintWebIcon.setColorFilter(null);
mHintWebIcon.clearColorFilter();
mHintWebIcon.setImageTintList(null);
mHintWebIcon.setClipToOutline(true);
}
mHeader.setText(model.getHeader());
if(model.getDescription().equals(strings.GENERIC_EMPTY_STR)){
mMoveURL.setTag(model.getHeader());
@ -152,36 +159,45 @@ public class hintAdapter extends RecyclerView.Adapter<hintAdapter.listViewHolder
mpHintListener.setOnTouchListener(listViewHolder.this);
new Thread(){
public void run(){
try {
mHindTypeIconTemp.setImageDrawable(null);
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "https://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
while (true){
int mCounter=0;
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
sleep(50);
mCounter+=1;
}else {
Log.i("BREAK","");
break;
}
if(mCounter>6){
break;
if(mWebIcon.containsKey(mURLLink)){
mHintWebIcon.setImageDrawable(mWebIcon.get(mURLLink));
}
if(!mWebIcon.containsKey(mURLLink)){
new Thread(){
public void run(){
try {
mHindTypeIconTemp.setImageDrawable(null);
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "https://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
while (true){
int mCounter=0;
if(mHindTypeIconTemp.isAttachedToWindow() || mHindTypeIconTemp.getDrawable()==null){
sleep(10);
mCounter+=1;
}else {
Log.i("BREAK","");
break;
}
if(mCounter>6){
break;
}
}
mContext.runOnUiThread(() -> {
mHintWebIcon.setColorFilter(null);
mHintWebIcon.clearColorFilter();
mHintWebIcon.setImageTintList(null);
mHintWebIcon.setClipToOutline(true);
mHintWebIcon.setImageDrawable(mHindTypeIconTemp.getDrawable());
mWebIcon.put(mURLLink,mHindTypeIconTemp.getDrawable());
});
} catch (InterruptedException e) {
e.printStackTrace();
}
mContext.runOnUiThread(() -> {
mHintWebIcon.setColorFilter(null);
mHintWebIcon.clearColorFilter();
mHintWebIcon.setImageTintList(null);
mHintWebIcon.setClipToOutline(true);
mHintWebIcon.setImageDrawable(mHindTypeIconTemp.getDrawable());
});
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}.start();
}.start();
}
}
@SuppressLint("ClickableViewAccessibility")

View File

@ -18,6 +18,7 @@ import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.speech.RecognizerIntent;
@ -267,12 +268,29 @@ public class homeController extends AppCompatActivity implements ComponentCallba
initSuggestionView(new ArrayList<>(), strings.GENERIC_EMPTY_STR);
}
public void onLoadTabFromTabController(){
Object mTempModel = dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(mTempModel!=null){
tabRowModel model = (tabRowModel)mTempModel;
mGeckoView.releaseSession();
mGeckoClient.initSession(model.getSession());
mGeckoView.setSession(model.getSession());
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(), false, false, false);
if(model.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.wasPreviousErrorPage() || model.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || model.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || model.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || model.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){
mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
}else {
mHomeViewController.updateBannerAdvertStatus(true, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
}
}
}
public void onLoadTabOnResume(){
Object mTempModel = dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(mTempModel!=null){
tabRowModel model = (tabRowModel)mTempModel;
if(!status.mThemeApplying){
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP1:",(String)model.getSession().getCurrentURL());
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(), false, false, false);
}
onLoadTab(model.getSession(),false,true);
@ -283,7 +301,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
initTabCount();
if(!status.mThemeApplying){
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP2:",(String)mGeckoClient.getSession().getCurrentURL());
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, false);
}
status.mThemeApplying = false;
@ -302,13 +319,18 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@SuppressLint("ClickableViewAccessibility")
private void initSuggestionView(ArrayList<historyRowModel> pList, String pSearch){
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
hintAdapter mAdapter = new hintAdapter(pList,new hintViewCallback(), this, pSearch);
layoutManager.setReverseLayout(true);
mHintListView.setAdapter(mAdapter);
mHintListView.setLayoutManager(new LinearLayoutManager(this));
mHintListView.setHasFixedSize(true);
mHintListView.setItemViewCacheSize(10);
mHintListView.setItemViewCacheSize(10);
mHintListView.setDrawingCacheEnabled(true);
mHintListView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
Objects.requireNonNull(mHintListView.getItemAnimator()).setChangeDuration(0);
Objects.requireNonNull(mHintListView.getItemAnimator()).setAddDuration(0);
findViewById(R.id.pSuggestionScroll).setOnTouchListener((v, event) -> {
if (MotionEvent.ACTION_DOWN == event.getAction()) {
@ -509,7 +531,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onLoadTab(geckoSession mTempSession, boolean isSessionClosed, boolean pExpandAppBar){
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false));
if(!isSessionClosed){
dataController.getInstance().invokeTab(dataEnums.eTabCommands.MOVE_TAB_TO_TOP, Collections.singletonList(mTempSession));
@ -533,20 +554,22 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateStatusBarTheme(mTempSession.getTheme(), false);
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP4:",(String)mGeckoClient.getSession().getCurrentURL());
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, false);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),true);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
mRenderedBitmap = mGeckoView.capturePixels();
if(pExpandAppBar){
mHomeViewController.expandTopBar();
}
if(mGeckoClient.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){
if(mGeckoClient.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){
mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
}else {
mHomeViewController.updateBannerAdvertStatus(true, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
}
mHomeViewController.onProgressBarUpdate(mGeckoClient.getSession().getProgress(),true);
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false));
}
/*-------------------------------------------------------USER EVENTS-------------------------------------------------------*/
@ -640,13 +663,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override
public void onTextChanged(CharSequence s, int start,int before, int count) {
if(mSearchbar.isFocused()){
if(!mSearchbar.isFocused()){
if(mFindText.getText().length()==0 && mGeckoClient!=null){
mGeckoClient.getSession().getFinder().clear();
mHomeViewController.onUpdateFindBarCount(0,0);
}else {
assert mGeckoClient != null;
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
}
}
}
@ -766,6 +790,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
isSuggestionChanged = false;
if(mHintListView!=null && mHintListView.getAdapter()!=null && mHintListView.getAdapter().getItemCount()>0){
mHomeViewController.onUpdateSearchEngineBar(false, 150);
((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onClearAdapter();
}
mHomeViewController.initSearchBarFocus(false, isKeyboardOpened);
if(!mGeckoClient.isLoading()){
@ -874,8 +899,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onHideLoadTabDialog();
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_RECENT_TAB, null);
if(model!=null && !mGeckoClient.getSession().getSessionID().equals(model.getSession().getSessionID())){
Log.i("FUCK::1","URL");
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(),false,false,true);
Log.i("FUCK::2","URL");
onLoadTab(model.getSession(), false,true);
Log.i("FUCK::3","url");
}
}
@ -928,7 +956,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView,false));
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,true);
mHomeViewController.progressBarReset();
mHomeViewController.onUpdateSearchBar(url,false,true, false);
mGeckoClient.initURL(url);
mGeckoClient.loadURL(url);
onSaveCurrentTab(mGeckoClient.getSession(),false);
@ -937,6 +964,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mAppBar.setTag(R.id.expandableBar,true);
initTabCount();
mHomeViewController.onUpdateSearchBar(url,false,true, false);
}
public void onNewTab(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){
@ -974,7 +1002,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
runOnUiThread(() -> {
activityContextManager.getInstance().getTabController().onInit();
mHomeViewController.onShowTabContainer();
overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
// overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
});
}
}
@ -1001,6 +1029,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onDisableTabViewController(){
onResume();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
mHomeViewController.onHideTabContainer();
activityContextManager.getInstance().getTabController().onExitAndClearBackup();
@ -1011,7 +1040,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onBackPressed(){
if(mTabFragment.getVisibility()==View.VISIBLE){
onResume();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
mHomeViewController.onHideTabContainer();
activityContextManager.getInstance().getTabController().onPostExit();
activityContextManager.getInstance().getTabController().onBackPressed();
@ -1024,10 +1053,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
else if(mSearchEngineBar.getVisibility() == View.VISIBLE){
mHomeViewController.onUpdateSearchEngineBar(false, 150);
((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onClearAdapter();
}
else if(!mGeckoClient.getFullScreenStatus()){
mGeckoClient.onExitFullScreen();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
}
else {
mGeckoClient.onBackPressed(true);
@ -1102,7 +1132,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
if(mTabFragment.getVisibility()==View.VISIBLE){
onResume();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
mHomeViewController.onHideTabContainer();
activityContextManager.getInstance().getTabController().onPostExit();
activityContextManager.getInstance().getTabController().onBackPressed();
@ -1110,7 +1140,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
mGeckoClient.onExitFullScreen();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
pluginController.getInstance().onNotificationInvoke(Collections.singletonList(1296000000) /* Every 15 Days */ , pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION);
}
@ -1163,6 +1193,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoView.releaseSession();
mGeckoView.requestFocus();
mGeckoView.setSession(model.getSession());
/*If error page at background session tab it will not load unless click | Issue with actual firefox app too*/
if(mGeckoClient.wasPreviousErrorPage()){
mHomeViewController.performDummyClick();
}
}
}
}
@ -1171,6 +1206,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
super.onResume();
}
public void onLoadTabOnClear(){
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model==null){
onNewIntent(getIntent());
onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
}
}
public void OnClearSuggestion(View view){
mSearchbar.clearFocus();
}
@ -1308,7 +1351,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onFindNext(View view){
mFindCount.setText("0/0");
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
}
@ -1319,7 +1361,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onFindPrev(View view){
mFindCount.setText("0/0");
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_BACKWARDS & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
}
@ -1371,13 +1412,18 @@ public class homeController extends AppCompatActivity implements ComponentCallba
{
activityContextManager.getInstance().getTabController().onInit();
mHomeViewController.onShowTabContainer();
overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
// overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out);
}
else if (menuId == R.id.pMenuOpenNewTab)
{
helperMethod.hideKeyboard(this);
helperMethod.openActivity(bookmarkController.class,constants.CONST_LIST_BOOKMARK, homeController.this,true);
}
else if (menuId == R.id.menu28)
{
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT);
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_NEW_IDENTITY);
}
else if (menuId == R.id.pMenuOpenCurrentTab)
{
helperMethod.hideKeyboard(this);
@ -1488,6 +1534,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
{
onOpenDownloadFolder(null);
}
else if(e_type.equals(enums.etype.M_UPDATE_THEME))
{
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
}
else if(e_type.equals(enums.etype.ON_UPDATE_THEME)){
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
}
@ -1591,6 +1641,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(!isSuggestionSearchOpened){
if(mHintListView!=null && mHintListView.getAdapter()!=null && mHintListView.getAdapter().getItemCount()>0){
mHomeViewController.onUpdateSearchEngineBar(false, 150);
((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onClearAdapter();
}
mHomeViewController.initSearchBarFocus(false, isKeyboardOpened);
if(!mGeckoClient.isLoading()){
@ -1635,6 +1686,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
else if(e_type.equals(enums.etype.progress_update)){
mHomeViewController.onProgressBarUpdate((int)data.get(0), false);
}
else if(e_type.equals(enums.etype.M_LOAD_HOMEPAGE_GENESIS)){
onLoadURL(helperMethod.getDomainName(constants.CONST_BACKEND_GENESIS_URL));
}
else if(e_type.equals(enums.etype.progress_update_forced)){
Log.i("SUPPPP7:",(String)data.get(2));
mHomeViewController.onUpdateSearchBar((String) data.get(2), false, true, false);
@ -1701,7 +1755,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
else if(e_type.equals(enums.etype.on_full_screen)){
boolean status = (Boolean)data.get(0);
mHomeViewController.onFullScreenUpdate(status);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),true);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
}
else if(e_type.equals(enums.etype.on_update_favicon)){
dataController.getInstance().invokeImage(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL,Collections.singletonList((String)data.get(0)));
@ -1716,7 +1770,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_URL);
}
else if(e_type.equals(enums.etype.open_new_tab)){
postNewLinkTabAnimationInBackgroundTrigger(dataToStr(data.get(0)));
postNewLinkTabAnimation(dataToStr(data.get(0)));
}
else if(e_type.equals(enums.etype.on_close_sesson)){
if(!onCloseCurrentTab(mGeckoClient.getSession())){

View File

@ -19,6 +19,7 @@ import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.text.method.MovementMethod;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@ -47,6 +48,10 @@ import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.widget.progressBar.AnimatedProgressBar;
import com.example.myapplication.R;
import com.google.android.gms.ads.AdView;
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
import org.mozilla.geckoview.GeckoView;
import org.torproject.android.service.wrapper.orbotLocalConstants;
import java.util.ArrayList;
@ -75,7 +80,6 @@ class homeViewController
private AnimatedProgressBar mProgressBar;
private editTextManager mSearchbar;
private ConstraintLayout mSplashScreen;
private ImageView mLoading;
private TextView mLoadingText;
private AdView mBannerAds = null;
private Handler mUpdateUIHandler = null;
@ -116,7 +120,6 @@ class homeViewController
this.mProgressBar = progressBar;
this.mSearchbar = searchbar;
this.mSplashScreen = splashScreen;
this.mLoading = loading;
this.mLoadingText = loadingText;
this.mWebviewContainer = webviewContainer;
this.mBannerAds = banner_ads;
@ -156,6 +159,7 @@ class homeViewController
}
public void initializeViews(){
mSearchbar.setTag(R.id.msearchbarProcessing,false);
mNestedScroll.setNestedScrollingEnabled(true);
this.mBlockerFullSceen.setVisibility(View.GONE);
mSearchBarMovementMethod = mSearchbar.getMovementMethod();
@ -219,28 +223,41 @@ class homeViewController
public void onShowTabContainer(){
if(mTabFragment.getAlpha()==0 || mTabFragment.getAlpha()==1){
mTabFragment.setAlpha(0);
mTabFragment.setTranslationY(0);
mTabFragment.setVisibility(View.VISIBLE);
mTabFragment.setTranslationY(-1 * helperMethod.pxFromDp(15));
mTabFragment.animate()
.setDuration(250)
.translationY(0)
.alpha(1f);
new Handler().postDelayed(() ->
{
mTabFragment.setLayerType(View.LAYER_TYPE_HARDWARE, null);
mTabFragment.animate().withLayer()
.setDuration(250)
.translationY(0)
.alpha(1f)
.withEndAction(
() -> mTabFragment.setLayerType(View.LAYER_TYPE_NONE, null)
).start();
}, 10);
}
}
public void onHideTabContainer(){
if(mTabFragment.getAlpha()==1){
mTabFragment.animate()
.setDuration(250)
.setDuration(150)
.alpha(0f).withEndAction(() -> mTabFragment.setVisibility(View.GONE));
mEvent.invokeObserver(Collections.singletonList(status.sSettingSearchStatus), enums.etype.M_INIT_TAB_COUNT);
mEvent.invokeObserver(null, enums.etype.M_UPDATE_THEME);
}
}
public int getSearchLogo(){
switch (status.sSettingSearchStatus) {
case constants.CONST_BACKEND_GENESIS_URL:
return R.drawable.ic_genesis_vector;
return R.drawable.genesis;
case constants.CONST_BACKEND_GOOGLE_URL:
return R.drawable.google;
case constants.CONST_BACKEND_DUCK_DUCK_GO_URL:
@ -252,6 +269,17 @@ class homeViewController
}
}
public static void initImageLoader(Context context) {
ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
config.threadPriority(Thread.NORM_PRIORITY - 2);
config.denyCacheImageMultipleSizesInMemory();
config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
config.tasksProcessingOrder(QueueProcessingType.LIFO);
config.writeDebugLogs(); // Remove for release app
ImageLoader.getInstance().init(config.build());
}
@SuppressLint("UseCompatLoadingForDrawables")
public void onUpdateSearchIcon(int mStatus){
try {
@ -259,11 +287,16 @@ class homeViewController
mSearchLock.setColorFilter(null);
mSearchLock.clearColorFilter();
mSearchLock.setImageTintList(null);
mSearchLock.setImageDrawable(mContext.getResources().getDrawable(getSearchLogo()));
}
else if(mStatus==1){
mSearchLock.setColorFilter(ContextCompat.getColor(mContext, R.color.c_lock_tint));
mSearchLock.setImageDrawable(helperMethod.getDrawableXML(mContext,R.xml.ic_baseline_lock));
if(!(boolean)mSearchLock.getTag(R.id.themed)){
mSearchLock.setColorFilter(ContextCompat.getColor(mContext, R.color.c_lock_tint));
mSearchLock.setImageDrawable(helperMethod.getDrawableXML(mContext,R.xml.ic_baseline_lock));
}else {
mSearchLock.setImageDrawable(helperMethod.getDrawableXML(mContext,R.xml.ic_baseline_lock));
}
}
else if(mStatus==2){
mSearchLock.setColorFilter(ContextCompat.getColor(mContext, R.color.c_icon_tint));
@ -335,16 +368,15 @@ class homeViewController
mNewTab.animate().withLayer()
.rotationX(60)
.alpha(0.4f)
.setDuration(80)
.setDuration(120)
.withEndAction(
new Runnable() {
@Override public void run() {
// second quarter turn
mNewTab.setRotationX(-60);
mNewTab.animate().withLayer()
.rotationX(0)
.alpha(1)
.setDuration(100)
.setDuration(150)
.start();
}
}
@ -365,20 +397,18 @@ class homeViewController
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue));
}
}
//mContext.getWindow().getDecorView().setSystemUiVisibility(status.sTheme);
}
public void initStatusBarColor(boolean mInstant) {
animatedColor oneToTwo = new animatedColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.green_dark_v2));
int mDelay = 450;
int mDelay = 500;
if(status.mThemeApplying || mInstant){
mDelay = 0;
}
ValueAnimator animator = ObjectAnimator.ofFloat(0f, 1f);
animator.setDuration(350).setStartDelay(mDelay);
animator.setDuration(300).setStartDelay(mDelay);
animator.addUpdateListener(animation ->
{
float v = (float) animation.getAnimatedValue();
@ -466,6 +496,8 @@ class homeViewController
mIsAnimating = false;
mSearchbar.setEnabled(false);
helperMethod.hideKeyboard(mContext);
mSearchLock.setTag(R.id.themed,false);
mAppBar.setTag(R.id.expandableBar,true);
mSearchbar.setEnabled(false);
@ -697,6 +729,9 @@ class homeViewController
}
}
public void performDummyClick(){
}
void updateBannerAdvertStatus(boolean status, boolean pIsAdvertLoaded){
if(status && pIsAdvertLoaded){
if(mBannerAds.getAlpha()==0){
@ -720,11 +755,19 @@ class homeViewController
void onUpdateSearchBar(String url,boolean showProtocol, boolean pClearText, boolean pBypassFocus){
if(url.startsWith(CONST_GENESIS_URL_CACHED) || url.startsWith(CONST_GENESIS_URL_CACHED_DARK)){
mSearchbar.setTag(R.id.msearchbarProcessing,true);
url = CONST_GENESIS_DOMAIN_URL;
}
else if(url.startsWith(CONST_GENESIS_HELP_URL_CACHE) || url.startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){
mSearchbar.setTag(R.id.msearchbarProcessing,true);
url = CONST_GENESIS_HELP_URL;
}
else if(url.contains("genesis") || url.contains("boogle")){
mSearchbar.setTag(R.id.msearchbarProcessing,true);
}else {
mSearchbar.setTag(R.id.msearchbarProcessing,false);
}
Log.i("FUCK::5",url);
if(!mSearchbar.hasFocus() || pClearText || pBypassFocus){
int delay = 0;
handlerLocalUrl = url;
@ -738,7 +781,7 @@ class homeViewController
{
searchBarUpdateHandler.removeMessages(100);
triggerUpdateSearchBar(handlerLocalUrl,showProtocol, pClearText);
mSearchbar.setTag(R.id.msearchbarProcessing,false);
}, delay);
}
}
@ -746,7 +789,7 @@ class homeViewController
public void onUpdateFindBarCount(int index, int total)
{
if(total==0){
mFindCount.setText(strings.GENERIC_EMPTY_STR);
mFindCount.setText("0/0");
}else {
mFindCount.setText((total + "/" + index));
}
@ -754,7 +797,7 @@ class homeViewController
public void onUpdateStatusBarTheme(String pTheme, boolean mForced)
{
if(mSplashScreen.getAlpha()<=0 && (status.sTheme != enums.Theme.THEME_DARK && status.sDefaultNightMode)){
if(mSplashScreen.getAlpha()<=0 && (status.sTheme != enums.Theme.THEME_DARK && !status.sDefaultNightMode) && mTabFragment.getAlpha()<=0 || mForced){
int mColor = -1;
try{
mColor = Color.parseColor(pTheme);
@ -771,7 +814,6 @@ class homeViewController
GradientDrawable mGradientDrawable = new GradientDrawable();
mGradientDrawable.setColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.90f), Color.BLACK, 0.2f));
mGradientDrawable.setCornerRadius(helperMethod.pxFromDp(7));
mSearchbar.setBackground(mGradientDrawable);
GradientDrawable gradientDrawable1 = new GradientDrawable();
gradientDrawable1.setColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.90f), Color.BLACK, 0.2f));
@ -795,6 +837,10 @@ class homeViewController
mMenu.setColorFilter(helperMethod.invertedGrayColor(mColor));
mVoiceInput.setColorFilter(helperMethod.invertedGrayColor(mColor));
mVoiceInput.setBackground(mGradientDrawable);
mSearchLock.setColorFilter(helperMethod.invertedGrayColor(mColor));
mSearchLock.setTag(R.id.themed,true);
gradientDrawable1.setCornerRadius(helperMethod.pxFromDp(7));
mSearchbar.setBackground(gradientDrawable1);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mContext.getWindow().setStatusBarColor(Color.parseColor(pTheme));
@ -810,6 +856,7 @@ class homeViewController
}
}
else{
mSearchLock.setTag(R.id.themed,false);
mTopBar.setBackground(ContextCompat.getDrawable(mContext, R.color.c_background));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
@ -834,12 +881,13 @@ class homeViewController
mMenu.setColorFilter(ContextCompat.getColor(mContext, R.color.c_navigation_tint));
mVoiceInput.setColorFilter(ContextCompat.getColor(mContext, R.color.c_navigation_tint));
mSearchbar.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v1));
onUpdateSearchIcon(1);
if(status.sTheme != enums.Theme.THEME_DARK && !status.sDefaultNightMode){
mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}else {
View decorView = mContext.getWindow().getDecorView();
decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}else {
mContext.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
}
}
@ -852,14 +900,20 @@ class homeViewController
mFindBar.setVisibility(View.VISIBLE);
mFindBar.setAlpha(1);
mFindText.requestFocus();
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,0);
final Handler handler = new Handler();
handler.postDelayed(() ->
{
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,0);
}, 300);
}else {
mFindText.clearFocus();
mFindCount.setText(strings.GENERIC_EMPTY_STR);
helperMethod.hideKeyboard(mContext);
mFindBar.animate().alpha(0).withEndAction(() -> mFindBar.setVisibility(View.GONE));
mFindText.setText(strings.GENERIC_EMPTY_STR);
mFindBar.animate().alpha(0).withEndAction(() -> {
mFindCount.setText(strings.GENERIC_EMPTY_STR);
mFindText.setText(strings.GENERIC_EMPTY_STR);
mFindBar.setVisibility(View.GONE);
});
}
}
@ -948,7 +1002,7 @@ class homeViewController
}
void onProgressBarUpdate(int value, boolean mForced){
if(mSearchbar.getText().toString().equals("genesis.onion") && !mForced){
if(mSearchbar.getText().toString().equals("genesis.onion") && !mForced || (boolean)mSearchbar.getTag(R.id.msearchbarProcessing)){
mProgressBar.setProgress(0);
mProgressBar.setVisibility(View.GONE);
return;

View File

@ -22,6 +22,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -66,6 +67,8 @@ public class languageController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void initializeAppModel()
@ -163,7 +166,7 @@ public class languageController extends AppCompatActivity {
}
status.mThemeApplying = true;
//activityContextManager.getInstance().getHomeController().recreate();
activityContextManager.getInstance().getHomeController().recreate();
return true;
}

View File

@ -21,6 +21,7 @@ import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -67,6 +68,8 @@ public class orbotLogController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
public void viewsInitializations() {

View File

@ -23,6 +23,7 @@ import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -60,6 +61,8 @@ public class orbotController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
public void viewsInitializations() {

View File

@ -14,6 +14,7 @@ import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -49,6 +50,8 @@ public class proxyStatusController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
public void viewsInitializations() {

View File

@ -17,6 +17,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -59,6 +60,8 @@ public class settingAccessibilityController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void viewsInitializations() {

View File

@ -16,6 +16,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -53,6 +54,8 @@ public class settingAdvanceController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
public void viewsInitializations() {

View File

@ -22,6 +22,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -57,6 +58,8 @@ public class settingClearController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
public void viewsInitializations() {

View File

@ -20,6 +20,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -59,6 +60,8 @@ public class settingGeneralController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void viewsInitializations() {

View File

@ -16,6 +16,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -46,6 +47,8 @@ public class settingLogController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void viewsInitializations() {

View File

@ -15,6 +15,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -45,6 +46,8 @@ public class settingNotificationController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void viewsInitializations() {

View File

@ -17,6 +17,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -51,6 +52,8 @@ public class settingPrivacyController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void viewsInitializations() {

View File

@ -16,6 +16,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -47,6 +48,8 @@ public class settingSearchController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void viewsInitializations() {

View File

@ -26,6 +26,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -65,6 +66,8 @@ public class settingHomeController extends AppCompatActivity
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void viewsInitializations()

View File

@ -16,6 +16,7 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.helperManager.theme;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -47,6 +48,8 @@ public class settingTrackingController extends AppCompatActivity {
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
theme.getInstance().onConfigurationChanged(this);
}
private void viewsInitializations() {

View File

@ -4,6 +4,7 @@ import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -45,6 +46,7 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
tabAdapter(ArrayList<tabRowModel> pModelList, eventObserver.eventListener event) {
this.mModelList.clear();
this.mModelList.addAll(pModelList);
mModelList.add(new tabRowModel(null, null,null));
this.mEvent = event;
@ -178,9 +180,11 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
}
private void onTriggerURL(tabRowModel model){
mEvent.invokeObserver(Arrays.asList(model.getSession(), false), tabEnums.eTabAdapterCallback.ON_LOAD_TAB);
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_BACK_PRESSED);
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_INIT_TAB_COUNT);
if(model.getSession()!=null){
mEvent.invokeObserver(Arrays.asList(model.getSession(), false), tabEnums.eTabAdapterCallback.ON_LOAD_TAB);
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_BACK_PRESSED);
mEvent.invokeObserver(null, tabEnums.eTabAdapterCallback.ON_INIT_TAB_COUNT);
}
}
private int getSelectionSize(){
@ -238,6 +242,8 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
mItemSelectionMenuReference = itemView.findViewById(R.id.pRowContainer);
mBorder = itemView.findViewById(R.id.pBorder);
itemView.setClickable(true);
if(model.getmId()==null){
mItemSelectionMenu.setVisibility(View.VISIBLE);
mItemSelectionMenuButton.setOnClickListener(this);
@ -294,7 +300,6 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
mLoadSession.setOnClickListener(this);
}
mItemSelectionMenuReference.animate().cancel();
if(this.getLayoutPosition()==mModelList.size()-1){
if(mSelectedList.size()>0){
itemView.setVisibility(View.GONE);
@ -306,6 +311,9 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
mItemSelectionMenuButton.animate().setDuration(250).alpha(1);
}
}else {
if(model.getmId()!=null){
mItemSelectionMenuReference.animate().cancel();
}
itemView.setVisibility(View.VISIBLE);
mLongPressMenuEnabled = false;
mItemSelectionMenuButton.animate().setDuration(250).alpha(1);

View File

@ -1,6 +1,8 @@
package com.darkweb.genesissearchengine.appManager.tabManager;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Canvas;
import android.os.Bundle;
import android.os.Handler;
@ -8,6 +10,7 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
@ -110,6 +113,7 @@ public class tabController extends Fragment
return false;
});
}
public void initializeList(){
LinearLayoutManager layoutManager = new LinearLayoutManager(this.getContext());
tabAdapter adapter = new tabAdapter(mListModel.getList(),new adapterCallback());
@ -203,6 +207,7 @@ public class tabController extends Fragment
mRecycleView.animate().setDuration(350).alpha(0);
}
initTabCount(400);
activityContextManager.getInstance().getHomeController().onLoadTabFromTabController();
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.INIT_FIRST_ROW, null);
}
@ -213,17 +218,18 @@ public class tabController extends Fragment
mRecycleView.animate().setDuration(350).alpha(0).withEndAction(() -> {
mTabAdapter.notifyDataSetChanged();
});
activityContextManager.getInstance().getHomeController().onLoadTabFromTabController();
return false;
}else{
mTabAdapter.notifyItemRangeChanged(pIndex, mTabAdapter.getItemCount() - pIndex);
activityContextManager.getInstance().getHomeController().onLoadTabFromTabController();
return true;
}
}
public void initTabCount(int pDelay)
{
mtabViewController.onTrigger(tabEnums.eTabViewCommands.INIT_TAB_COUNT, Collections.singletonList(mListModel.getList().size()));
//mtabViewController.onTrigger(tabEnums.eTabViewCommands.INIT_TAB_COUNT, Collections.singletonList(mListModel.getList().size()));
final Handler handler = new Handler();
handler.postDelayed(() ->
{
@ -250,20 +256,28 @@ public class tabController extends Fragment
}
public void onRestoreTab(View view){
mPopupUndo.findViewById(R.id.pBlockerUndo).setVisibility(View.VISIBLE);
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG, null);
if(mRecycleView.getAlpha()==0){
initializeList();
mRecycleView.animate().cancel();
mRecycleView.setVisibility(View.VISIBLE);
mRecycleView.animate().setDuration(350).alpha(1);
}
ArrayList<tabRowModel> mBackup = (ArrayList<tabRowModel>)mListModel.onTrigger(tabEnums.eModelCallback.M_LOAD_BACKUP,null);
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.REINIT_DATA, Collections.singletonList(mBackup));
mListModel.onTrigger(tabEnums.eModelCallback.M_CLEAR_BACKUP_RETAIN_DATABASE,null);
initTabCount(400);
ViewGroup.LayoutParams params = mRecycleView.getLayoutParams();
params.height = helperMethod.pxFromDp((mTabAdapter.getItemCount()+mBackup.size()) * 90);
mRecycleView.setLayoutParams(params);
final Handler handler = new Handler();
handler.postDelayed(() ->
{
mPopupUndo.findViewById(R.id.pBlockerUndo).setVisibility(View.VISIBLE);
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG, null);
if(mRecycleView.getAlpha()==0){
initializeList();
mRecycleView.animate().cancel();
mRecycleView.setVisibility(View.VISIBLE);
mRecycleView.animate().setDuration(350).alpha(1);
}
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.REINIT_DATA, Collections.singletonList(mBackup));
mListModel.onTrigger(tabEnums.eModelCallback.M_CLEAR_BACKUP_RETAIN_DATABASE,null);
}, 100);
}
public void onShowUndoDialog(){
@ -291,7 +305,9 @@ public class tabController extends Fragment
/*UI Triggers*/
public void onPostExit() {
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_EXIT, null);
if(mtabViewController!=null){
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_EXIT, null);
}
}
public void openTabMenu(View view) {
@ -311,6 +327,7 @@ public class tabController extends Fragment
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_SHOW_SELECTION_MENU, Arrays.asList(false,0));
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HIDE_SELECTION, null);
activityContextManager.getInstance().getHomeController().onLoadTabFromTabController();
}
public void onClearSelection(View view) {
@ -354,7 +371,7 @@ public class tabController extends Fragment
@Override
public void onStop() {
onBackPressed();
// onBackPressed();
super.onStop();
}
@ -362,7 +379,7 @@ public class tabController extends Fragment
public void onPause()
{
status.sSettingIsAppPaused = true;
onBackPressed();
// onBackPressed();
super.onPause();
}

View File

@ -43,7 +43,7 @@ class tabViewController
private ImageView mRemoveSelection;
private ImageButton mMenuButton;
private ImageButton mClearSelection;
private View mToastLayoutRoot;
private View mUndoLayout;
private TextView mSelectionCount;
private ImageView mBlocker;
private RecyclerView mRecycleView;
@ -61,7 +61,7 @@ class tabViewController
this.mRemoveSelection = pRemoveSelection;
this.mMenuButton = pMenuButton;
this.mClearSelection = pClearSelection;
this.mToastLayoutRoot = pToastLayoutRoot;
this.mUndoLayout = pToastLayoutRoot;
this.mSelectionCount = pSelectionCount;
this.mBlocker = pBlocker;
this.mRecycleView = pRecycleView;
@ -166,26 +166,37 @@ class tabViewController
}
private void onShowUndoDialog(int pTabCount) {
mToastLayoutRoot.findViewById(R.id.pBlockerUndo).setVisibility(View.GONE);
mToastLayoutRoot.animate().cancel();
mToastLayoutRoot.setVisibility(View.VISIBLE);
mToastLayoutRoot.setAlpha(0);
mToastLayoutRoot.animate().alpha(1);
mUndoLayout.findViewById(R.id.pBlockerUndo).setVisibility(View.GONE);
mUndoLayout.animate().cancel();
mUndoLayout.setVisibility(View.VISIBLE);
mUndoLayout.animate().cancel();
mUndoLayout.setTranslationY(60);
mUndoLayout.setAlpha(0);
mUndoLayout.animate().withLayer()
.translationY(0)
.alpha(1f)
.setDuration(220).start();
initTabCount(pTabCount);
mDelayHandler.removeCallbacksAndMessages(null);
mDelayHandler.postDelayed(() -> mToastLayoutRoot.animate().alpha(0).withEndAction(() -> mToastLayoutRoot.setVisibility(View.GONE)), 3000);
mDelayHandler.postDelayed(() -> {
mUndoLayout.animate().cancel();
mUndoLayout.animate().alpha(0).withEndAction(() -> mUndoLayout.setVisibility(View.GONE));
}, 3000);
}
private void onHideUndoDialog() {
mToastLayoutRoot.animate().cancel();
mToastLayoutRoot.animate().alpha(0).withEndAction(() -> mToastLayoutRoot.setVisibility(View.GONE));
mUndoLayout.animate().cancel();
mUndoLayout.animate().alpha(0).withEndAction(() -> mUndoLayout.setVisibility(View.GONE));
}
private void onHideUndoDialogInit() {
mToastLayoutRoot.animate().cancel();
mToastLayoutRoot.setAlpha(0);
mToastLayoutRoot.setVisibility(View.GONE);
mUndoLayout.animate().cancel();
mUndoLayout.setAlpha(0);
mUndoLayout.setVisibility(View.GONE);
}

View File

@ -6,7 +6,7 @@ public class enums
public enum etype{
on_update_favicon,ON_UPDATE_TAB_TITLE, ON_LOAD_REQUEST,GECKO_SCROLL_CHANGED,ON_UPDATE_SEARCH_BAR,M_ON_MAIL,
on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,M_ADMOB_BANNER_RECHECK,
welcome, reload,download_folder,M_ON_BANNER_UPDATE,M_INIT_TAB_COUNT,
welcome, reload,download_folder, M_UPDATE_THEME,M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS,M_INIT_TAB_COUNT,
url_triggered, url_triggered_new_tab,url_clear,fetch_favicon, fetch_thumbnail,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,
on_close_sesson,on_long_press, on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update,progress_update_forced, ON_EXPAND_TOP_BAR,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy, ON_UPDATE_THEME, M_INITIALIZE_TAB_SINGLE, M_INITIALIZE_TAB_LINK,on_request_completed, on_update_history,on_update_suggestion,M_WELCOME_MESSAGE,ON_UPDATE_TITLE_BAR,ON_FIRST_PAINT, ON_LOAD_TAB_ON_RESUME, ON_SESSION_REINIT,on_page_loaded,on_load_error,download_file_popup,on_init_ads,search_update, open_new_tab
}

View File

@ -80,7 +80,7 @@ public class status
status.sSettingIsWelcomeEnabled = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_IS_WELCOME_ENABLED,true));
status.sSettingIsAppRated = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,false));
status.sVPNStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.VPN_ENABLED,false));
status.sBridgeStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.BRIDGE_ENABLES,true));
status.sBridgeStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.BRIDGE_ENABLES,false));
status.sSettingFontAdjustable = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_FONT_ADJUSTABLE,true));
status.sSettingFirstStart = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_FIRST_INSTALLED,true));
status.sSettingEnableZoom = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_ZOOM,true));

View File

@ -50,7 +50,7 @@ public class bookmarkDataModel {
params[1] = pURL;
if(!pTitle.equals("loading")){
databaseController.getInstance().execSQL("INSERT INTO bookmark(id,title,url) VALUES("+autoval+",?,?);",params);
databaseController.getInstance().execSQL("REPLACE INTO bookmark(id,title,url) VALUES("+autoval+",?,?);",params);
}
mBookmarks.add(0,new bookmarkRowModel(pTitle, pURL,autoval));
}

View File

@ -119,7 +119,7 @@ public class historyDataModel {
String m_date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.ENGLISH).format(Calendar.getInstance().getTime());
if(!pHeader.equals("loading")){
databaseController.getInstance().execSQL("INSERT INTO history(id,date,url,title) VALUES("+ mMaxHistoryId +",'" + m_date + "',?,?);",params);
databaseController.getInstance().execSQL("REPLACE INTO history(id,date,url,title) VALUES("+ mMaxHistoryId +",'" + m_date + "',?,?);",params);
}
mHistory.add(0,new historyRowModel(pHeader,pUrl, mMaxHistoryId));

View File

@ -37,7 +37,7 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
/*Helper Methods*/
private ArrayList<historyRowModel> getDefaultSuggestions(String pQuery){
private ArrayList<historyRowModel> getDefaultSuggestions(String pQuery, int mSize){
for(int count = 0; count<= mHintListLocalCache.size()-1 && mHintListLocalCache.size()<500; count++){
if(mHintListLocalCache.get(count).getHeader().toLowerCase().contains(pQuery)){
mCurrentList.add(new historyRowModel(mHintListLocalCache.get(count).getHeader(),mHintListLocalCache.get(count).getDescription(),-1));
@ -48,6 +48,9 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
mCurrentList.add(new historyRowModel(mHintListLocalCache.get(count).getHeader(),mHintListLocalCache.get(count).getDescription(),-1));
}
}
if(mCurrentList.size() + mSize > 6){
break;
}
}
return mCurrentList;
@ -57,6 +60,7 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
mCurrentList = new ArrayList<>();
mCurrentList.clear();
String mQueryOriginal = pQuery;
pQuery = pQuery.replace("+","%").replace(" ","+");
ArrayList<historyRowModel> mHistory = pHistory;
ArrayList<bookmarkRowModel> mBookmarks = pBookmarks;
@ -82,14 +86,14 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
mCurrentList.add(mTempModel);
}
}
if(mCurrentList.size()>8){
if(mCurrentList.size()>6){
break;
}
}
}
}
if(status.sSettingSearchHistory && mCurrentList.size()>8) {
if(status.sSettingSearchHistory && mCurrentList.size()>4) {
for (int count = 0; count <= mBookmarks.size() - 1 && mBookmarks.size() < 500; count++) {
if(!mDuplicationHandler.contains(mBookmarks.get(count).getDescription())){
if (mBookmarks.get(count).getHeader().toLowerCase().contains(pQuery)) {
@ -99,34 +103,32 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
mDuplicationHandler.add(mBookmarks.get(count).getDescription());
mCurrentList.add(mCurrentList.size() - 1, new historyRowModel(mBookmarks.get(count).getHeader(), mBookmarks.get(count).getDescription(), -1));
}
if(mCurrentList.size()>8){
if(mCurrentList.size()>6){
break;
}
}
}
}
if(mCurrentList.size()<8) {
getDefaultSuggestions(pQuery);
if(mCurrentList.size()<6) {
getDefaultSuggestions(pQuery, mCurrentList.size());
}
if(mCurrentList.size()<8){
String mQueryOriginal = pQuery;
if(mCurrentList.size()<3){
if(!pQuery.equals(strings.GENERIC_EMPTY_STR) && !pQuery.equals("about:blank") && !pQuery.contains("?") && !pQuery.contains("/") && !pQuery.contains(" ") && !pQuery.contains(" ") && !pQuery.contains("\n")){
if(mCurrentList.size()<3){
int sepPos = pQuery.indexOf(".");
if (sepPos == -1) {
mCurrentList.add( 0,new historyRowModel(mQueryOriginal+".com", strings.GENERIC_EMPTY_STR,-1));
mCurrentList.add( 0,new historyRowModel(mQueryOriginal+".onion", strings.GENERIC_EMPTY_STR,-1));
}else
{
if(!pQuery.equals(pQuery.substring(0,sepPos)+".com")){
mCurrentList.add( 0,new historyRowModel(pQuery.substring(0,sepPos)+".com", strings.GENERIC_EMPTY_STR,-1));
}
if(!pQuery.equals(pQuery.substring(0,sepPos)+".onion")){
mCurrentList.add( 0,new historyRowModel(pQuery.substring(0,sepPos)+".onion", strings.GENERIC_EMPTY_STR,-1));
}
if(!mQueryOriginal.equals(strings.GENERIC_EMPTY_STR) && !mQueryOriginal.equals("about:blank") && !mQueryOriginal.contains("?") && !mQueryOriginal.contains("/") && !mQueryOriginal.contains(" ") && !mQueryOriginal.contains(" ") && !mQueryOriginal.contains("\n")){
mCurrentList.size();
int sepPos = pQuery.indexOf(".");
if (sepPos == -1) {
mCurrentList.add( 0,new historyRowModel(mQueryOriginal+".com", strings.GENERIC_EMPTY_STR,-1));
mCurrentList.add( 0,new historyRowModel(mQueryOriginal+".onion", strings.GENERIC_EMPTY_STR,-1));
}else
{
if(!pQuery.equals(pQuery.substring(0,sepPos)+".com")){
mCurrentList.add( 0,new historyRowModel(pQuery.substring(0,sepPos)+".com", strings.GENERIC_EMPTY_STR,-1));
}
if(!pQuery.equals(pQuery.substring(0,sepPos)+".onion")){
mCurrentList.add( 0,new historyRowModel(pQuery.substring(0,sepPos)+".onion", strings.GENERIC_EMPTY_STR,-1));
}
}
}
@ -257,7 +259,7 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
}
else if(pCommands == dataEnums.eSuggestionCommands.M_GET_DEFAULT_SUGGESTION)
{
return getDefaultSuggestions((String) pData.get(0));
return getDefaultSuggestions((String) pData.get(0),0);
}
return null;

View File

@ -121,15 +121,18 @@ class tabDataModel
}
void moveTabToTop(geckoSession mSession) {
for(int counter = 0; counter< mTabs.size(); counter++){
if(mTabs.get(counter).getSession().getSessionID().equals(mSession.getSessionID()))
{
String m_date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.ENGLISH).format(Calendar.getInstance().getTime());
databaseController.getInstance().execSQL("UPDATE tab SET date = '" + m_date + "' WHERE mid='"+mTabs.get(counter).getmId() + "'",null);
mTabs.add(0,mTabs.remove(counter));
break;
try{
if(mTabs.get(counter).getSession().getSessionID().equals(mSession.getSessionID()))
{
String m_date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.ENGLISH).format(Calendar.getInstance().getTime());
databaseController.getInstance().execSQL("UPDATE tab SET date = '" + m_date + "' WHERE mid='"+mTabs.get(counter).getmId() + "'",null);
mTabs.add(0,mTabs.remove(counter));
break;
}
}catch (Exception ex){
Log.i(ex.getMessage(), ex.getMessage());
}
}
}

View File

@ -665,6 +665,8 @@ public class helperMethod
return mDrawable;
}
public static String getCurrentTime(){
Calendar now = Calendar.getInstance();
int year = now.get(Calendar.YEAR);

View File

@ -76,6 +76,9 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
mNotifyManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
build = new NotificationCompat.Builder(context);
if(mFileName.length()>30){
mFileName = "..." + mFileName.substring(mFileName.length()-30);
}
build.setContentTitle(mFileName)
.setContentText("starting...")
.setChannelId(mID + "")
@ -150,12 +153,7 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
mStream.close();
} catch (Exception ex) {
build.setContentText("error occured while downloading file");
build.setAutoCancel(true);
build.setOngoing(false);
build.setPriority(Notification.PRIORITY_LOW);
build.setSmallIcon(android.R.drawable.stat_sys_download);
mNotifyManager.notify(mID, build.build());
onCancel();
}
return null;

View File

@ -148,6 +148,19 @@ class messageManager
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> mDialog.dismiss());
}
private void newIdentityCreated()
{
initializeDialog(R.layout.popup_new_circuit, Gravity.BOTTOM);
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
final Handler handler = new Handler();
Runnable runnable = () -> {
mDialog.dismiss();
};
handler.postDelayed(runnable, 1500);
}
private void notSupportMessage()
{
initializeDialog(R.layout.popup_not_supported, Gravity.BOTTOM);
@ -566,6 +579,11 @@ class messageManager
/*VERIFIED*/
onUpdateBridges();
break;
case M_NEW_IDENTITY:
/*VERIFIED*/
newIdentityCreated();
break;
}
}
}

View File

@ -180,6 +180,10 @@ class orbotManager
return orbotLocalConstants.mIsTorInitialized;
}
private void newCircuit(){
OrbotService.getServiceObject().newIdentity();
}
private String getOrbotStatus(){
return OrbotService.getServiceObject().getProxyStatus();
}
@ -243,6 +247,10 @@ class orbotManager
{
return isOrbotRunning();
}
else if(pEventType.equals(pluginEnums.eOrbotManager.M_NEW_CIRCUIT))
{
newCircuit();
}
return null;
}

View File

@ -28,7 +28,7 @@ public class pluginEnums
/*Message Manager*/
public enum eMessageManager{
M_RESET, M_DATA_CLEARED, M_SECURE_CONNECTION,M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_RATE_SUCCESS, M_RATE_FAILURE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME
M_RESET, M_DATA_CLEARED, M_SECURE_CONNECTION,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_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_RATE_SUCCESS, M_RATE_FAILURE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME
}
public enum eMessageManagerCallbacks{
M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_REQUEST_BRIDGES, M_SET_BRIDGES, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_RATE_APPLICATION
@ -46,6 +46,6 @@ public class pluginEnums
/*Orbot Manager*/
public enum eOrbotManager{
M_GET_NOTIFICATION_STATUS, M_ENABLE_NOTIFICATION, M_DISABLE_NOTIFICATION, M_DISABLE_NOTIFICATION_NO_BANDWIDTH, M_GET_LOGS, M_UPDATE_PRIVACY,M_START_ORBOT,M_IS_ORBOT_RUNNING, M_GET_ORBOT_STATUS, M_UPDATE_BRIDGES, M_UPDATE_VPN, M_SET_PROXY, M_SHOW_NOTIFICATION_STATUS, M_ORBOT_RUNNING
M_GET_NOTIFICATION_STATUS, M_NEW_CIRCUIT,M_ENABLE_NOTIFICATION, M_DISABLE_NOTIFICATION, M_DISABLE_NOTIFICATION_NO_BANDWIDTH, M_GET_LOGS, M_UPDATE_PRIVACY,M_START_ORBOT,M_IS_ORBOT_RUNNING, M_GET_ORBOT_STATUS, M_UPDATE_BRIDGES, M_UPDATE_VPN, M_SET_PROXY, M_SHOW_NOTIFICATION_STATUS, M_ORBOT_RUNNING
}
}

View File

@ -1,5 +1,5 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/c_background_alpha">
android:color="@color/c_ripple_light">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/button_gray" />

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M23,8c0,1.1 -0.9,2 -2,2c-0.18,0 -0.35,-0.02 -0.51,-0.07l-3.56,3.55C16.98,13.64 17,13.82 17,14c0,1.1 -0.9,2 -2,2s-2,-0.9 -2,-2c0,-0.18 0.02,-0.36 0.07,-0.52l-2.55,-2.55C10.36,10.98 10.18,11 10,11s-0.36,-0.02 -0.52,-0.07l-4.55,4.56C4.98,15.65 5,15.82 5,16c0,1.1 -0.9,2 -2,2s-2,-0.9 -2,-2s0.9,-2 2,-2c0.18,0 0.35,0.02 0.51,0.07l4.56,-4.55C8.02,9.36 8,9.18 8,9c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,0.18 -0.02,0.36 -0.07,0.52l2.55,2.55C14.64,12.02 14.82,12 15,12s0.36,0.02 0.52,0.07l3.55,-3.56C19.02,8.35 19,8.18 19,8c0,-1.1 0.9,-2 2,-2S23,6.9 23,8z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,5.9c1.16,0 2.1,0.94 2.1,2.1s-0.94,2.1 -2.1,2.1S9.9,9.16 9.9,8s0.94,-2.1 2.1,-2.1m0,9c2.97,0 6.1,1.46 6.1,2.1v1.1L5.9,18.1L5.9,17c0,-0.64 3.13,-2.1 6.1,-2.1M12,4C9.79,4 8,5.79 8,8s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM12,13c-2.67,0 -8,1.34 -8,4v3h16v-3c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

View File

@ -39,7 +39,7 @@
tools:ignore="SmallSp" />
<Button
android:id="@+id/pUndo"
android:id="@+id/pDismiss"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
@ -80,7 +80,7 @@
android:layout_marginEnd="20dp"
android:background="#3973ac"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/pUndo"
app:layout_constraintEnd_toStartOf="@+id/pDismiss"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -0,0 +1,72 @@
<?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/pToastLayoutRoot"
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/pMainLayout"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginBottom="15dp"
android:background="@xml/ax_background_inverted"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/pDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:alpha="0.8"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/HOME_MENU__NEW_CIRCUIT_CREATED"
android:textAlignment="textStart"
android:textColor="@color/c_alert_text_inverted"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/pMainLayout"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SmallSp" />
<Button
android:id="@+id/pDismiss"
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_ripple_default_round_right"
android:padding="0dp"
android:text="@string/ALERT_DISMISS"
android:textAllCaps="false"
android:textColor="@color/c_button_text_v1_inverted"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/view6"
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_marginEnd="20dp"
android:background="@color/c_border_background_divider"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/pDismiss"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -77,8 +77,7 @@
android:textSize="15sp"
android:textAllCaps="false"
android:layout_weight="1"
android:textStyle="bold"
android:text="@string/ALERT_DISMISS" />
android:textStyle="bold"/>
<View
android:id="@+id/pDividerHorizontal"

View File

@ -39,7 +39,7 @@
tools:ignore="SmallSp" />
<Button
android:id="@+id/pUndo"
android:id="@+id/pDismiss"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
@ -80,7 +80,7 @@
android:layout_marginEnd="20dp"
android:background="@color/c_border_background_divider"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/pUndo"
app:layout_constraintEnd_toStartOf="@+id/pDismiss"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="themed" type="id" />
<item name="msearchbarProcessing" type="id" />
</resources>

View File

@ -42,9 +42,9 @@
<ImageView
android:id="@+id/pHintWebIcon"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_marginStart="11dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:layout_marginBottom="3dp"
android:background="@xml/hox_round_outline"
android:contentDescription="@string/GENERAL_TODO"

View File

@ -764,8 +764,9 @@
<include
android:id="@+id/pPopupLoadNewTab"
layout="@layout/popup_load_new_tab"
android:translationZ="5dp"
android:translationZ="0dp"
android:alpha="0"
android:visibility="gone" />
<androidx.fragment.app.FragmentContainerView

View File

@ -335,6 +335,41 @@
tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout>
<LinearLayout
android:id="@+id/menu28"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="1dp"
android:background="@xml/gx_side_item"
android:clickable="true"
android:focusable="true"
android:onClick="onMenuItemInvoked"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="21dp"
android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:contentDescription="@string/GENERAL_TODO"
android:src="@xml/ic_baseline_perm_identity"
app:tint="@color/c_navigation_medium" />
<TextView
android:layout_width="0dp"
android:layout_height="45dp"
android:layout_marginStart="17dp"
android:layout_weight="1"
android:gravity="start|center_vertical"
android:paddingStart="3dp"
android:text="@string/HOME_MENU__NEW_CIRCUIT"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="15sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout>
<LinearLayout
android:id="@+id/menu25"
android:layout_width="match_parent"

View File

@ -299,20 +299,19 @@
android:background="@xml/gx_ripple_gray"
android:clickable="false"
android:id="@+id/pAdvanceOption1"
android:layoutDirection="ltr"
android:onClick="onShowImages"
android:orientation="horizontal"
android:weightSum="7">
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="6"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:alpha="1"
android:background="@android:color/transparent"
android:clickable="false"
@ -328,12 +327,12 @@
<RadioButton
android:id="@+id/pAdvanceImageOption1"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clickable="false"
android:layout_weight="1"
android:layout_marginStart="50dp"
android:background="@android:color/transparent"
android:layout_marginStart="20dp"
android:layout_marginEnd="7dp"
android:buttonTint="@color/c_radio_tint"
android:src="@xml/ic_arrow_right"
android:contentDescription="@string/GENERAL_TODO" />
@ -353,12 +352,12 @@
android:id="@+id/pAdvanceOption2"
android:onClick="onShowImages"
android:clickable="false"
android:orientation="horizontal"
android:weightSum="7">
android:layoutDirection="ltr"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="6"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
@ -380,13 +379,13 @@
<RadioButton
android:id="@+id/pAdvanceImageOption2"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clickable="false"
android:layout_weight="1"
android:layout_marginStart="50dp"
android:background="@android:color/transparent"
android:buttonTint="@color/c_radio_tint"
android:layout_marginStart="20dp"
android:layout_marginEnd="7dp"
android:src="@xml/ic_arrow_right"
android:contentDescription="@string/GENERAL_TODO" />

View File

@ -247,7 +247,6 @@
<LinearLayout
android:layout_width="match_parent"
android:background="@xml/sx_border_left"
android:paddingStart="4dp"
android:layout_marginTop="15dp"
android:orientation="vertical"
android:layout_height="wrap_content"
@ -266,10 +265,11 @@
android:layout_height="55dp"
android:background="@xml/gx_ripple_gray"
android:clickable="true"
android:layout_marginStart="4dp"
android:layoutDirection="ltr"
android:paddingStart="0dp"
android:onClick="onSelectTheme"
android:orientation="horizontal"
android:weightSum="8"
android:focusable="true"
tools:ignore="RtlSymmetry">
@ -300,12 +300,10 @@
<RadioButton
android:id="@+id/pThemeDark"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clickable="false"
android:layout_weight="1"
android:layout_marginEnd="10dp"
android:layout_marginStart="50dp"
android:buttonTint="@color/c_radio_tint"
android:background="@android:color/transparent"
android:src="@xml/ic_arrow_right"
@ -324,9 +322,10 @@
android:layout_height="55dp"
android:background="@xml/gx_ripple_gray"
android:clickable="true"
android:layoutDirection="ltr"
android:layout_marginStart="4dp"
android:onClick="onSelectTheme"
android:orientation="horizontal"
android:weightSum="8"
android:focusable="true"
tools:ignore="RtlSymmetry">
@ -356,13 +355,11 @@
</LinearLayout>
<RadioButton
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:id="@+id/pThemeLight"
android:layout_weight="1"
android:background="@android:color/transparent"
android:layout_marginStart="50dp"
android:src="@xml/ic_arrow_right"
android:buttonTint="@color/c_radio_tint"
android:clickable="false"
@ -383,13 +380,14 @@
android:clickable="true"
android:onClick="onSelectTheme"
android:orientation="horizontal"
android:weightSum="8"
android:layoutDirection="ltr"
android:layout_marginStart="4dp"
android:focusable="true"
tools:ignore="RtlSymmetry">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="7"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
@ -414,13 +412,11 @@
</LinearLayout>
<RadioButton
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:id="@+id/pThemeDefault"
android:layout_weight="1"
android:background="@android:color/transparent"
android:layout_marginStart="50dp"
android:src="@xml/ic_arrow_right"
android:buttonTint="@color/c_radio_tint"
android:clickable="false"

View File

@ -359,7 +359,8 @@
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:background="@xml/sx_border_left"
android:paddingStart="4dp"
android:paddingStart="0dp"
android:layoutDirection="ltr"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="RtlSymmetry">
@ -377,6 +378,9 @@
android:layout_height="wrap_content"
android:background="@xml/gx_ripple_gray"
android:onClick="onCookies"
android:layoutDirection="ltr"
android:layout_marginEnd="0dp"
android:layout_marginStart="4dp"
android:orientation="horizontal">
<RadioButton
android:id="@+id/pCookieRadioOption1"
@ -385,9 +389,11 @@
android:layout_height="50dp"
android:paddingEnd="15dp"
android:clickable="false"
android:background="@android:color/transparent"
android:buttonTint="@color/c_radio_tint"
android:textColor="@color/c_text_v1"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:paddingStart="15dp"
android:text="@string/SETTING_PRIVACY_COOKIES_OPTION1"
tools:ignore="RtlHardcoded" />
@ -403,6 +409,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@xml/gx_ripple_gray"
android:layoutDirection="ltr"
android:layout_marginEnd="0dp"
android:layout_marginStart="4dp"
android:onClick="onCookies"
android:orientation="horizontal">
<RadioButton
@ -413,6 +422,8 @@
android:paddingEnd="15dp"
android:textColor="@color/c_text_v1"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:background="@android:color/transparent"
android:buttonTint="@color/c_radio_tint"
android:paddingStart="15dp"
android:clickable="false"
@ -430,6 +441,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@xml/gx_ripple_gray"
android:layoutDirection="ltr"
android:layout_marginEnd="0dp"
android:layout_marginStart="4dp"
android:onClick="onCookies"
android:orientation="horizontal">
<RadioButton
@ -440,8 +454,10 @@
android:clickable="false"
android:paddingEnd="15dp"
android:textColor="@color/c_text_v1"
android:background="@android:color/transparent"
android:buttonTint="@color/c_radio_tint"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:paddingStart="15dp"
android:text="@string/SETTING_PRIVACY_COOKIES_OPTION3"
tools:ignore="RtlHardcoded" />
@ -468,8 +484,10 @@
android:paddingEnd="15dp"
android:textColor="@color/c_text_v1"
android:layout_marginEnd="10dp"
android:background="@android:color/transparent"
android:buttonTint="@color/c_radio_tint"
android:paddingStart="15dp"
android:layout_marginStart="10dp"
android:text="@string/SETTING_PRIVACY_COOKIES_OPTION4"
tools:ignore="RtlHardcoded" />
</LinearLayout>

View File

@ -124,7 +124,7 @@
android:layout_height="55dp"
android:background="@xml/gx_ripple_gray"
android:clickable="true"
android:layout_marginStart="5dp"
android:paddingStart="3dp"
android:onClick="onSelectSearchEngine"
android:orientation="horizontal"
android:weightSum="8"
@ -204,7 +204,7 @@
android:layout_height="55dp"
android:background="@xml/gx_ripple_gray"
android:clickable="true"
android:layout_marginStart="3dp"
android:paddingStart="3dp"
android:onClick="onSelectSearchEngine"
android:orientation="horizontal"
android:weightSum="8"
@ -284,7 +284,7 @@
android:layout_height="55dp"
android:background="@xml/gx_ripple_gray"
android:clickable="true"
android:layout_marginStart="3dp"
android:paddingStart="3dp"
android:onClick="onSelectSearchEngine"
android:orientation="horizontal"
android:weightSum="8"
@ -364,7 +364,7 @@
android:layout_height="55dp"
android:background="@xml/gx_ripple_gray"
android:clickable="true"
android:layout_marginStart="3dp"
android:paddingStart="3dp"
android:onClick="onSelectSearchEngine"
android:orientation="horizontal"
android:weightSum="8"
@ -444,7 +444,7 @@
android:layout_height="55dp"
android:background="@xml/gx_ripple_gray"
android:clickable="true"
android:layout_marginStart="3dp"
android:paddingStart="3dp"
android:onClick="onSelectSearchEngine"
android:orientation="horizontal"
android:weightSum="8"

View File

@ -145,6 +145,7 @@
android:id="@+id/pTrackingOption1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr"
android:paddingBottom="13dp"
android:layout_marginEnd="0dp"
android:layout_marginStart="5dp"
@ -157,10 +158,11 @@
android:layout_width="match_parent"
android:layout_marginTop="8dp"
android:clickable="false"
android:background="@android:color/transparent"
android:buttonTint="@color/c_radio_tint"
android:textColor="@color/c_text_v1"
android:layout_marginEnd="10dp"
android:layout_marginStart="20dp"
android:layout_marginStart="15dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:textSize="15sp"
@ -171,9 +173,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layoutDirection="ltr"
android:layout_marginEnd="42dp"
android:layout_marginTop="-2dp"
android:paddingEnd="55dp"
android:paddingEnd="17dp"
android:textSize="13sp"
android:text="@string/SETTING_PRIVACY_TRACKING_OPTION1_INFO"
/>
@ -188,6 +191,7 @@
android:id="@+id/pTrackingOption2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr"
android:paddingBottom="13dp"
android:layout_marginEnd="0dp"
android:layout_marginStart="5dp"
@ -200,9 +204,10 @@
android:layout_width="match_parent"
android:layout_marginTop="8dp"
android:clickable="false"
android:background="@android:color/transparent"
android:buttonTint="@color/c_radio_tint"
android:textColor="@color/c_text_v1"
android:layout_marginStart="20dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="10dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
@ -216,7 +221,7 @@
android:layout_marginStart="20dp"
android:layout_marginEnd="42dp"
android:layout_marginTop="-2dp"
android:paddingEnd="55dp"
android:paddingEnd="16dp"
android:textSize="13sp"
android:text="@string/SETTING_PRIVACY_TRACKING_OPTION2_INFO"
/>
@ -229,6 +234,7 @@
<LinearLayout
android:id="@+id/pTrackingOption3"
android:layoutDirection="ltr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="13dp"
@ -243,10 +249,11 @@
android:layout_width="match_parent"
android:layout_marginTop="8dp"
android:clickable="false"
android:background="@android:color/transparent"
android:buttonTint="@color/c_radio_tint"
android:textColor="@color/c_text_v1"
android:layout_marginEnd="10dp"
android:layout_marginStart="20dp"
android:layout_marginStart="15dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:textSize="15sp"
@ -259,7 +266,7 @@
android:layout_marginStart="20dp"
android:layout_marginEnd="42dp"
android:layout_marginTop="-2dp"
android:paddingEnd="55dp"
android:paddingEnd="16dp"
android:textSize="13sp"
android:text="@string/SETTING_PRIVACY_TRACKING_OPTION3_INFO"
/>

View File

@ -79,6 +79,7 @@
<color name="c_tab_image_border">#324467</color>
<color name="c_list_remove_back">#0f0f0f</color>
<color name="c_list_alpha_black">#90000000</color>
<color name="c_ripple_light">#d9d9d9</color>
<color name="blue">#0066FF</color>
<color name="ease_blue_light">#fdfeff</color>

View File

@ -80,6 +80,7 @@
<color name="c_alert_text">#212d45</color>
<color name="c_alert_text_inverted">#ffffff</color>
<color name="c_long_button">#7591bd</color>
<color name="c_ripple_light">#dedede</color>
<color name="blue">#0066FF</color>
<color name="ease_blue_light">#fdfeff</color>

View File

@ -307,6 +307,8 @@
<string name="ORBOT_LOG_INFO" translatable="true">If you are facing connectivity issue while starting Genesis please copy the following code and find issue online or send it to us, so we can try to help you out </string>
<!-- Popup Menu -->
<string name="HOME_MENU__NEW_CIRCUIT" translatable="true">New identity</string>
<string name="HOME_MENU__NEW_CIRCUIT_CREATED" translatable="true">New identity created</string>
<string name="HOME_MENU__ORBOT_LOGS" translatable="true">Orbot logs</string>
<string name="HOME_MENU__NEW_TABS" translatable="true">New tabs</string>
<string name="HOME_MENU_CLOSE_TABS" translatable="true">Close Tab</string>

View File

@ -18,7 +18,7 @@ project.ext.x64_vcode = 608
project.ext.dimen = 'abi'
/*firefox version*/
project.ext.firefox_version = "81.0.20200930150533"
project.ext.firefox_version = "87.0.20210318103112"
project.ext.firefox_channel = ""
/*Application Preferences*/
@ -36,6 +36,6 @@ project.ext.support_libraries_version = '1.0.0'
project.ext.espresso_version = '3.1.0-alpha4'
project.ext.coroutines_version = '1.3.0'
project.ext.spotbugs_version = '3.1.4'
project.ext.mozilla_components_version = '70.0.9'
project.ext.mozilla_components_icon_version = '70.0.5'
project.ext.gecko_nightly_version = '81.0.20200930150533'
project.ext.mozilla_components_version = '73.0.8'
project.ext.mozilla_components_icon_version = '73.0.9'
project.ext.gecko_nightly_version = '87.0.20210318103112'

View File

@ -8,9 +8,9 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31"
}
}

View File

@ -46,23 +46,13 @@ android {
dependencies {
implementation 'org.torproject:tor-android-binary:0.4.4.6'
/**
implementation 'info.pluggabletransports.aptds:apt-dispatch-library:1.0.9'
implementation 'info.pluggabletransports.aptds:apt-meek-obfs4-legacy:1.0.9'
**/
implementation 'info.pluggabletransports.aptds:jsocksAndroid:1.0.4'
implementation 'com.jaredrummler:android-shell:1.0.0'
//implementation fileTree(dir: 'libs', include: ['.so','.aar'])
implementation 'androidx.core:core:1.3.2'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
testImplementation 'junit:junit:4.13.2'
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'
}

View File

@ -245,122 +245,46 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
mNotificationManager.createNotificationChannel(mChannel);
}
@SuppressLint("NewApi")
@SuppressLint({"NewApi", "RestrictedApi"})
protected void showToolbarNotification(String notifyMsg, int notifyType, int icon) {
if(orbotLocalConstants.mHomeContext ==null){
return;
}
PackageManager pm = getPackageManager();
Intent mIntent = orbotLocalConstants.mHomeIntent;
mIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
Intent intent = pm.getLaunchIntentForPackage(getPackageName());
PendingIntent pendIntent = PendingIntent.getActivity(OrbotService.this, 0, intent, 0);
if (mNotifyBuilder == null) {
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if (mNotifyBuilder == null) {
mNotifyBuilder = new NotificationCompat.Builder(this)
.setContentTitle("Genesis")
.setColor(Color.parseColor("#84989f"))
.setSmallIcon(R.drawable.ic_stat_tor_logo);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) {
final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
final List<ActivityManager.AppTask> recentTaskInfos = activityManager.getAppTasks();
if (!recentTaskInfos.isEmpty()) {
for (ActivityManager.AppTask appTaskTaskInfo: recentTaskInfos) {
if (appTaskTaskInfo.getTaskInfo().baseIntent.getComponent().getPackageName().equals("com.darkweb.genesissearchengine")) {
Intent resultIntent = null;
try
{
Class mClass = Class.forName("com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController"); //without the .class
resultIntent = new Intent(this, mClass);
resultIntent.setAction("android.intent.action.MAIN");
resultIntent.addCategory("android.intent.category.LAUNCHER");
PendingIntent resultPendingIntent = PendingIntent.getActivity(this, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mNotifyBuilder.setContentIntent(resultPendingIntent);
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
}
}else {
PendingIntent pendIntent = PendingIntent.getActivity(orbotLocalConstants.mHomeContext.get(), 0, mIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mNotifyBuilder.setContentIntent(pendIntent);
}
}
mNotifyBuilder.setCategory(Notification.CATEGORY_SERVICE);
mNotifyBuilder.setChannelId(NOTIFICATION_CHANNEL_ID);
Intent intentRefresh = new Intent();
intentRefresh.setAction(CMD_NEWNYM);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) {
final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
final List<ActivityManager.AppTask> recentTaskInfos = activityManager.getAppTasks();
if (!recentTaskInfos.isEmpty()) {
for (ActivityManager.AppTask appTaskTaskInfo: recentTaskInfos) {
if (appTaskTaskInfo.getTaskInfo().baseIntent.getComponent().getPackageName().equals("com.darkweb.genesissearchengine")) {
Intent resultIntent = null;
try
{
Class mClass = Class.forName("com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController"); //without the .class
resultIntent = new Intent(this, mClass);
resultIntent.setAction("android.intent.action.MAIN");
resultIntent.addCategory("android.intent.category.LAUNCHER");
PendingIntent resultPendingIntent = PendingIntent.getActivity(this, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mNotifyBuilder.setContentIntent(resultPendingIntent);
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
}
}else {
PendingIntent pendIntent = PendingIntent.getActivity(orbotLocalConstants.mHomeContext.get(), 0, mIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mNotifyBuilder.setContentIntent(pendIntent);
}
mNotifyBuilder.setOngoing(Prefs.persistNotifications());
mNotifyBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setContentIntent(pendIntent)
.setCategory(Notification.CATEGORY_SERVICE)
.setContentTitle("Genesis")
.setColor(Color.parseColor("#84989f"))
.setSmallIcon(R.drawable.ic_stat_tor_logo)
.setOngoing(Prefs.persistNotifications());
}
mNotifyBuilder.setContentText(notifyMsg);
mNotifyBuilder.setSmallIcon(icon);
if (notifyType != NOTIFY_ID) {
mNotifyBuilder.setTicker(notifyMsg);
} else {
mNotifyBuilder.setTicker(null);
mNotifyBuilder.mActions.clear(); // clear out NEWNYM action
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.setContentText(notifyMsg)
.setSmallIcon(icon)
.setTicker(notifyType != NOTIFY_ID ? notifyMsg : null);
if (!Prefs.persistNotifications())
mNotifyBuilder.setPriority(Notification.PRIORITY_LOW);
mNotification = mNotifyBuilder.build();
Notification notification = mNotifyBuilder.build();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForeground(NOTIFY_ID, mNotification);
startForeground(NOTIFY_ID, notification);
} else if (Prefs.persistNotifications() && (!mNotificationShowing)) {
startForeground(NOTIFY_ID, mNotification);
startForeground(NOTIFY_ID, notification);
logNotice("Set background service to FOREGROUND");
} else {
mNotificationManager.notify(NOTIFY_ID, mNotification);
mNotificationManager.notify(NOTIFY_ID, notification);
}
mNotificationShowing = true;