mirror of https://github.com/LeOS-GSI/LeOS-Genesis
code refactoring
parent
16c20006e7
commit
76a728fe59
|
@ -0,0 +1,6 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="Convert2MethodRef" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
|
@ -7,7 +7,7 @@ public class app_model
|
|||
/*Data Objects*/
|
||||
private static String currentURL = "http://boogle.store/";
|
||||
private static int port = 9150;
|
||||
private boolean isLoadingURL = false;
|
||||
private boolean isURLLoading = true;
|
||||
private Context appContext;
|
||||
private application_controller appInstance;
|
||||
|
||||
|
@ -21,16 +21,6 @@ public class app_model
|
|||
|
||||
|
||||
/*Getters Setters*/
|
||||
public boolean getIsLoadingURL()
|
||||
{
|
||||
return isLoadingURL;
|
||||
}
|
||||
|
||||
public void setIsLoadingURL(boolean status)
|
||||
{
|
||||
isLoadingURL = status;
|
||||
}
|
||||
|
||||
public int getPort()
|
||||
{
|
||||
return port;
|
||||
|
@ -41,16 +31,6 @@ public class app_model
|
|||
this.port = port;
|
||||
}
|
||||
|
||||
public String getCurrentURL()
|
||||
{
|
||||
return currentURL;
|
||||
}
|
||||
|
||||
public void setCurrentURL(String currentURL)
|
||||
{
|
||||
this.currentURL = currentURL;
|
||||
}
|
||||
|
||||
public Context getAppContext()
|
||||
{
|
||||
return appContext;
|
||||
|
|
|
@ -1,24 +1,49 @@
|
|||
package com.darkweb.genesissearchengine.appManager;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Handler;
|
||||
import android.support.constraint.ConstraintLayout;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
import com.darkweb.genesissearchengine.httpManager.serverRequestManager;
|
||||
import com.darkweb.genesissearchengine.pluginManager.message_manager;
|
||||
import com.example.myapplication.R;
|
||||
|
||||
import static java.lang.Thread.sleep;
|
||||
|
||||
public class applicationViewController
|
||||
{
|
||||
/*ViewControllers*/
|
||||
private WebView webView1;
|
||||
private WebView webView2;
|
||||
private WebView webView;
|
||||
private ProgressBar progressBar;
|
||||
private EditText searchbar;
|
||||
private ConstraintLayout splashScreen;
|
||||
private ConstraintLayout requestFailure;
|
||||
private FloatingActionButton floatingButton;
|
||||
private ImageView loading;
|
||||
private ImageView splashlogo;
|
||||
private boolean pageLoadedSuccessfully = true;
|
||||
|
||||
/*ProgressBar Delayed Updater*/
|
||||
Handler progressBarHandler = null;
|
||||
|
||||
/*Initializations*/
|
||||
private static final applicationViewController ourInstance = new applicationViewController();
|
||||
|
||||
public static applicationViewController getInstance()
|
||||
{
|
||||
return ourInstance;
|
||||
|
@ -28,55 +53,227 @@ public class applicationViewController
|
|||
{
|
||||
}
|
||||
|
||||
public void initialization(WebView webView1,WebView webView2,ProgressBar progressBar,EditText searchbar,ConstraintLayout splashScreen,ConstraintLayout requestFailure)
|
||||
public void initialization(WebView webView1, ProgressBar progressBar, EditText searchbar, ConstraintLayout splashScreen, ConstraintLayout requestFailure, FloatingActionButton floatingButton, ImageView loading, ImageView splashlogo)
|
||||
{
|
||||
this.webView1 = webView1;
|
||||
this.webView2 = webView2;
|
||||
this.webView = webView1;
|
||||
this.progressBar = progressBar;
|
||||
this.searchbar = searchbar;
|
||||
this.splashScreen = splashScreen;
|
||||
this.requestFailure = requestFailure;
|
||||
this.floatingButton = floatingButton;
|
||||
this.loading = loading;
|
||||
this.splashlogo = splashlogo;
|
||||
|
||||
app_model.getInstance().getAppInstance().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
||||
checkSSLTextColor();
|
||||
initSplashScreen();
|
||||
initLock();
|
||||
initViews();
|
||||
}
|
||||
|
||||
public void onRequestURL()
|
||||
public boolean isHiddenView()
|
||||
{
|
||||
webView1.stopLoading();
|
||||
webView2.stopLoading();
|
||||
return app_model.getInstance().getAppInstance().isGeckoViewRunning();
|
||||
}
|
||||
|
||||
progressBar.setProgress(5);
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
progressBar.animate().setDuration(150).alpha(1f);
|
||||
public void initViews()
|
||||
{
|
||||
floatingButton.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
public void initLock()
|
||||
{
|
||||
Drawable img = app_model.getInstance().getAppInstance().getResources().getDrawable( R.drawable.icon_lock);
|
||||
searchbar.measure(0, 0);
|
||||
img.setBounds( 0, (int)(searchbar.getMeasuredHeight()*0.00), (int)(searchbar.getMeasuredHeight()*1.10), (int)(searchbar.getMeasuredHeight()*0.69) );
|
||||
searchbar.setCompoundDrawables( img, null, null, null );
|
||||
}
|
||||
|
||||
public void onRequestTriggered(boolean isHiddenWeb,String url)
|
||||
{
|
||||
onProgressBarUpdate(4);
|
||||
helperMethod.hideKeyboard();
|
||||
pageLoadedSuccessfully = true;
|
||||
onUpdateSearchBar(url);
|
||||
checkSSLTextColor();
|
||||
onClearSearchBarCursor();
|
||||
|
||||
searchbar.setFocusableInTouchMode(false);
|
||||
searchbar.setFocusable(false);
|
||||
searchbar.setFocusableInTouchMode(true);
|
||||
searchbar.setFocusable(true);
|
||||
}
|
||||
|
||||
/*Helper Methods*/
|
||||
public void onInternetError()
|
||||
{
|
||||
splashScreen.animate().setStartDelay(2000).alpha(0);
|
||||
progressBar.animate().alpha(0);
|
||||
|
||||
requestFailure.setVisibility(View.VISIBLE);
|
||||
requestFailure.animate().alpha(1f).setDuration(300);
|
||||
webView.setAlpha(0);
|
||||
requestFailure.animate().alpha(1f).setDuration(150);
|
||||
pageLoadedSuccessfully = false;
|
||||
Log.i("jhgjhg",0+"");
|
||||
onClearSearchBarCursor();
|
||||
onProgressBarUpdate(0);
|
||||
}
|
||||
|
||||
public void loadUrlOnWebview(String html)
|
||||
public void onDisableInternetError()
|
||||
{
|
||||
WebView webView = getCurrentView();
|
||||
webView.bringToFront();
|
||||
webView.loadDataWithBaseURL(app_model.getInstance().getCurrentURL(),html, "text/html", "utf-8", null);
|
||||
requestFailure.animate().alpha(0f).setDuration(150).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));;
|
||||
}
|
||||
|
||||
public WebView getCurrentView()
|
||||
public void onPageFinished(boolean status)
|
||||
{
|
||||
WebView tempView;
|
||||
if(webView1.getAlpha()==0)
|
||||
helperMethod.hideKeyboard();
|
||||
progressBar.setProgress(100);
|
||||
|
||||
if(!status)
|
||||
{
|
||||
tempView = webView1;
|
||||
if(pageLoadedSuccessfully)
|
||||
{
|
||||
requestFailure.animate().alpha(0f).setStartDelay(200).setDuration(200).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));
|
||||
onUpdateView(true);
|
||||
}
|
||||
//onUpdateSearchBar(webView.getUrl());
|
||||
splashScreen.animate().alpha(0.0f).setStartDelay(150).setDuration(200).setListener(null).withEndAction((() -> splashScreen.setVisibility(View.GONE)));
|
||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));;
|
||||
onWelcomeMessageCheck();
|
||||
|
||||
app_model.getInstance().getAppInstance().stopHiddenView();
|
||||
}
|
||||
else
|
||||
{
|
||||
tempView = webView2;
|
||||
onUpdateView(false);
|
||||
floatingButton.animate().alpha(1).withEndAction((() -> floatingButton.setVisibility(View.VISIBLE)));;
|
||||
}
|
||||
return tempView;
|
||||
}
|
||||
|
||||
public void checkSSLTextColor()
|
||||
{
|
||||
if (searchbar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (searchbar.getText().toString().contains("https://"))
|
||||
{
|
||||
SpannableString ss = new SpannableString(searchbar.getText());
|
||||
ss.setSpan(new ForegroundColorSpan(Color.argb(255, 0, 123, 43)), 0, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new ForegroundColorSpan(Color.GRAY), 5, 8, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
searchbar.setText(ss);
|
||||
} else if (searchbar.getText().toString().contains("http://"))
|
||||
{
|
||||
SpannableString ss = new SpannableString(searchbar.getText());
|
||||
ss.setSpan(new ForegroundColorSpan(Color.argb(255, 0, 128, 43)), 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new ForegroundColorSpan(Color.GRAY), 4, 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
searchbar.setText(ss);
|
||||
} else
|
||||
{
|
||||
SpannableString ss = new SpannableString(searchbar.getText());
|
||||
ss.setSpan(new ForegroundColorSpan(Color.BLACK), 0, searchbar.getText().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
searchbar.setText(ss);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClearSearchBarCursor()
|
||||
{
|
||||
searchbar.clearFocus();
|
||||
}
|
||||
|
||||
public void disableFloatingView()
|
||||
{
|
||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));;
|
||||
|
||||
}
|
||||
|
||||
public void onUpdateSearchBar(String url)
|
||||
{
|
||||
searchbar.setText(url.replace(constants.backendUrlHost,constants.frontEndUrlHost_v1));
|
||||
checkSSLTextColor();
|
||||
}
|
||||
|
||||
public void initSplashScreen()
|
||||
{
|
||||
boolean hasSoftKey = helperMethod.hasSoftKeys(app_model.getInstance().getAppInstance().getWindowManager());
|
||||
int height = helperMethod.screenHeight(hasSoftKey);
|
||||
|
||||
splashlogo.getLayoutParams().height = height;
|
||||
loading.setAnimation(helperMethod.getRotationAnimation());
|
||||
loading.setLayoutParams(helperMethod.getCenterScreenPoint(loading.getLayoutParams()));
|
||||
}
|
||||
|
||||
public void onProgressBarUpdate(int progress)
|
||||
{
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
if(progress==0)
|
||||
{
|
||||
progressBar.animate().alpha(0).withEndAction((() -> progressBar.setProgress(progress)));
|
||||
}
|
||||
else
|
||||
{
|
||||
progressBar.setProgress(progress);
|
||||
progressBar.setAlpha(1);
|
||||
}
|
||||
}
|
||||
|
||||
public void onBackPressed()
|
||||
{
|
||||
if(!isHiddenView())
|
||||
{
|
||||
webView.goBack();
|
||||
webView.bringToFront();
|
||||
webView.setAlpha(1);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
requestFailure.animate().alpha(0f).setDuration(200).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));
|
||||
onUpdateSearchBar(webView.getUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onHiddenGoBack();
|
||||
}
|
||||
}
|
||||
|
||||
public void onUpdateView(boolean status)
|
||||
{
|
||||
if(status)
|
||||
{
|
||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));;
|
||||
webView.setAlpha(1);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
webView.bringToFront();
|
||||
onProgressBarUpdate(0);
|
||||
onUpdateSearchBar(webView.getUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
webView.animate().alpha(0).setDuration(150).withEndAction((() -> webView.setVisibility(View.GONE)));
|
||||
}
|
||||
}
|
||||
|
||||
public void onWelcomeMessageCheck()
|
||||
{
|
||||
if(!status.isApplicationLoaded)
|
||||
{
|
||||
if(!preference_manager.getInstance().getBool("FirstTimeLoaded",false))
|
||||
{
|
||||
message_manager.getInstance().welcomeMessage();
|
||||
}
|
||||
serverRequestManager.getInstance().versionChecker();
|
||||
}
|
||||
}
|
||||
|
||||
public void onReload()
|
||||
{
|
||||
if(!isHiddenView())
|
||||
{
|
||||
onRequestTriggered(false,webView.getUrl());
|
||||
webView.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onReloadHiddenView();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,100 @@
|
|||
package com.darkweb.genesissearchengine.appManager;
|
||||
|
||||
import android.util.Patterns;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.TextView;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.fabricManager;
|
||||
import com.darkweb.genesissearchengine.pluginManager.message_manager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
public class eventHandler
|
||||
{
|
||||
application_controller appContoller;
|
||||
|
||||
public eventHandler()
|
||||
{
|
||||
appContoller = app_model.getInstance().getAppInstance();
|
||||
}
|
||||
|
||||
public boolean onEditorClicked(TextView v, int actionId, KeyEvent event)
|
||||
{
|
||||
|
||||
if (actionId != EditorInfo.IME_ACTION_NEXT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
helperMethod.hideKeyboard();
|
||||
String url = helperMethod.completeURL(v.getText().toString());
|
||||
try
|
||||
{
|
||||
URL host = new URL(url);
|
||||
boolean isUrlValid = Patterns.WEB_URL.matcher(url).matches();
|
||||
|
||||
if(isUrlValid && host.getHost().replace("www.","").contains("."))
|
||||
{
|
||||
if(host.getHost().contains(constants.backendUrlHost) || host.getHost().contains(constants.frontEndUrlHost) || host.getHost().contains(constants.frontEndUrlHost_v1))
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("EDITOR BASE URL REQUEST : " + url);
|
||||
appContoller.onloadURL(url.replace(constants.frontEndUrlHost_v1,constants.backendUrlHost),false);
|
||||
return true;
|
||||
}
|
||||
else /*if(host.getHost().contains(constants.allowedHost))*/
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("EDITOR ONION URL REQUEST : " + url);
|
||||
app_model.getInstance().getAppInstance().onloadURL(url,true);
|
||||
return true;
|
||||
}/*
|
||||
else
|
||||
{
|
||||
message_manager.getInstance().baseURLError();
|
||||
return true;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
catch (IOException e){}
|
||||
|
||||
String editedURL = "https://boogle.store/search?q="+v.getText().toString().replaceAll(" ","+")+"&p_num=1&s_type=all&savesearch=on";
|
||||
appContoller.onloadURL(editedURL,false);
|
||||
appContoller.onClearSearchBarCursorView();
|
||||
fabricManager.getInstance().sendEvent("EDITOR SEARCHED : " + editedURL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onReloadButtonPressed(View view)
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("RELOAD BUTTON PRESSSED : ");
|
||||
appContoller.onReload();
|
||||
}
|
||||
|
||||
public void onHomeButtonPressed()
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("HOME BUTTON PRESSSED : ");
|
||||
applicationViewController.getInstance().checkSSLTextColor();
|
||||
appContoller.onloadURL(constants.backendUrlSlashed,false);
|
||||
helperMethod.hideKeyboard();
|
||||
appContoller.onUpdateSearchBarView(constants.frontUrlSlashed);
|
||||
appContoller.stopHiddenView();
|
||||
}
|
||||
|
||||
public void onFloatingButtonPressed()
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("FLOATING BUTTON PRESSSED : ");
|
||||
message_manager.getInstance().reportURL();
|
||||
}
|
||||
|
||||
public void onBackPressed()
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("BACK BUTTON PRESSSED : ");
|
||||
appContoller.onBackPressedView();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,199 @@
|
|||
package com.darkweb.genesissearchengine.appManager;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.fabricManager;
|
||||
import com.darkweb.genesissearchengine.pluginManager.orbot_manager;
|
||||
import org.mozilla.geckoview.GeckoRuntime;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
import org.mozilla.geckoview.GeckoView;
|
||||
|
||||
public class geckoClients
|
||||
{
|
||||
private GeckoSession session1 = null;
|
||||
private GeckoRuntime runtime1;
|
||||
private final Handler internetErrorHandler = new Handler();
|
||||
|
||||
boolean canSessionGoBack = false;
|
||||
boolean isRunning = false;
|
||||
boolean isContentLoading = false;
|
||||
String navigatedURL = "";
|
||||
|
||||
private boolean loadingCompeleted = false;
|
||||
private String currentURL = "";
|
||||
|
||||
public void loadGeckoURL(String url,GeckoView geckoView)
|
||||
{
|
||||
boolean init_status = orbot_manager.getInstance().initOrbot(url);
|
||||
if (init_status)
|
||||
{
|
||||
loadingCompeleted = false;
|
||||
initialize(geckoView);
|
||||
session1.loadUri(url);
|
||||
app_model.getInstance().getAppInstance().onRequestTriggered(true,url);
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(4);
|
||||
}
|
||||
}
|
||||
|
||||
public void initialize(GeckoView geckoView)
|
||||
{
|
||||
session1 = new GeckoSession();
|
||||
runtime1 = GeckoRuntime.getDefault(app_model.getInstance().getAppContext());
|
||||
session1.open(runtime1);
|
||||
geckoView.releaseSession();
|
||||
geckoView.setSession(session1);
|
||||
session1.setProgressDelegate(new progressDelegate());
|
||||
session1.setNavigationDelegate(new navigationDelegate());
|
||||
geckoView.setVisibility(View.VISIBLE);
|
||||
geckoView.setAlpha(1);
|
||||
}
|
||||
|
||||
class navigationDelegate implements GeckoSession.NavigationDelegate
|
||||
{
|
||||
@Override
|
||||
public void onLocationChange(GeckoSession session, String url)
|
||||
{
|
||||
navigatedURL = url;
|
||||
Log.i("SHITJ1",""+url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCanGoBack(GeckoSession session, boolean canGoBack)
|
||||
{
|
||||
canSessionGoBack = canGoBack;
|
||||
}
|
||||
}
|
||||
|
||||
class progressDelegate implements GeckoSession.ProgressDelegate
|
||||
{
|
||||
@Override
|
||||
public void onPageStart(GeckoSession session, String url)
|
||||
{
|
||||
isRunning = true;
|
||||
loadingCompeleted = false;
|
||||
currentURL = url;
|
||||
fabricManager.getInstance().sendEvent("ONION GECKO_CLIENT URL REQEST : " + url + "--");
|
||||
|
||||
if(navigatedURL.equals(currentURL))
|
||||
{
|
||||
isContentLoading = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
isContentLoading = true;
|
||||
}
|
||||
|
||||
Log.i("SHITJ2",""+navigatedURL + "--" + currentURL + "--" + isContentLoading);
|
||||
navigatedURL = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageStop(GeckoSession session, boolean success)
|
||||
{
|
||||
internetErrorHandler.removeCallbacksAndMessages(null);
|
||||
|
||||
internetErrorHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if(loadingCompeleted)
|
||||
{
|
||||
if(!success && !isContentLoading)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onInternetErrorView();
|
||||
fabricManager.getInstance().sendEvent("ONION GECKO_CLIENT URL ERROR : " + success + "--" + isContentLoading);
|
||||
}
|
||||
else if(success)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onDisableInternetError();
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(0);
|
||||
fabricManager.getInstance().sendEvent("ONION GECKO_CLIENT URL SUCCESS : " + success + "--" + isContentLoading);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onProgressChange(GeckoSession session, int progress)
|
||||
{
|
||||
if(progress>=100)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onPageFinished(true);
|
||||
loadingCompeleted = true;
|
||||
isContentLoading = false;
|
||||
}
|
||||
|
||||
if(progress>=5)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(progress);
|
||||
}
|
||||
else
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSecurityChange(GeckoSession session, SecurityInformation securityInfo)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onHiddenGoBack(GeckoView geckoView)
|
||||
{
|
||||
boolean init_status = orbot_manager.getInstance().initOrbot("");
|
||||
if (init_status)
|
||||
{
|
||||
if(canSessionGoBack)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onDisableInternetError();
|
||||
session1.goBack();
|
||||
fabricManager.getInstance().sendEvent("ONION LOCAL RETURNED : ");
|
||||
}
|
||||
else if(isRunning)
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("ONION RETURNED TO GENESIS : ");
|
||||
geckoView.releaseSession();
|
||||
stopHiddenView(geckoView);
|
||||
app_model.getInstance().getAppInstance().onUpdateView(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void stopHiddenView(GeckoView geckoView)
|
||||
{
|
||||
if(session1!=null)
|
||||
{
|
||||
isRunning = false;
|
||||
loadingCompeleted = false;
|
||||
session1.stop();
|
||||
session1.close();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isGeckoViewRunning()
|
||||
{
|
||||
return isRunning;
|
||||
}
|
||||
|
||||
public void onReloadHiddenView()
|
||||
{
|
||||
boolean init_status = orbot_manager.getInstance().initOrbot("");
|
||||
if (init_status)
|
||||
{
|
||||
if(session1!=null)
|
||||
{
|
||||
loadingCompeleted = false;
|
||||
session1.stop();
|
||||
session1.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package com.darkweb.genesissearchengine.appManager;
|
||||
|
||||
import android.util.Log;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.pluginManager.fabricManager;
|
||||
import com.darkweb.genesissearchengine.pluginManager.orbot_manager;
|
||||
|
||||
public class webviewClient
|
||||
{
|
||||
boolean isGeckoView = false;
|
||||
|
||||
public void loadWebViewClient(WebView webview)
|
||||
{
|
||||
WebViewClient client = new WebViewClient()
|
||||
{
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url)
|
||||
{
|
||||
isGeckoView = false;
|
||||
if(url.equals(view.getUrl()) && !app_model.getInstance().getAppInstance().isInternetErrorOpened() || url.contains("https://boogle.store/search?q=&"))
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(0);
|
||||
return true;
|
||||
}
|
||||
if(!url.contains("boogle"))
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("BASE SIMPLE SEARCHED : " + url);
|
||||
isGeckoView = true;
|
||||
if(orbot_manager.getInstance().initOrbot(url))
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onloadURL(url,true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("BASE ONION SEARCHED : " + url);
|
||||
app_model.getInstance().getAppInstance().onRequestTriggered(false,url);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url)
|
||||
{
|
||||
super.onPageFinished(view, url);
|
||||
app_model.getInstance().getAppInstance().onPageFinished(false);
|
||||
app_model.getInstance().getAppInstance().onUpdateSearchBarView(url);
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(0);
|
||||
status.isApplicationLoaded = true;
|
||||
fabricManager.getInstance().sendEvent("BASE SUCCESSFULLY LOADED : " + url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("BASE URL ERROR : " + failingUrl + "--" + description);
|
||||
app_model.getInstance().getAppInstance().onInternetErrorView();
|
||||
}
|
||||
};
|
||||
|
||||
webview.setWebViewClient(client);
|
||||
|
||||
webview.setWebChromeClient(new WebChromeClient()
|
||||
{
|
||||
public void onProgressChanged(WebView view, int newProgress)
|
||||
{
|
||||
if(!isGeckoView)
|
||||
{
|
||||
if(newProgress<95 && newProgress>5)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(newProgress);
|
||||
}
|
||||
else if(newProgress<=5)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ public class constants
|
|||
public static String backendUrlSlashed = "https://boogle.store/";
|
||||
public static String frontUrlSlashed = "https://genesis.onion/";
|
||||
public static String frontEndUrlHost = "genesis.store";
|
||||
public static String frontEndUrlHost_v1 = "genesis.onion";
|
||||
public static String allowedHost = ".onion";
|
||||
public static String reportUrl = "https://boogle.store/reportus?r_key=";
|
||||
public static String updateUrl = "https://boogle.store/manual?abi=";
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.darkweb.genesissearchengine.constants;
|
|||
|
||||
public class enums
|
||||
{
|
||||
/*Web Request*/
|
||||
public enum webRequestStatus{notRunning,running,repeat;}
|
||||
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ public class keys
|
|||
public static String proxy_socks_port = "network.proxy.socks_port";
|
||||
public static String proxy_socks_version = "network.proxy.socks_version";
|
||||
public static String proxy_socks_remote_dns = "network.proxy.socks_remote_dns";
|
||||
//public static String proxy_cache = "browser.cache.disk.enable";
|
||||
//public static String proxy_memory = "browser.cache.memory.enable";
|
||||
public static String proxy_cache = "browser.cache.disk.enable";
|
||||
public static String proxy_memory = "browser.cache.memory.enable";
|
||||
public static String proxy_useragent_override = "general.useragent.override";
|
||||
public static String proxy_donottrackheader_enabled = "privacy.donottrackheader.enabled";
|
||||
public static String proxy_donottrackheader_value = "privacy.donottrackheader.value";
|
||||
|
|
|
@ -6,5 +6,5 @@ public class messages
|
|||
public final static int LOCAL_HOMEPAGE_CACHED =3;
|
||||
public final static int INTERNET_ERROR =2;
|
||||
public final static int MESSAGE_UPDATE_TEXT_CHILD_THREAD =1;
|
||||
|
||||
public final static int LOAD_WEBVIEW_BACKGROUND = 2;
|
||||
}
|
||||
|
|
|
@ -5,4 +5,6 @@ public class status
|
|||
public static boolean isApplicationLoaded = false;
|
||||
public static boolean isPlayStoreInstalled = false;
|
||||
public static boolean isTorInitialized = false;
|
||||
|
||||
public static String version_code = "5.0";
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ public class strings
|
|||
public static String orbot_init_title = "Initializing";
|
||||
public static String orbot_init_desc = "Please wait! While we connect you to hidden web. This might take few minutes\n";
|
||||
public static String orbot_init_bt1 = "Dismiss";
|
||||
public static String orbot_init_bt2 = "Try Again";
|
||||
|
||||
public static String version_title = "Update Pending";
|
||||
public static String version_desc = "You have not updated this app for a while please update it to get best performance\n";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.darkweb.genesissearchengine.pluginManager;
|
||||
package com.darkweb.genesissearchengine.dataManager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import com.darkweb.genesissearchengine.appManager.app_model;
|
||||
|
||||
public class preference_manager
|
||||
{
|
||||
|
@ -21,9 +21,9 @@ public class preference_manager
|
|||
{
|
||||
}
|
||||
|
||||
public void initialize(Context applicationContext)
|
||||
public void initialize()
|
||||
{
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(applicationContext);
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(app_model.getInstance().getAppContext());
|
||||
edit = prefs.edit();
|
||||
}
|
||||
|
|
@ -2,13 +2,24 @@ package com.darkweb.genesissearchengine;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.RotateAnimation;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import com.darkweb.genesissearchengine.appManager.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.example.myapplication.BuildConfig;
|
||||
|
||||
public class helperMethod
|
||||
{
|
||||
|
@ -39,6 +50,17 @@ public class helperMethod
|
|||
|
||||
}
|
||||
|
||||
public static String completeURL(String url)
|
||||
{
|
||||
if(!url.startsWith("www.")&& !url.startsWith("http://")&& !url.startsWith("https://")){
|
||||
url = "www."+url;
|
||||
}
|
||||
if(!url.startsWith("http://")&&!url.startsWith("https://")){
|
||||
url = "http://"+url;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
public static void hideKeyboard()
|
||||
{
|
||||
View view = app_model.getInstance().getAppInstance().findViewById(android.R.id.content);
|
||||
|
@ -49,4 +71,82 @@ public class helperMethod
|
|||
}
|
||||
}
|
||||
|
||||
public static int screenHeight(boolean hasSoftKeys)
|
||||
{
|
||||
if(!hasSoftKeys)
|
||||
{
|
||||
return (int)(Resources.getSystem().getDisplayMetrics().heightPixels)-(helperMethod.getNavigationBarHeight());
|
||||
}
|
||||
else
|
||||
{
|
||||
return (int)(Resources.getSystem().getDisplayMetrics().heightPixels);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getNavigationBarHeight() {
|
||||
Resources resources = app_model.getInstance().getAppContext().getResources();
|
||||
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
return resources.getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static RotateAnimation getRotationAnimation()
|
||||
{
|
||||
RotateAnimation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
|
||||
rotate.setDuration(2000);
|
||||
rotate.setRepeatCount(Animation.INFINITE);
|
||||
return rotate;
|
||||
}
|
||||
|
||||
public static Bitmap screenShot(View view)
|
||||
{
|
||||
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
view.draw(canvas);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public static ViewGroup.MarginLayoutParams getCenterScreenPoint(ViewGroup.LayoutParams itemLayoutParams)
|
||||
{
|
||||
double heightloader = Resources.getSystem().getDisplayMetrics().heightPixels*0.78;
|
||||
ViewGroup.MarginLayoutParams params_loading = (ViewGroup.MarginLayoutParams) itemLayoutParams;
|
||||
params_loading.topMargin = (int)(heightloader);
|
||||
|
||||
return params_loading;
|
||||
}
|
||||
|
||||
public static boolean hasSoftKeys(WindowManager windowManager)
|
||||
{
|
||||
Display d = windowManager.getDefaultDisplay();
|
||||
|
||||
DisplayMetrics realDisplayMetrics = new DisplayMetrics();
|
||||
d.getRealMetrics(realDisplayMetrics);
|
||||
|
||||
int realHeight = realDisplayMetrics.heightPixels;
|
||||
int realWidth = realDisplayMetrics.widthPixels;
|
||||
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
d.getMetrics(displayMetrics);
|
||||
|
||||
int displayHeight = displayMetrics.heightPixels;
|
||||
int displayWidth = displayMetrics.widthPixels;
|
||||
|
||||
return (realWidth - displayWidth) > 0 || (realHeight - displayHeight) > 0;
|
||||
}
|
||||
|
||||
public static boolean isBuildValid ()
|
||||
{
|
||||
if(BuildConfig.FLAVOR.equals("aarch64")&& Build.SUPPORTED_ABIS[0].equals("arm64-v8a") || BuildConfig.FLAVOR.equals("arm")&&Build.SUPPORTED_ABIS[0].equals("armeabi-v7a") || BuildConfig.FLAVOR.equals("x86")&&Build.SUPPORTED_ABIS[0].equals("x86") || BuildConfig.FLAVOR.equals("x86_64")&&Build.SUPPORTED_ABIS[0].equals("x86_64"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class httpclient
|
|||
{
|
||||
try
|
||||
{
|
||||
String c_url = url.replace("http://boogle","https://boogle");
|
||||
String c_url = url.replace("http://boogle","https://boogle").replaceAll("genesis.onion","boogle.store").replaceAll("genesis.store","boogle.store");
|
||||
|
||||
HttpClient client=new DefaultHttpClient();;
|
||||
SSLConnectionSocketFactory scsf = new SSLConnectionSocketFactory(
|
||||
|
@ -55,15 +55,6 @@ public class httpclient
|
|||
in.close();
|
||||
|
||||
html = str.toString();
|
||||
if(c_url.equals(constants.backendUrlSlashed))
|
||||
{
|
||||
html = html.replace("/privacy","https://boogle.store/privacy").replace("/about","https://boogle.store/about").replace("/reportus","https://boogle.store/reportus").replace("\"search\"","https://boogle.store/search").replace("/create","https://boogle.store/create");
|
||||
helperMethod.setHomepageHTML(html, app_model.getInstance().getAppContext());
|
||||
}
|
||||
if(!isCachedRequest)
|
||||
{
|
||||
startPostTask(messages.MESSAGE_UPDATE_TEXT_CHILD_THREAD,updateUIHandler);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.darkweb.genesissearchengine.httpManager;
|
||||
|
||||
import android.content.Context;
|
||||
import com.darkweb.genesissearchengine.pluginManager.preference_manager;
|
||||
import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||
import cz.msebera.android.httpclient.client.HttpClient;
|
||||
import cz.msebera.android.httpclient.client.methods.HttpGet;
|
||||
import cz.msebera.android.httpclient.impl.client.DefaultHttpClient;
|
||||
|
@ -72,4 +72,14 @@ public class serverRequestManager
|
|||
}.start();
|
||||
}
|
||||
|
||||
public void versionChecker()
|
||||
{
|
||||
/*String version = preference_manager.getInstance().getString("version","none",this);
|
||||
if(!version.equals(version_code) && !version.equals("none"))
|
||||
{
|
||||
message_manager.getInstance().versionWarning(this,Build.SUPPORTED_ABIS[0]);
|
||||
}
|
||||
webRequestHandler.getInstance().getVersion(this);*/
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,13 +6,7 @@ import android.os.Message;
|
|||
|
||||
import android.os.Handler;
|
||||
import com.darkweb.genesissearchengine.appManager.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.enums;
|
||||
import com.darkweb.genesissearchengine.constants.messages;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
|
||||
import static com.darkweb.genesissearchengine.constants.enums.webRequestStatus.*;
|
||||
import static java.lang.Thread.sleep;
|
||||
|
||||
public class webRequestHandler
|
||||
{
|
||||
|
@ -20,7 +14,7 @@ public class webRequestHandler
|
|||
private String html = "";
|
||||
private Handler updateUIHandler = null;
|
||||
private httpclient client;
|
||||
|
||||
private String requestedUrl = "";
|
||||
|
||||
/*Initialization*/
|
||||
private static final webRequestHandler ourInstance = new webRequestHandler();
|
||||
|
@ -48,21 +42,8 @@ public class webRequestHandler
|
|||
|
||||
public void cachedURLSelector()
|
||||
{
|
||||
if(app_model.getInstance().getCurrentURL().equals(constants.backendUrlSlashed))
|
||||
{
|
||||
String html_local = helperMethod.readHomepageHTML(app_model.getInstance().getAppContext());
|
||||
if(html_local.length()>1)
|
||||
{
|
||||
html = html_local;
|
||||
client = new httpclient();
|
||||
client.httpConnection(app_model.getInstance().getCurrentURL(),updateUIHandler,true);
|
||||
startPostTask(messages.LOCAL_HOMEPAGE_CACHED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
client = new httpclient();
|
||||
client.httpConnection(app_model.getInstance().getCurrentURL(),updateUIHandler,false);
|
||||
client.httpConnection(requestedUrl,updateUIHandler,false);
|
||||
}
|
||||
|
||||
public void startPostTask(int m_id)
|
||||
|
@ -80,17 +61,13 @@ public class webRequestHandler
|
|||
@Override
|
||||
public void handleMessage(Message msg)
|
||||
{
|
||||
if(msg.what == messages.LOCAL_HOMEPAGE_CACHED)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().loadUrlOnWebview(html);
|
||||
}
|
||||
if(msg.what == messages.MESSAGE_UPDATE_TEXT_CHILD_THREAD)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().loadUrlOnWebview(client.getHtmlResponse());
|
||||
//app_model.getInstance().getAppInstance().onloadURL(client.getHtmlResponse());
|
||||
}
|
||||
else if (msg.what == messages.INTERNET_ERROR)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onInternetError();
|
||||
app_model.getInstance().getAppInstance().onInternetErrorView();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.darkweb.genesissearchengine.pluginManager;
|
|||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.crashlytics.android.answers.Answers;
|
||||
import com.crashlytics.android.answers.CustomEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -48,4 +50,11 @@ public class analyticmanager
|
|||
Crashlytics.setUserName(uniqueID);
|
||||
}
|
||||
|
||||
public void sendEvent(String value)
|
||||
{
|
||||
Answers.getInstance().logCustom(new CustomEvent(value)
|
||||
.putCustomAttribute(analyticmanager.getInstance().uniqueID,value));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.darkweb.genesissearchengine.pluginManager;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.crashlytics.android.answers.Answers;
|
||||
import com.crashlytics.android.answers.CustomEvent;
|
||||
import com.darkweb.genesissearchengine.appManager.app_model;
|
||||
import io.fabric.sdk.android.Fabric;
|
||||
|
||||
public class fabricManager
|
||||
{
|
||||
private static final fabricManager ourInstance = new fabricManager();
|
||||
|
||||
public static fabricManager getInstance()
|
||||
{
|
||||
return ourInstance;
|
||||
}
|
||||
|
||||
private fabricManager()
|
||||
{
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
Fabric.with(app_model.getInstance().getAppContext(), new Crashlytics());
|
||||
analyticmanager.getInstance().initialize(app_model.getInstance().getAppContext());
|
||||
analyticmanager.getInstance().logUser();
|
||||
}
|
||||
|
||||
public void sendEvent(String value)
|
||||
{
|
||||
analyticmanager.getInstance().sendEvent(value);
|
||||
}
|
||||
}
|
|
@ -4,18 +4,22 @@ import android.content.Context;
|
|||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import com.crowdfire.cfalertdialog.CFAlertDialog;
|
||||
import com.darkweb.genesissearchengine.appManager.app_model;
|
||||
import com.darkweb.genesissearchengine.appManager.application_controller;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||
import com.darkweb.genesissearchengine.httpManager.serverRequestManager;
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class message_manager
|
||||
{
|
||||
/*Initializations*/
|
||||
private boolean isPopupOn = false;
|
||||
|
||||
private static final message_manager ourInstance = new message_manager();
|
||||
|
||||
public static message_manager getInstance()
|
||||
|
@ -36,29 +40,28 @@ public class message_manager
|
|||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(application_context)
|
||||
.setDialogStyle(CFAlertDialog.CFAlertStyle.ALERT)
|
||||
.setTitle(strings.welcome_message_title)
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v1))
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v2))
|
||||
.setTextColor(application_context.getResources().getColor(R.color.blue_dark))
|
||||
.setMessage(strings.welcome_message_desc)
|
||||
|
||||
.addButton(strings.welcome_message_bt1, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED , (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
controller.initializePopupView(constants.blackMarket);
|
||||
controller.loadURLAnimate(constants.blackMarket);
|
||||
controller.onloadURL(constants.blackMarket,false);
|
||||
controller.onloadURL(constants.blackMarket,false);
|
||||
})
|
||||
.addButton(strings.welcome_message_bt2, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED , (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
controller.initializePopupView(constants.leakedDocument);
|
||||
controller.loadURLAnimate(constants.leakedDocument);
|
||||
controller.onloadURL(constants.leakedDocument,false);
|
||||
controller.onloadURL(constants.leakedDocument,false);
|
||||
})
|
||||
.addButton(strings.welcome_message_bt3, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED , (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
controller.initializePopupView(constants.news);
|
||||
controller.loadURLAnimate(constants.news);
|
||||
controller.onloadURL(constants.news,false);
|
||||
controller.onloadURL(constants.news,false);
|
||||
})
|
||||
.addButton(strings.welcome_message_bt4, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED , (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
controller.initializePopupView(constants.softwares);
|
||||
controller.loadURLAnimate(constants.softwares);
|
||||
controller.onloadURL(constants.softwares,false);
|
||||
controller.onloadURL(constants.softwares,false);
|
||||
})
|
||||
.addButton(strings.welcome_message_bt5, -1, -1, CFAlertDialog.CFAlertActionStyle.NEGATIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED , (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
|
@ -75,7 +78,7 @@ public class message_manager
|
|||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(application_context)
|
||||
.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)
|
||||
.setTitle(strings.base_error_title)
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v1))
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v2))
|
||||
.setTextColor(application_context.getResources().getColor(R.color.black))
|
||||
.setMessage(strings.base_error_desc)
|
||||
.addButton(strings.base_error_bt1, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.END, (dialog, which) -> {
|
||||
|
@ -91,7 +94,7 @@ public class message_manager
|
|||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(application_context)
|
||||
.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)
|
||||
.setTitle(strings.abi_error_title)
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v1))
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v2))
|
||||
.setTextColor(application_context.getResources().getColor(R.color.black))
|
||||
.onDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
|
@ -118,7 +121,7 @@ public class message_manager
|
|||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(application_context)
|
||||
.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)
|
||||
.setTitle(strings.report_success_title)
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v1))
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v2))
|
||||
.setTextColor(application_context.getResources().getColor(R.color.black))
|
||||
.setMessage(strings.report_success_desc)
|
||||
.addButton(strings.report_success_bt1, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED, (dialog, which) -> {
|
||||
|
@ -128,19 +131,19 @@ public class message_manager
|
|||
builder.show();
|
||||
}
|
||||
|
||||
public void reportURL(String URL)
|
||||
public void reportURL()
|
||||
{
|
||||
Context application_context = app_model.getInstance().getAppContext();
|
||||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(application_context)
|
||||
.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)
|
||||
.setTitle(strings.report_url_title)
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v1))
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v2))
|
||||
.setTextColor(application_context.getResources().getColor(R.color.black))
|
||||
.setMessage(strings.report_url_desc)
|
||||
.addButton(strings.report_url_bt1, -1, -1, CFAlertDialog.CFAlertActionStyle.NEGATIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED, (dialog, which) -> {
|
||||
|
||||
String reportURL = constants.reportUrl+URL;
|
||||
serverRequestManager.getInstance().reportURL(reportURL);
|
||||
//String reportURL = constants.reportUrl+URL;
|
||||
//serverRequestManager.getInstance().reportURL(reportURL);
|
||||
dialog.dismiss();
|
||||
reportedSuccessfully();
|
||||
})
|
||||
|
@ -151,20 +154,51 @@ public class message_manager
|
|||
builder.show();
|
||||
}
|
||||
|
||||
public void startingOrbotInfo()
|
||||
public void startingOrbotInfo(String url)
|
||||
{
|
||||
Context application_context = app_model.getInstance().getAppContext();
|
||||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(application_context)
|
||||
.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)
|
||||
.setTitle(strings.orbot_init_title)
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v1))
|
||||
.setTextColor(application_context.getResources().getColor(R.color.black))
|
||||
.setMessage(strings.orbot_init_desc)
|
||||
.addButton(strings.orbot_init_bt1, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.END, (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
});
|
||||
if(!isPopupOn)
|
||||
{
|
||||
isPopupOn = true;
|
||||
Context application_context = app_model.getInstance().getAppContext();
|
||||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(application_context)
|
||||
.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)
|
||||
.setTitle(strings.orbot_init_title)
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v2))
|
||||
.setTextColor(application_context.getResources().getColor(R.color.black))
|
||||
.setMessage(strings.orbot_init_desc)
|
||||
.onDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
isPopupOn = false;
|
||||
}
|
||||
})
|
||||
.addButton(strings.orbot_init_bt1, -1, -1, CFAlertDialog.CFAlertActionStyle.NEGATIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED, (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
isPopupOn = false;
|
||||
}).addButton(strings.orbot_init_bt2, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED, (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
isPopupOn = false;
|
||||
|
||||
builder.show();
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if(!url.equals(""))
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onloadURL(url,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onReload();
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
|
||||
});
|
||||
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
|
||||
public void versionWarning(String currentAbi)
|
||||
|
@ -173,7 +207,7 @@ public class message_manager
|
|||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(application_context)
|
||||
.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)
|
||||
.setTitle(strings.version_title)
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v1))
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v2))
|
||||
.setTextColor(application_context.getResources().getColor(R.color.black))
|
||||
.setMessage(strings.version_desc)
|
||||
.addButton(strings.version_bt1, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.END, (dialog, which) -> {
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
package com.darkweb.genesissearchengine.pluginManager;
|
||||
|
||||
import android.util.Log;
|
||||
import com.darkweb.genesissearchengine.appManager.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
import com.msopentech.thali.android.toronionproxy.AndroidOnionProxyManager;
|
||||
import com.msopentech.thali.toronionproxy.OnionProxyManager;
|
||||
import org.mozilla.gecko.PrefsHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class orbot_manager {
|
||||
|
||||
/*Private Variables*/
|
||||
|
@ -28,12 +32,11 @@ public class orbot_manager {
|
|||
}
|
||||
|
||||
/*Orbot Initialization*/
|
||||
public boolean initOrbot()
|
||||
public boolean initOrbot(String url)
|
||||
{
|
||||
if(!status.isTorInitialized)
|
||||
{
|
||||
message_manager.getInstance().startingOrbotInfo();
|
||||
initializeTorClient();
|
||||
message_manager.getInstance().startingOrbotInfo(url);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -42,6 +45,37 @@ public class orbot_manager {
|
|||
}
|
||||
}
|
||||
|
||||
public void reinitOrbot()
|
||||
{
|
||||
new Thread()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if(!isLoading && (onionProxyManager == null || !onionProxyManager.isRunning()))
|
||||
{
|
||||
if(onionProxyManager != null)
|
||||
{
|
||||
onionProxyManager.stop();
|
||||
}
|
||||
isLoading = false;
|
||||
status.isTorInitialized = false;
|
||||
initializeTorClient();
|
||||
}
|
||||
sleep(1000);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
public void initializeTorClient()
|
||||
{
|
||||
if(!isLoading)
|
||||
|
@ -61,29 +95,27 @@ public class orbot_manager {
|
|||
{
|
||||
break;
|
||||
}
|
||||
|
||||
onionProxyManager = new AndroidOnionProxyManager(app_model.getInstance().getAppContext(), fileStorageLocation);
|
||||
|
||||
int totalSecondsPerTorStartup = 4 * 60;
|
||||
int totalTriesPerTorStartup = 5;
|
||||
|
||||
boolean ok = onionProxyManager.startWithRepeat(totalSecondsPerTorStartup, totalTriesPerTorStartup);
|
||||
if (!ok) {
|
||||
return;
|
||||
} else {
|
||||
if (onionProxyManager.isRunning()) {
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
while (!onionProxyManager.isRunning()) {
|
||||
sleep(1000);
|
||||
}
|
||||
if (onionProxyManager.isRunning()) {
|
||||
app_model.getInstance().setPort(onionProxyManager.getIPv4LocalHostSocksPort());
|
||||
initializeProxy();
|
||||
sleep(1500);
|
||||
//sleep(1500);
|
||||
status.isTorInitialized = true;
|
||||
isLoading = false;
|
||||
break;
|
||||
}
|
||||
isLoading = false;
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
continue;
|
||||
|
@ -103,8 +135,8 @@ public class orbot_manager {
|
|||
PrefsHelper.setPref(keys.proxy_socks_port, app_model.getInstance().getPort()); //manual proxy settings
|
||||
PrefsHelper.setPref(keys.proxy_socks_version,constants.proxy_socks_version); //manual proxy settings
|
||||
PrefsHelper.setPref(keys.proxy_socks_remote_dns,constants.proxy_socks_remote_dns); //manual proxy settings
|
||||
//PrefsHelper.setPref(keys.proxy_cache,constants.proxy_cache);
|
||||
//PrefsHelper.setPref(keys.proxy_memory,constants.proxy_memory);
|
||||
PrefsHelper.setPref(keys.proxy_cache,constants.proxy_cache);
|
||||
PrefsHelper.setPref(keys.proxy_memory,constants.proxy_memory);
|
||||
PrefsHelper.setPref(keys.proxy_useragent_override, constants.proxy_useragent_override);
|
||||
PrefsHelper.setPref(keys.proxy_donottrackheader_enabled,constants.proxy_donottrackheader_enabled);
|
||||
PrefsHelper.setPref(keys.proxy_donottrackheader_value,constants.proxy_donottrackheader_value);
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.4 KiB |
|
@ -9,34 +9,41 @@
|
|||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<org.mozilla.geckoview.GeckoView
|
||||
android:id="@+id/webLoader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="1"
|
||||
android:layout_marginTop="55dp"
|
||||
tools:layout_editor_absoluteY="8dp" tools:layout_editor_absoluteX="8dp">
|
||||
</org.mozilla.geckoview.GeckoView>
|
||||
<!-- <ImageView
|
||||
android:id="@+id/pageLoader2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:alpha="1"
|
||||
android:clickable="false"
|
||||
android:layout_marginTop="55dp"
|
||||
tools:layout_editor_absoluteY="0dp" tools:layout_editor_absoluteX="0dp">
|
||||
</ImageView> -->
|
||||
<WebView
|
||||
android:id="@+id/pageLoader1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="55dp"
|
||||
android:alpha="1"
|
||||
android:background="@color/white"
|
||||
tools:layout_editor_absoluteY="0dp" tools:layout_editor_absoluteX="0dp">
|
||||
</WebView>
|
||||
<WebView
|
||||
android:id="@+id/pageLoader2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="55dp"
|
||||
tools:layout_editor_absoluteY="0dp" tools:layout_editor_absoluteX="0dp">
|
||||
</WebView>
|
||||
<org.mozilla.geckoview.GeckoView
|
||||
android:id="@+id/webLoader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:layout_marginTop="55dp"
|
||||
tools:layout_editor_absoluteY="8dp" tools:layout_editor_absoluteX="8dp">
|
||||
</org.mozilla.geckoview.GeckoView>
|
||||
</FrameLayout>
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:id="@+id/requestFailure"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:alpha="0"
|
||||
android:visibility="invisible"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -97,33 +104,41 @@
|
|||
</android.support.constraint.ConstraintLayout>
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_height="71dp"
|
||||
android:background="#00000000"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_height="65dp"
|
||||
android:id="@+id/topbar"
|
||||
android:orientation="vertical"
|
||||
android:background="#00000000"
|
||||
android:gravity="left" app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:ignore="RtlHardcoded,UselessParent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:orientation="horizontal"
|
||||
android:elevation="10dp"
|
||||
android:elevation="7dp"
|
||||
android:background="@xml/floating_button_border"
|
||||
android:gravity="left" app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:ignore="RtlHardcoded,UselessParent">
|
||||
<ImageButton
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="10.5dp"
|
||||
android:tint="@color/black"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:id="@+id/home"
|
||||
android:bottomRightRadius="13dp"
|
||||
android:bottomLeftRadius="13dp"
|
||||
android:topLeftRadius="13dp"
|
||||
android:topRightRadius="13dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_homeicon"
|
||||
android:onClick="onHomeButtonPressed"
|
||||
android:background="@xml/home_pressed_state"
|
||||
android:src="@drawable/icon_homeicon"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/todo"/>
|
||||
<EditText
|
||||
android:layout_width="0dp"
|
||||
|
@ -131,7 +146,7 @@
|
|||
android:textSize="16sp"
|
||||
android:textColor="@color/text_color_v2"
|
||||
android:selectAllOnFocus="true"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="15dp"
|
||||
android:textColorHighlight="@color/text_color_highlight_v1"
|
||||
android:background="@xml/search_back_default"
|
||||
|
@ -143,12 +158,14 @@
|
|||
android:inputType="textNoSuggestions"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:maxLines="1"
|
||||
android:id="@+id/search" android:layout_weight="1" android:importantForAutofill="no"
|
||||
tools:targetApi="o"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -156,10 +173,11 @@
|
|||
<ProgressBar
|
||||
style="@android:style/Widget.Holo.Light.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="108dp"
|
||||
android:layout_height="112dp"
|
||||
android:progressBackgroundTint="@color/white"
|
||||
android:id="@+id/progressBar"
|
||||
android:scaleY="0.6"
|
||||
android:alpha="0"
|
||||
android:scaleY="0.7"
|
||||
android:progressTint="@color/progress_tint"
|
||||
android:progress="50" app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
@ -189,6 +207,7 @@
|
|||
android:src="@drawable/icon_ban"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0"
|
||||
android:onClick="onFloatingButtonPressed"
|
||||
app:borderWidth="0dp"
|
||||
app:elevation="10dp"
|
||||
android:backgroundTint="@color/white"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<color name="text_color_highlight_v1">#b3d1ff</color>
|
||||
<color name="blue_dark">#00264d</color>
|
||||
<color name="blue_dark_v1">#212d45</color>
|
||||
<color name="blue_dark_v2">#CC212d45</color>
|
||||
|
||||
<color name="black">#000000</color>
|
||||
<color name="headerblack">#212f45</color>
|
||||
|
@ -20,4 +21,6 @@
|
|||
<color name="white">#ffffff</color>
|
||||
|
||||
<color name="progress_tint">#f32323</color>
|
||||
|
||||
<color name="dark_purple">#CC212d45</color>
|
||||
</resources>
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
<item>
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<stroke android:width="1px" android:color="@color/float_white" />
|
||||
<stroke android:width="0px" android:color="@color/float_white" />
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:top="1px" android:bottom="1px">
|
||||
<item android:top="0px" android:bottom="0px">
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<stroke android:width="1px" android:color="@color/white" />
|
||||
<solid android:color="@color/white" />
|
||||
<stroke android:width="0px" android:color="#00000000" />
|
||||
<solid android:color="#00000000" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
|
|
@ -1,55 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- disabled state-->
|
||||
<item
|
||||
|
||||
android:state_enabled="false"
|
||||
android:drawable="@color/holo_gray"
|
||||
>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" android:padding="10dp" >
|
||||
<!-- you can use any color you want I used here gray color-->
|
||||
<solid android:color="@color/button_gray"/>
|
||||
<corners android:radius="125dp"/>
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
<!-- pressed state / clicked state -->
|
||||
<item
|
||||
android:state_pressed="true"
|
||||
android:state_enabled="true"
|
||||
android:drawable="@color/holo_gray"
|
||||
>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" android:padding="10dp" >
|
||||
<!-- you can use any color you want I used here gray color-->
|
||||
<solid android:color="@color/button_gray"/>
|
||||
<corners android:radius="125dp"/>
|
||||
<item android:state_pressed="false">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="#ffffff"/>
|
||||
</shape>
|
||||
</item>
|
||||
<!-- focused state -->
|
||||
<item
|
||||
android:state_focused="true"
|
||||
android:state_enabled="true"
|
||||
android:drawable="@color/holo_gray"
|
||||
>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" android:padding="10dp" >
|
||||
<!-- you can use any color you want I used here gray color-->
|
||||
<solid android:color="@color/button_gray"/>
|
||||
<corners android:radius="125dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<!-- enabled state / default state-->
|
||||
<item
|
||||
android:state_enabled="true"
|
||||
android:drawable="@android:color/white"
|
||||
>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" android:padding="10dp" >
|
||||
<!-- you can use any color you want I used here gray color-->
|
||||
<solid android:color="@color/button_gray"/>
|
||||
<corners android:radius="125dp"/>
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/holo_gray"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -0,0 +1,2 @@
|
|||
configurations.maybeCreate("default")
|
||||
artifacts.add("default", file('tor-android-binary-0.3.4.9.aar'))
|
Binary file not shown.
Loading…
Reference in New Issue