mirror of https://github.com/LeOS-GSI/LeOS-Genesis
Bug Fixes
parent
248b434418
commit
320e33b48f
|
@ -101,10 +101,9 @@ dependencies {
|
||||||
|
|
||||||
implementation "org.mozilla.components:browser-engine-gecko:73.0.8"
|
implementation "org.mozilla.components:browser-engine-gecko:73.0.8"
|
||||||
implementation "org.mozilla.components:browser-icons:73.0.9"
|
implementation "org.mozilla.components:browser-icons:73.0.9"
|
||||||
implementation "org.mozilla.geckoview:geckoview:89.0.20210524222230"
|
implementation "org.mozilla.geckoview:geckoview:80.0.20200903001900"
|
||||||
implementation "org.mozilla.components:concept-fetch:73.0.9"
|
implementation "org.mozilla.components:concept-fetch:73.0.9"
|
||||||
implementation "org.mozilla.components:concept-base: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"
|
implementation "org.mozilla.components:support-utils:73.0.9"
|
||||||
|
|
||||||
/*Crashlytics*/
|
/*Crashlytics*/
|
||||||
|
@ -122,6 +121,7 @@ dependencies {
|
||||||
/* Helper Libraries */
|
/* Helper Libraries */
|
||||||
|
|
||||||
implementation files('libs/httpclientandroidlib-1.2.1.jar')
|
implementation files('libs/httpclientandroidlib-1.2.1.jar')
|
||||||
|
implementation 'com.coolerfall:android-http-download-manager:1.6.3'
|
||||||
implementation 'com.github.intelligo-systems:slight:1.1.3'
|
implementation 'com.github.intelligo-systems:slight:1.1.3'
|
||||||
implementation 'com.github.apl-devs:appintro:v4.2.2'
|
implementation 'com.github.apl-devs:appintro:v4.2.2'
|
||||||
implementation 'com.android.support:design:28.0.0'
|
implementation 'com.android.support:design:28.0.0'
|
||||||
|
|
|
@ -198,6 +198,7 @@
|
||||||
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
||||||
android:value="ca-app-pub-6985886044951738~4671482729" />
|
android:value="ca-app-pub-6985886044951738~4671482729" />
|
||||||
|
|
||||||
|
|
||||||
<!-- Development Build -->
|
<!-- Development Build -->
|
||||||
<!-- <meta-data
|
<!-- <meta-data
|
||||||
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
||||||
|
@ -274,6 +275,7 @@
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -31,7 +31,10 @@ public class activityStateManager extends Service {
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
Intent mServiceIntent = new Intent(this.getApplicationContext(), OrbotService.class);
|
Intent mServiceIntent = new Intent(this.getApplicationContext(), OrbotService.class);
|
||||||
this.stopService(mServiceIntent);
|
this.stopService(mServiceIntent);
|
||||||
|
|
||||||
|
if(OrbotService.getServiceObject()!=null){
|
||||||
OrbotService.getServiceObject().onDestroy();
|
OrbotService.getServiceObject().onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
status.sSettingIsAppStarted = false;
|
status.sSettingIsAppStarted = false;
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
@ -43,7 +46,9 @@ public class activityStateManager extends Service {
|
||||||
public void onTaskRemoved(Intent rootIntent) {
|
public void onTaskRemoved(Intent rootIntent) {
|
||||||
Intent mServiceIntent = new Intent(this.getApplicationContext(), OrbotService.class);
|
Intent mServiceIntent = new Intent(this.getApplicationContext(), OrbotService.class);
|
||||||
this.stopService(mServiceIntent);
|
this.stopService(mServiceIntent);
|
||||||
|
if(OrbotService.getServiceObject()!=null){
|
||||||
OrbotService.getServiceObject().onDestroy();
|
OrbotService.getServiceObject().onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
status.sSettingIsAppStarted = false;
|
status.sSettingIsAppStarted = false;
|
||||||
|
|
||||||
|
|
|
@ -3,16 +3,29 @@ package com.darkweb.genesissearchengine.appManager.homeManager.geckoManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import androidx.core.view.NestedScrollingChildHelper;
|
import androidx.core.view.NestedScrollingChildHelper;
|
||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewTreeObserver;
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
|
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||||
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.eventObserver;
|
import com.darkweb.genesissearchengine.eventObserver;
|
||||||
import org.mozilla.geckoview.GeckoView;
|
import org.mozilla.geckoview.GeckoView;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_DOWN;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_DOWN;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_DOWN_MOVE;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_UP;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_UP_ALWAYS;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_UP_ALWAYS;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_UP_MOVE;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.enums.etype.WAS_SCROLL_CHANGED;
|
||||||
|
|
||||||
public class NestedGeckoView extends GeckoView {
|
public class NestedGeckoView extends GeckoView {
|
||||||
private int mLastY;
|
private int mLastY;
|
||||||
|
@ -23,6 +36,10 @@ public class NestedGeckoView extends GeckoView {
|
||||||
private eventObserver.eventListener mEvent;
|
private eventObserver.eventListener mEvent;
|
||||||
private boolean mScrollable = true;
|
private boolean mScrollable = true;
|
||||||
private int mSwipeDistance = 0;
|
private int mSwipeDistance = 0;
|
||||||
|
private boolean mPressed = false;
|
||||||
|
private boolean mForcedScroll = false;
|
||||||
|
private int mScrollOffsetRoot = -1;
|
||||||
|
private int mBottomOffsetRange = 0;
|
||||||
|
|
||||||
public void onSetHomeEvent(eventObserver.eventListener pEvent){
|
public void onSetHomeEvent(eventObserver.eventListener pEvent){
|
||||||
mEvent = pEvent;
|
mEvent = pEvent;
|
||||||
|
@ -58,17 +75,34 @@ public class NestedGeckoView extends GeckoView {
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case MotionEvent.ACTION_MOVE:
|
case MotionEvent.ACTION_MOVE:
|
||||||
// mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED);
|
|
||||||
|
boolean mBottomReached = false;
|
||||||
|
Object mTemp = mEvent.invokeObserver(Collections.singletonList(null), WAS_SCROLL_CHANGED);
|
||||||
|
|
||||||
int deltaY = mLastY - eventY;
|
int deltaY = mLastY - eventY;
|
||||||
mSwipeDistance += deltaY;
|
mSwipeDistance += deltaY;
|
||||||
|
|
||||||
if(mSwipeDistance>=100 || mSwipeDistance<=-150){
|
if(mTemp!=null && (int)mTemp==mScrollOffsetRoot){
|
||||||
|
mBottomOffsetRange += 1;
|
||||||
|
if(mBottomOffsetRange>5){
|
||||||
|
mBottomReached = true;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
mBottomOffsetRange = 0;
|
||||||
|
mBottomReached = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mTemp!=null){
|
||||||
|
mScrollOffsetRoot = (int)mTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.i("wow", eventY + " -- " + deltaY);
|
||||||
|
|
||||||
|
if(mSwipeDistance>=350 || mSwipeDistance<=-350){
|
||||||
mScrollable = true;
|
mScrollable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean allowScroll = status.sFullScreenBrowsing && !status.sDisableExpandTemp && mScrollable;
|
final boolean allowScroll = status.sFullScreenBrowsing && !status.sDisableExpandTemp && (mScrollOffsetRoot>0 && mScrollable || mForcedScroll || mBottomReached);
|
||||||
|
|
||||||
|
|
||||||
if (allowScroll && dispatchNestedPreScroll(0, deltaY, mScrollConsumed, mScrollOffset)) {
|
if (allowScroll && dispatchNestedPreScroll(0, deltaY, mScrollConsumed, mScrollOffset)) {
|
||||||
deltaY -= mScrollConsumed[1];
|
deltaY -= mScrollConsumed[1];
|
||||||
|
@ -86,7 +120,6 @@ public class NestedGeckoView extends GeckoView {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(status.sFullScreenBrowsing){
|
if(status.sFullScreenBrowsing){
|
||||||
Log.i("wow1", eventY + "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -97,17 +130,34 @@ public class NestedGeckoView extends GeckoView {
|
||||||
mLastY = eventY;
|
mLastY = eventY;
|
||||||
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
|
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
|
||||||
mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_DOWN);
|
mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_DOWN);
|
||||||
|
mPressed = true;
|
||||||
|
|
||||||
|
new Handler().postDelayed(() ->
|
||||||
|
{
|
||||||
|
if(!mPressed && status.sFullScreenBrowsing && !status.sDisableExpandTemp){
|
||||||
|
if(mSwipeDistance>75){
|
||||||
|
mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_UP_MOVE);
|
||||||
|
mScrollable = true;
|
||||||
|
}
|
||||||
|
else if(mSwipeDistance<-75){
|
||||||
|
mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_DOWN_MOVE);
|
||||||
|
mScrollable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
|
mPressed = false;
|
||||||
mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_UP_ALWAYS);
|
mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_UP_ALWAYS);
|
||||||
case MotionEvent.ACTION_CANCEL:
|
case MotionEvent.ACTION_CANCEL:
|
||||||
// mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED);
|
mPressed = false;
|
||||||
stopNestedScroll();
|
stopNestedScroll();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// mEvent.invokeObserver(Collections.singletonList(null), GECKO_SCROLL_FINISHED);
|
mPressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute event handler from parent class in all cases
|
// Execute event handler from parent class in all cases
|
||||||
|
@ -163,4 +213,12 @@ public class NestedGeckoView extends GeckoView {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getPressedState(){
|
||||||
|
return mPressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setmForcedScroll(boolean pScroll){
|
||||||
|
mForcedScroll = pScroll;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -62,57 +62,57 @@ public class errorHandler
|
||||||
private String errorToString(final int error) {
|
private String errorToString(final int error) {
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case WebRequestError.ERROR_UNKNOWN:
|
case WebRequestError.ERROR_UNKNOWN:
|
||||||
return "ERROR_UNKNOWN" ;
|
return "ERROR_UNKNOWN | The network request tried to use an unknown socket type" ;
|
||||||
case WebRequestError.ERROR_SECURITY_SSL:
|
case WebRequestError.ERROR_SECURITY_SSL:
|
||||||
return "ERROR_SECURITY_SSL";
|
return "ERROR_SECURITY_SSL | SSL negotiation problems has occured";
|
||||||
case WebRequestError.ERROR_SECURITY_BAD_CERT:
|
case WebRequestError.ERROR_SECURITY_BAD_CERT:
|
||||||
return "ERROR_SECURITY_BAD_CERT";
|
return "ERROR_SECURITY_BAD_CERT | SSL certificate validation error has occured";
|
||||||
case WebRequestError.ERROR_NET_RESET:
|
case WebRequestError.ERROR_NET_RESET:
|
||||||
return "ERROR_NET_RESET";
|
return "ERROR_NET_RESET | The connection was reset";
|
||||||
case WebRequestError.ERROR_NET_INTERRUPT:
|
case WebRequestError.ERROR_NET_INTERRUPT:
|
||||||
return "ERROR_NET_INTERRUPT";
|
return "ERROR_NET_INTERRUPT | The network connection was interrupted";
|
||||||
case WebRequestError.ERROR_NET_TIMEOUT:
|
case WebRequestError.ERROR_NET_TIMEOUT:
|
||||||
return "ERROR_NET_TIMEOUT";
|
return "ERROR_NET_TIMEOUT | The network request timed out";
|
||||||
case WebRequestError.ERROR_CONNECTION_REFUSED:
|
case WebRequestError.ERROR_CONNECTION_REFUSED:
|
||||||
return "ERROR_CONNECTION_REFUSED";
|
return "ERROR_CONNECTION_REFUSED | The network request was refused by the server";
|
||||||
case WebRequestError.ERROR_UNKNOWN_PROTOCOL:
|
case WebRequestError.ERROR_UNKNOWN_PROTOCOL:
|
||||||
return "ERROR_UNKNOWN_PROTOCOL";
|
return "ERROR_UNKNOWN_PROTOCOL | An unknown protocol was specified";
|
||||||
case WebRequestError.ERROR_UNKNOWN_HOST:
|
case WebRequestError.ERROR_UNKNOWN_HOST:
|
||||||
return "ERROR_UNKNOWN_HOST";
|
return "ERROR_UNKNOWN_HOST | The host could not be resolved";
|
||||||
case WebRequestError.ERROR_UNKNOWN_SOCKET_TYPE:
|
case WebRequestError.ERROR_UNKNOWN_SOCKET_TYPE:
|
||||||
return "ERROR_UNKNOWN_SOCKET_TYPE";
|
return "ERROR_UNKNOWN_SOCKET_TYPE | The network request tried to use an unknown socket type";
|
||||||
case WebRequestError.ERROR_UNKNOWN_PROXY_HOST:
|
case WebRequestError.ERROR_UNKNOWN_PROXY_HOST:
|
||||||
return "ERROR_UNKNOWN_PROXY_HOST";
|
return "ERROR_UNKNOWN_PROXY_HOST | The host name of the proxy server could not be resolved";
|
||||||
case WebRequestError.ERROR_MALFORMED_URI:
|
case WebRequestError.ERROR_MALFORMED_URI:
|
||||||
return "ERROR_MALFORMED_URI";
|
return "ERROR_MALFORMED_URI | An invalid URL was specified";
|
||||||
case WebRequestError.ERROR_REDIRECT_LOOP:
|
case WebRequestError.ERROR_REDIRECT_LOOP:
|
||||||
return "ERROR_REDIRECT_LOOP";
|
return "ERROR_REDIRECT_LOOP | A redirect loop was detected";
|
||||||
case WebRequestError.ERROR_SAFEBROWSING_PHISHING_URI:
|
case WebRequestError.ERROR_SAFEBROWSING_PHISHING_URI:
|
||||||
return "ERROR_SAFEBROWSING_PHISHING_URI";
|
return "ERROR_SAFEBROWSING_PHISHING_URI | The requested URI was present in the \"phishing\" blocklist";
|
||||||
case WebRequestError.ERROR_SAFEBROWSING_MALWARE_URI:
|
case WebRequestError.ERROR_SAFEBROWSING_MALWARE_URI:
|
||||||
return "ERROR_SAFEBROWSING_MALWARE_URI";
|
return "ERROR_SAFEBROWSING_MALWARE_URI | The requested URI was present in the \"malware\" blocklist";
|
||||||
case WebRequestError.ERROR_SAFEBROWSING_UNWANTED_URI:
|
case WebRequestError.ERROR_SAFEBROWSING_UNWANTED_URI:
|
||||||
return "ERROR_SAFEBROWSING_UNWANTED_URI";
|
return "ERROR_SAFEBROWSING_UNWANTED_URI | The requested URI was present in the \"unwanted\" blocklist";
|
||||||
case WebRequestError.ERROR_SAFEBROWSING_HARMFUL_URI:
|
case WebRequestError.ERROR_SAFEBROWSING_HARMFUL_URI:
|
||||||
return "ERROR_SAFEBROWSING_HARMFUL_URI";
|
return "ERROR_SAFEBROWSING_HARMFUL_URI | The requested URI was present in the \"harmful\" blocklist";
|
||||||
case WebRequestError.ERROR_CONTENT_CRASHED:
|
case WebRequestError.ERROR_CONTENT_CRASHED:
|
||||||
return "ERROR_CONTENT_CRASHED";
|
return "ERROR_CONTENT_CRASHED | The content process crashed";
|
||||||
case WebRequestError.ERROR_OFFLINE:
|
case WebRequestError.ERROR_OFFLINE:
|
||||||
return "ERROR_OFFLINE";
|
return "ERROR_OFFLINE | This device does not have a network connection";
|
||||||
case WebRequestError.ERROR_PORT_BLOCKED:
|
case WebRequestError.ERROR_PORT_BLOCKED:
|
||||||
return "ERROR_PORT_BLOCKED";
|
return "ERROR_PORT_BLOCKED | The request tried to use a port that is blocked by either the OS or Gecko";
|
||||||
case WebRequestError.ERROR_PROXY_CONNECTION_REFUSED:
|
case WebRequestError.ERROR_PROXY_CONNECTION_REFUSED:
|
||||||
return "ERROR_PROXY_CONNECTION_REFUSED";
|
return "ERROR_PROXY_CONNECTION_REFUSED | The proxy server refused the connection";
|
||||||
case WebRequestError.ERROR_FILE_NOT_FOUND:
|
case WebRequestError.ERROR_FILE_NOT_FOUND:
|
||||||
return "ERROR_FILE_NOT_FOUND";
|
return "ERROR_FILE_NOT_FOUND | A file was not found";
|
||||||
case WebRequestError.ERROR_FILE_ACCESS_DENIED:
|
case WebRequestError.ERROR_FILE_ACCESS_DENIED:
|
||||||
return "ERROR_FILE_ACCESS_DENIED";
|
return "ERROR_FILE_ACCESS_DENIED | The OS blocked access to a file";
|
||||||
case WebRequestError.ERROR_INVALID_CONTENT_ENCODING:
|
case WebRequestError.ERROR_INVALID_CONTENT_ENCODING:
|
||||||
return "ERROR_INVALID_CONTENT_ENCODING";
|
return "ERROR_INVALID_CONTENT_ENCODING | The content has an invalid encoding";
|
||||||
case WebRequestError.ERROR_UNSAFE_CONTENT_TYPE:
|
case WebRequestError.ERROR_UNSAFE_CONTENT_TYPE:
|
||||||
return "ERROR_UNSAFE_CONTENT_TYPE";
|
return "ERROR_UNSAFE_CONTENT_TYPE | A content type was returned which was deemed unsafe";
|
||||||
case WebRequestError.ERROR_CORRUPTED_CONTENT:
|
case WebRequestError.ERROR_CORRUPTED_CONTENT:
|
||||||
return "ERROR_CORRUPTED_CONTENT";
|
return "ERROR_CORRUPTED_CONTENT | The content returned was corrupted";
|
||||||
default:
|
default:
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
}
|
}
|
||||||
|
@ -122,13 +122,13 @@ public class errorHandler
|
||||||
switch (category)
|
switch (category)
|
||||||
{
|
{
|
||||||
case WebRequestError.ERROR_CATEGORY_UNKNOWN:
|
case WebRequestError.ERROR_CATEGORY_UNKNOWN:
|
||||||
return "ERROR_CATEGORY_UNKNOWN";
|
return "ERROR_CATEGORY_UNKNOWN | " + "Unknown error occured from the server side";
|
||||||
case WebRequestError.ERROR_CATEGORY_SECURITY:
|
case WebRequestError.ERROR_CATEGORY_SECURITY:
|
||||||
return "ERROR_CATEGORY_SECURITY";
|
return "ERROR_CATEGORY_SECURITY | SSL certificate validation error has occured";
|
||||||
case WebRequestError.ERROR_CATEGORY_NETWORK:
|
case WebRequestError.ERROR_CATEGORY_NETWORK:
|
||||||
return "ERROR_CATEGORY_NETWORK";
|
return "ERROR_CATEGORY_NETWORK | A network related problem has occured";
|
||||||
case WebRequestError.ERROR_CATEGORY_CONTENT:
|
case WebRequestError.ERROR_CATEGORY_CONTENT:
|
||||||
return "ERROR_CATEGORY_CONTENT";
|
return "ERROR_CATEGORY_CONTENT | Invalid or corrupt webpage";
|
||||||
case WebRequestError.ERROR_CATEGORY_URI:
|
case WebRequestError.ERROR_CATEGORY_URI:
|
||||||
return "ERROR_CATEGORY_URI";
|
return "ERROR_CATEGORY_URI";
|
||||||
case WebRequestError.ERROR_CATEGORY_PROXY:
|
case WebRequestError.ERROR_CATEGORY_PROXY:
|
||||||
|
|
|
@ -453,6 +453,10 @@ public class geckoClients
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getScrollOffset(){
|
||||||
|
return mSession.getScrollOffset();
|
||||||
|
}
|
||||||
|
|
||||||
public class geckoViewClientCallback implements eventObserver.eventListener{
|
public class geckoViewClientCallback implements eventObserver.eventListener{
|
||||||
@Override
|
@Override
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
|
@ -460,14 +464,15 @@ public class geckoClients
|
||||||
if(e_type.equals(enums.etype.M_CHANGE_HOME_THEME)){
|
if(e_type.equals(enums.etype.M_CHANGE_HOME_THEME)){
|
||||||
reinitHomeTheme();
|
reinitHomeTheme();
|
||||||
}
|
}
|
||||||
else if(mSession!=null && mSession.isClosed()){
|
else if(mSession!=null) {
|
||||||
return null;
|
|
||||||
}else if(mSession!=null) {
|
|
||||||
if(e_type.equals(enums.etype.SESSION_ID)){
|
if(e_type.equals(enums.etype.SESSION_ID)){
|
||||||
return mSession.getSessionID();
|
return mSession.getSessionID();
|
||||||
}
|
}
|
||||||
else if (mSessionID!=null && mSessionID.equals(data.get(1)) || e_type.equals(enums.etype.M_RATE_COUNT) || e_type.equals(enums.etype.FINDER_RESULT_CALLBACK) || e_type.equals(enums.etype.ON_UPDATE_TAB_TITLE) || e_type.equals(enums.etype.on_update_favicon) ||e_type.equals(enums.etype.on_update_history) || e_type.equals(enums.etype.on_request_completed) || e_type.equals(enums.etype.on_update_suggestion) || e_type.equals(enums.etype.on_update_suggestion_url))
|
else if (mSessionID!=null && mSessionID.equals(data.get(1)) || e_type.equals(enums.etype.M_RATE_COUNT) || e_type.equals(enums.etype.FINDER_RESULT_CALLBACK) || e_type.equals(enums.etype.ON_UPDATE_TAB_TITLE) || e_type.equals(enums.etype.on_update_favicon) ||e_type.equals(enums.etype.on_update_history) || e_type.equals(enums.etype.on_request_completed) || e_type.equals(enums.etype.on_update_suggestion) || e_type.equals(enums.etype.on_update_suggestion_url))
|
||||||
{
|
{
|
||||||
|
if(mSession!=null && mSession.isClosed()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (e_type.equals(on_handle_external_intent))
|
if (e_type.equals(on_handle_external_intent))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -101,6 +101,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
private boolean mPreviousErrorPage = false;
|
private boolean mPreviousErrorPage = false;
|
||||||
private boolean mRemovableFromBackPressed = false;
|
private boolean mRemovableFromBackPressed = false;
|
||||||
private boolean mThemeChanged = false;
|
private boolean mThemeChanged = false;
|
||||||
|
private int mScollOffset = 0;
|
||||||
|
|
||||||
/*Temp Variables*/
|
/*Temp Variables*/
|
||||||
private GeckoSession.HistoryDelegate.HistoryList mHistoryList = null;
|
private GeckoSession.HistoryDelegate.HistoryList mHistoryList = null;
|
||||||
|
@ -177,6 +178,10 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSessionReinit(){
|
public void onSessionReinit(){
|
||||||
|
if(mClosed){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mCrashCount = 0;
|
mCrashCount = 0;
|
||||||
if(!isFirstPaintExecuted){
|
if(!isFirstPaintExecuted){
|
||||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.ON_SESSION_REINIT);
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id), enums.etype.ON_SESSION_REINIT);
|
||||||
|
@ -215,7 +220,19 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
/*Scroll Delegate*/
|
/*Scroll Delegate*/
|
||||||
@UiThread
|
@UiThread
|
||||||
public void onScrollChanged(@NonNull GeckoSession session, int scrollX, int scrollY) {
|
public void onScrollChanged(@NonNull GeckoSession session, int scrollX, int scrollY) {
|
||||||
|
mScollOffset = scrollY;
|
||||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_UPDATE_PIXEL_BACKGROUND);
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_UPDATE_PIXEL_BACKGROUND);
|
||||||
|
if(scrollY<=3){
|
||||||
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_ON_SCROLL_TOP_BOUNDARIES);
|
||||||
|
}else if(scrollY<=helperMethod.pxFromDp(30)){
|
||||||
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_ON_SCROLL_BOUNDARIES);
|
||||||
|
}else {
|
||||||
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_ON_SCROLL_NO_BOUNDARIES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getScrollOffset(){
|
||||||
|
return mScollOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Autofill Delegate*/
|
/*Autofill Delegate*/
|
||||||
|
@ -462,6 +479,12 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
|
|
||||||
public GeckoResult<AllowOrDeny> onLoadRequest(@NonNull GeckoSession var2, @NonNull GeckoSession.NavigationDelegate.LoadRequest var1) {
|
public GeckoResult<AllowOrDeny> onLoadRequest(@NonNull GeckoSession var2, @NonNull GeckoSession.NavigationDelegate.LoadRequest var1) {
|
||||||
mPreviousErrorPage = false;
|
mPreviousErrorPage = false;
|
||||||
|
|
||||||
|
if(var1.uri.endsWith("genesisconfigurenewidentity.com/")){
|
||||||
|
initURL(mPrevURL);
|
||||||
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.M_NEW_IDENTITY_MESSAGED);
|
||||||
|
return GeckoResult.fromValue(AllowOrDeny.DENY);
|
||||||
|
}
|
||||||
if(!var1.uri.startsWith(CONST_GENESIS_URL_CACHED) && !var1.uri.startsWith(CONST_GENESIS_URL_CACHED_DARK) && var1.uri.startsWith("https://genesishiddentechnologies.com") && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY) && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY)){
|
if(!var1.uri.startsWith(CONST_GENESIS_URL_CACHED) && !var1.uri.startsWith(CONST_GENESIS_URL_CACHED_DARK) && var1.uri.startsWith("https://genesishiddentechnologies.com") && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY) && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY)){
|
||||||
String mVerificationURL = setGenesisVerificationToken(var1.uri);
|
String mVerificationURL = setGenesisVerificationToken(var1.uri);
|
||||||
initURL(mVerificationURL);
|
initURL(mVerificationURL);
|
||||||
|
@ -548,6 +571,9 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
|
|
||||||
|
|
||||||
public GeckoResult<String> onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) {
|
public GeckoResult<String> onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) {
|
||||||
|
if(mCurrentURL.contains("genesis.onion")){
|
||||||
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.M_NEW_IDENTITY);
|
||||||
|
}
|
||||||
if(status.sSettingIsAppStarted && orbotLocalConstants.mIsTorInitialized){
|
if(status.sSettingIsAppStarted && orbotLocalConstants.mIsTorInitialized){
|
||||||
errorHandler handler = new errorHandler();
|
errorHandler handler = new errorHandler();
|
||||||
mProgress = 0;
|
mProgress = 0;
|
||||||
|
@ -651,15 +677,22 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
int mCrashCount = 0;
|
int mCrashCount = 0;
|
||||||
@UiThread
|
@UiThread
|
||||||
public void onCrash(@NonNull GeckoSession session) {
|
public void onCrash(@NonNull GeckoSession session) {
|
||||||
if(!mClosed){
|
if(!mClosed && status.sSettingIsAppStarted){
|
||||||
String mSessionID = (String) event.invokeObserver(null, enums.etype.SESSION_ID);
|
if(event!=null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Object mSessionObject = event.invokeObserver(null, enums.etype.SESSION_ID);
|
||||||
|
if(mSessionObject==null || getSessionID()==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String mSessionID = (String) mSessionObject;
|
||||||
if(mSessionID.equals(getSessionID())){
|
if(mSessionID.equals(getSessionID())){
|
||||||
if(mCrashCount<=5){
|
if(mCrashCount<=5){
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
handler.postDelayed(() -> {
|
handler.postDelayed(() -> {
|
||||||
if(!session.isOpen()){
|
try {
|
||||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION);
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION);
|
||||||
}
|
}catch (Exception ignored){}
|
||||||
}, mCrashCount*500);
|
}, mCrashCount*500);
|
||||||
}
|
}
|
||||||
mCrashCount+=1;
|
mCrashCount+=1;
|
||||||
|
@ -669,14 +702,25 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
|
|
||||||
@UiThread
|
@UiThread
|
||||||
public void onKill(@NonNull GeckoSession session) {
|
public void onKill(@NonNull GeckoSession session) {
|
||||||
if(!mClosed){
|
if(!mClosed && status.sSettingIsAppStarted){
|
||||||
String mSessionID = (String) event.invokeObserver(null, enums.etype.SESSION_ID);
|
if(event!=null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Object mSessionObject = event.invokeObserver(null, enums.etype.SESSION_ID);
|
||||||
|
if(mSessionObject==null || getSessionID()==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String mSessionID = (String) mSessionObject;
|
||||||
|
|
||||||
|
|
||||||
if(mSessionID.equals(getSessionID())){
|
if(mSessionID.equals(getSessionID())){
|
||||||
if(mCrashCount<=5){
|
if(mCrashCount<=5){
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
handler.postDelayed(() -> {
|
handler.postDelayed(() -> {
|
||||||
if(!session.isOpen()){
|
if(status.sSettingIsAppStarted && !session.isOpen()){
|
||||||
|
try {
|
||||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION);
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION);
|
||||||
|
}catch (Exception ignored){}
|
||||||
}
|
}
|
||||||
}, mCrashCount*500);
|
}, mCrashCount*500);
|
||||||
}
|
}
|
||||||
|
@ -971,7 +1015,10 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
|
|
||||||
public void closeSessionInstant(){
|
public void closeSessionInstant(){
|
||||||
mSessionID = "-1";
|
mSessionID = "-1";
|
||||||
|
new Handler().postDelayed(() ->
|
||||||
|
{
|
||||||
mClosed = true;
|
mClosed = true;
|
||||||
|
}, 250);
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,6 +1060,11 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
void goBackSession(){
|
void goBackSession(){
|
||||||
wasBackPressed = true;
|
wasBackPressed = true;
|
||||||
goBack();
|
goBack();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (mHistoryList!=null && mHistoryList.size()>=1)
|
||||||
|
event.invokeObserver(Arrays.asList(mHistoryList.get(mHistoryList.getCurrentIndex()-1).getUri(),mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
|
||||||
|
}catch (Exception ignored){}
|
||||||
}
|
}
|
||||||
|
|
||||||
void goForwardSession(){
|
void goForwardSession(){
|
||||||
|
@ -1053,7 +1105,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
|
||||||
|
|
||||||
private void checkApplicationRate(){
|
private void checkApplicationRate(){
|
||||||
if(status.sSettingIsAppStarted){
|
if(status.sSettingIsAppStarted){
|
||||||
if(status.sRateCount==40){
|
if(status.sRateCount==10){
|
||||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), M_RATE_APPLICATION);
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), M_RATE_APPLICATION);
|
||||||
}
|
}
|
||||||
status.sRateCount+=1;
|
status.sRateCount+=1;
|
||||||
|
|
|
@ -232,7 +232,9 @@ public class selectionActionDelegate implements ActionMode.Callback,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (id.equals("SEARCH")) {
|
if (id.equals("SEARCH")) {
|
||||||
|
if(activityContextManager.getInstance()!=null && activityContextManager.getInstance().getHomeController()!=null){
|
||||||
activityContextManager.getInstance().getHomeController().onSearchString(mSelection.text);
|
activityContextManager.getInstance().getHomeController().onSearchString(mSelection.text);
|
||||||
|
}
|
||||||
clearSelection();
|
clearSelection();
|
||||||
mActionMode.finish();
|
mActionMode.finish();
|
||||||
return false;
|
return false;
|
||||||
|
@ -415,12 +417,13 @@ public class selectionActionDelegate implements ActionMode.Callback,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
if (mUseFloatingToolbar) {
|
if (mUseFloatingToolbar) {
|
||||||
mActionMode = mActivity.startActionMode(new Callback2Wrapper(),
|
mActionMode = mActivity.startActionMode(new Callback2Wrapper(),ActionMode.TYPE_FLOATING);
|
||||||
ActionMode.TYPE_FLOATING);
|
|
||||||
} else {
|
} else {
|
||||||
mActionMode = mActivity.startActionMode(this);
|
mActionMode = mActivity.startActionMode(this);
|
||||||
}
|
}
|
||||||
|
}catch (Exception ignored){}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.darkweb.genesissearchengine.appManager.homeManager.homeController;
|
package com.darkweb.genesissearchengine.appManager.homeManager.homeController;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.ActivityOptions;
|
|
||||||
import android.app.DownloadManager;
|
import android.app.DownloadManager;
|
||||||
|
import android.app.Notification;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ComponentCallbacks2;
|
import android.content.ComponentCallbacks2;
|
||||||
|
@ -14,6 +14,7 @@ import android.content.res.Configuration;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Rect;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -31,6 +32,7 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import android.webkit.URLUtil;
|
import android.webkit.URLUtil;
|
||||||
import android.widget.*;
|
import android.widget.*;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
@ -81,7 +83,6 @@ import org.torproject.android.proxy.util.Prefs;
|
||||||
import org.torproject.android.proxy.wrapper.LocaleHelper;
|
import org.torproject.android.proxy.wrapper.LocaleHelper;
|
||||||
import org.torproject.android.proxy.wrapper.orbotLocalConstants;
|
import org.torproject.android.proxy.wrapper.orbotLocalConstants;
|
||||||
|
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
@ -99,9 +100,12 @@ import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_
|
||||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED;
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED;
|
||||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED_DARK;
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED_DARK;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_DOWN;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_DOWN;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_DOWN_MOVE;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_UP_MOVE;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.M_INITIALIZE_TAB_LINK;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.M_INITIALIZE_TAB_LINK;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.M_INITIALIZE_TAB_SINGLE;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.M_INITIALIZE_TAB_SINGLE;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.M_NEW_LINK_IN_NEW_TAB;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.M_NEW_LINK_IN_NEW_TAB;
|
||||||
|
import static com.darkweb.genesissearchengine.constants.enums.etype.WAS_SCROLL_CHANGED;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.open_new_tab;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.open_new_tab;
|
||||||
import static com.darkweb.genesissearchengine.constants.sql.SQL_CLEAR_HISTORY;
|
import static com.darkweb.genesissearchengine.constants.sql.SQL_CLEAR_HISTORY;
|
||||||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.*;
|
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.*;
|
||||||
|
@ -178,6 +182,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
|
|
||||||
/*-------------------------------------------------------INITIALIZATION-------------------------------------------------------*/
|
/*-------------------------------------------------------INITIALIZATION-------------------------------------------------------*/
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
|
@ -195,7 +200,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.home_view);
|
setContentView(R.layout.home_view);
|
||||||
|
|
||||||
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
|
/* Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
|
||||||
status.sSettingIsAppStarted = false;
|
status.sSettingIsAppStarted = false;
|
||||||
finishAndRemoveTask();
|
finishAndRemoveTask();
|
||||||
|
|
||||||
|
@ -206,7 +211,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
this.finish();
|
this.finish();
|
||||||
|
|
||||||
Runtime.getRuntime().exit(0);
|
Runtime.getRuntime().exit(0);
|
||||||
});
|
}); */
|
||||||
|
|
||||||
initPreFixes();
|
initPreFixes();
|
||||||
activityContextManager.getInstance().setHomeController(this);
|
activityContextManager.getInstance().setHomeController(this);
|
||||||
|
@ -339,7 +344,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
if(!status.mThemeApplying){
|
if(!status.mThemeApplying){
|
||||||
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(), false, false, false);
|
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(), false, false, false);
|
||||||
}
|
}
|
||||||
onLoadTab(model.getSession(),false,true);
|
onLoadTab(model.getSession(),false,true, false);
|
||||||
}else {
|
}else {
|
||||||
onNewIntent(getIntent());
|
onNewIntent(getIntent());
|
||||||
onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
||||||
|
@ -580,7 +585,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mGeckoClient.loadURL(url.replace("genesis.onion","genesishiddentechnologies.com"),mGeckoView, homeController.this);
|
mGeckoClient.loadURL(url.replace("genesis.onion","genesishiddentechnologies.com"),mGeckoView, homeController.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLoadTab(geckoSession mTempSession, boolean isSessionClosed, boolean pExpandAppBar){
|
public void onLoadTab(geckoSession mTempSession, boolean isSessionClosed, boolean pExpandAppBar, boolean pForced){
|
||||||
|
|
||||||
if(!isSessionClosed){
|
if(!isSessionClosed){
|
||||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.MOVE_TAB_TO_TOP, Collections.singletonList(mTempSession));
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.MOVE_TAB_TO_TOP, Collections.singletonList(mTempSession));
|
||||||
|
@ -630,7 +635,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mHomeViewController.updateBannerAdvertStatus(true, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
|
mHomeViewController.updateBannerAdvertStatus(true, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
|
||||||
}
|
}
|
||||||
|
|
||||||
mHomeViewController.onProgressBarUpdate(mGeckoClient.getSession().getProgress(),true);
|
//if(!pForced){
|
||||||
|
if(mGeckoClient.getSession().getProgress()!=100){
|
||||||
|
mHomeViewController.onProgressBarUpdate(mTempSession.getProgress(),true);
|
||||||
|
}
|
||||||
|
//}
|
||||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false));
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false));
|
||||||
|
|
||||||
|
|
||||||
|
@ -769,6 +778,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
private void initializeLocalEventHandlers() {
|
private void initializeLocalEventHandlers() {
|
||||||
|
|
||||||
|
@ -814,11 +824,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
if (actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_GO || actionId == EditorInfo.IME_ACTION_DONE)
|
if (actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_GO || actionId == EditorInfo.IME_ACTION_DONE)
|
||||||
{
|
{
|
||||||
onSearchBarInvoked(v);
|
onSearchBarInvoked(v);
|
||||||
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),true,true, false);
|
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true, false);
|
||||||
mHomeViewController.onClearSelections(true);
|
mHomeViewController.onClearSelections(true);
|
||||||
mGeckoClient.setLoading(true);
|
mGeckoClient.setLoading(true);
|
||||||
final Handler handler = new Handler();
|
|
||||||
handler.postDelayed(() -> mHomeViewController.onClearSelections(false), 500);
|
mSearchbar.clearFocus();
|
||||||
|
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,false, true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
@ -953,6 +964,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
if(!isFocusChanging){
|
if(!isFocusChanging){
|
||||||
if(!status.mThemeApplying){
|
if(!status.mThemeApplying){
|
||||||
mHomeViewController.initSearchBarFocus(true, isKeyboardOpened);
|
mHomeViewController.initSearchBarFocus(true, isKeyboardOpened);
|
||||||
|
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),true,true, false);
|
||||||
}
|
}
|
||||||
isSuggestionChanged = true;
|
isSuggestionChanged = true;
|
||||||
isSuggestionSearchOpened = false;
|
isSuggestionSearchOpened = false;
|
||||||
|
@ -961,14 +973,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
});
|
});
|
||||||
|
|
||||||
KeyboardUtils.addKeyboardToggleListener(this, isVisible -> isKeyboardOpened = isVisible);
|
KeyboardUtils.addKeyboardToggleListener(this, isVisible -> isKeyboardOpened = isVisible);
|
||||||
|
|
||||||
mNestedScroll.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
|
|
||||||
if(v.getChildAt(v.getChildCount() - 1) != null) {
|
|
||||||
if ((scrollY >= (v.getChildAt(v.getChildCount() - 1).getMeasuredHeight() - v.getMeasuredHeight())) && scrollY > oldScrollY) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onInvokePixelGenerator();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList<historyRowModel> mSuggestions;
|
private ArrayList<historyRowModel> mSuggestions;
|
||||||
|
@ -1022,11 +1026,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onHomeButton(View view){
|
public void onHomeButton(View view){
|
||||||
|
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_INITIALIZE_BANNER_ADS);
|
||||||
mGeckoClient.getSession().setTheme(null);
|
mGeckoClient.getSession().setTheme(null);
|
||||||
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), true);
|
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), true);
|
||||||
onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
||||||
mHomeViewController.onUpdateLogo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*TAB CONTROLLER EVENTS*/
|
/*TAB CONTROLLER EVENTS*/
|
||||||
|
@ -1046,11 +1049,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mHomeViewController.onHideLoadTabDialog();
|
mHomeViewController.onHideLoadTabDialog();
|
||||||
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_RECENT_TAB, null);
|
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_RECENT_TAB, null);
|
||||||
if(model!=null && !mGeckoClient.getSession().getSessionID().equals(model.getSession().getSessionID())){
|
if(model!=null && !mGeckoClient.getSession().getSessionID().equals(model.getSession().getSessionID())){
|
||||||
Log.i("FUCK::1",model.getSession().getCurrentURL());
|
|
||||||
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(),false,false,true);
|
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(),false,false,true);
|
||||||
Log.i("FUCK::2",model.getSession().getCurrentURL());
|
onLoadTab(model.getSession(), false,true, false);
|
||||||
onLoadTab(model.getSession(), false,true);
|
|
||||||
Log.i("FUCK::3",model.getSession().getCurrentURL());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1100,7 +1100,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
|
|
||||||
public void postNewLinkTabAnimationInBackgroundTrigger(String url){
|
public void postNewLinkTabAnimationInBackgroundTrigger(String url){
|
||||||
String mExtention = helperMethod.getMimeType(url, this);
|
String mExtention = helperMethod.getMimeType(url, this);
|
||||||
if(mExtention == null || mExtention.equals("text/html") || mExtention.equals("application/vnd.ms-htmlhelp") || mExtention.equals("application/vnd.sun.xml.writer") || mExtention.equals("application/vnd.sun.xml.writer.global") || mExtention.equals("application/vnd.sun.xml.writer.template") || mExtention.equals("application/xhtml+xml")){
|
if(!url.startsWith("data") && !url.startsWith("blob") && (mExtention == null || mExtention.equals("text/html") || mExtention.equals("application/vnd.ms-htmlhelp") || mExtention.equals("application/vnd.sun.xml.writer") || mExtention.equals("application/vnd.sun.xml.writer.global") || mExtention.equals("application/vnd.sun.xml.writer.template") || mExtention.equals("application/xhtml+xml"))){
|
||||||
initTabCount(M_NEW_LINK_IN_NEW_TAB, Collections.singletonList(url));
|
initTabCount(M_NEW_LINK_IN_NEW_TAB, Collections.singletonList(url));
|
||||||
}else {
|
}else {
|
||||||
postNewLinkTabAnimation(url, true);
|
postNewLinkTabAnimation(url, true);
|
||||||
|
@ -1112,12 +1112,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
geckoSession mSession = mGeckoClient.getSession();
|
geckoSession mSession = mGeckoClient.getSession();
|
||||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView,false));
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView,false));
|
||||||
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,true);
|
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,true);
|
||||||
mHomeViewController.progressBarReset();
|
|
||||||
mGeckoClient.initURL(url);
|
mGeckoClient.initURL(url);
|
||||||
mGeckoClient.loadURL(url, mGeckoView, homeController.this);
|
mGeckoClient.loadURL(url, mGeckoView, homeController.this);
|
||||||
mGeckoClient.getSession().setURL(url);
|
mGeckoClient.getSession().setURL(url);
|
||||||
onSaveCurrentTab(mGeckoClient.getSession(),false);
|
onSaveCurrentTab(mGeckoClient.getSession(),false);
|
||||||
onLoadTab(mSession,false,false);
|
onLoadTab(mSession,false,false, false);
|
||||||
|
mHomeViewController.progressBarReset();
|
||||||
|
|
||||||
|
|
||||||
mAppBar.setTag(R.id.expandableBar,true);
|
mAppBar.setTag(R.id.expandableBar,true);
|
||||||
|
@ -1494,13 +1494,24 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
|
|
||||||
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
|
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
|
||||||
if(model==null){
|
if(model==null){
|
||||||
|
mHomeViewController.onUpdateSearchBar(status.sSettingSearchStatus,false,true, false);
|
||||||
mHomeViewController.onProgressBarUpdate(5, false);
|
mHomeViewController.onProgressBarUpdate(5, false);
|
||||||
mGeckoView.releaseSession();
|
mGeckoView.releaseSession();
|
||||||
initializeGeckoView(false,false);
|
initializeGeckoView(false,false);
|
||||||
onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus));
|
onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus));
|
||||||
|
if(mGeckoClient.getSession().getProgress()!=100){
|
||||||
|
mHomeViewController.onProgressBarUpdate(mGeckoClient.getSession().getProgress(),true);
|
||||||
|
}else{
|
||||||
|
mProgressBar.setProgress(0);
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
if(model.getSession().getSessionID() != mGeckoClient.getSession().getSessionID()){
|
if(model.getSession().getSessionID() != mGeckoClient.getSession().getSessionID()){
|
||||||
onLoadTab(model.getSession(),false,true);
|
onLoadTab(model.getSession(),false,true, false);
|
||||||
|
}
|
||||||
|
if(mGeckoClient.getSession().getProgress()!=100){
|
||||||
|
mHomeViewController.onProgressBarUpdate(mGeckoClient.getSession().getProgress(),true);
|
||||||
|
}else{
|
||||||
|
mProgressBar.setProgress(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1545,6 +1556,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onVoiceClick(View view) {
|
public void onVoiceClick(View view) {
|
||||||
|
mSearchbar.clearFocus();
|
||||||
|
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,false, true);
|
||||||
|
|
||||||
if(status.sSettingEnableVoiceInput || status.sWidgetResponse == enums.WidgetResponse.VOICE){
|
if(status.sSettingEnableVoiceInput || status.sWidgetResponse == enums.WidgetResponse.VOICE){
|
||||||
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
|
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
|
||||||
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
|
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
|
||||||
|
@ -1556,7 +1570,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
mSearchbar.clearFocus();
|
|
||||||
new Handler().postDelayed(() ->
|
new Handler().postDelayed(() ->
|
||||||
{
|
{
|
||||||
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true, false);
|
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true, false);
|
||||||
|
@ -1624,7 +1637,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
|
|
||||||
if(model!=null){
|
if(model!=null){
|
||||||
if(mTabFragment.getVisibility()!=View.VISIBLE){
|
if(mTabFragment.getVisibility()!=View.VISIBLE){
|
||||||
onLoadTab(model.getSession(),true, true);
|
onLoadTab(model.getSession(),true, true, false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1654,7 +1667,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClearSearchBar(View view){
|
public void onClearSearchBar(View view){
|
||||||
mHomeViewController.onUpdateSearchBar(strings.GENERIC_EMPTY_STR, false, true, false);
|
mHomeViewController.onUpdateSearchBar(strings.GENERIC_EMPTY_STR, false, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFindNext(View view){
|
public void onFindNext(View view){
|
||||||
|
@ -1662,6 +1675,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onOpenSearchEngine(View view){
|
public void onOpenSearchEngine(View view){
|
||||||
|
mSearchbar.clearFocus();
|
||||||
|
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,false, true);
|
||||||
|
|
||||||
mSearchBarPreviousText = mSearchbar.getText().toString();
|
mSearchBarPreviousText = mSearchbar.getText().toString();
|
||||||
isSuggestionSearchOpened = true;
|
isSuggestionSearchOpened = true;
|
||||||
helperMethod.openActivity(settingSearchController.class,constants.CONST_LIST_HISTORY, homeController.this,true);
|
helperMethod.openActivity(settingSearchController.class,constants.CONST_LIST_HISTORY, homeController.this,true);
|
||||||
|
@ -1930,16 +1946,26 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mHomeViewController.onClearSelections(isKeyboardOpened);
|
mHomeViewController.onClearSelections(isKeyboardOpened);
|
||||||
mSearchbar.clearFocus();
|
mSearchbar.clearFocus();
|
||||||
}
|
}
|
||||||
else {
|
else if(e_type.equals(GECKO_SCROLL_DOWN_MOVE)){
|
||||||
int[] locatiosn = new int[2];
|
mAppBar.setExpanded(true,false);
|
||||||
mSearchbar.getLocationOnScreen(locatiosn);
|
|
||||||
int ys = locatiosn[1];
|
|
||||||
if(ys!=0){
|
|
||||||
if(ys<=8){
|
|
||||||
mHomeViewController.shrinkTopBar(true, mGeckoView.getMaxY());
|
|
||||||
}else {
|
|
||||||
mHomeViewController.expandTopBar(true, mGeckoView.getMaxY());
|
|
||||||
}
|
}
|
||||||
|
else if(e_type.equals(GECKO_SCROLL_UP_MOVE)){
|
||||||
|
mAppBar.setExpanded(false,false);
|
||||||
|
}
|
||||||
|
else if(e_type.equals(WAS_SCROLL_CHANGED)){
|
||||||
|
return mGeckoClient.getScrollOffset();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Rect rectf = new Rect();
|
||||||
|
mAppBar.getLocalVisibleRect(rectf);
|
||||||
|
int height = mAppBar.getHeight();
|
||||||
|
|
||||||
|
Log.i("asddasas","asdasd : " + rectf.top + " : " + height);
|
||||||
|
if(rectf.top!=0 && rectf.top + height!=0)
|
||||||
|
if(rectf.top<=height/2){
|
||||||
|
mHomeViewController.expandTopBar(true, mGeckoView.getMaxY());
|
||||||
|
}else {
|
||||||
|
mHomeViewController.shrinkTopBar(true, mGeckoView.getMaxY());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2006,6 +2032,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
{
|
{
|
||||||
mHomeViewController.onSetBannerAdMargin((boolean)data.get(0),(boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
|
mHomeViewController.onSetBannerAdMargin((boolean)data.get(0),(boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
|
||||||
}
|
}
|
||||||
|
else if(e_type.equals(enums.etype.M_GET_CURRENT_URL))
|
||||||
|
{
|
||||||
|
return mGeckoClient.getSession().getCurrentURL();
|
||||||
|
}
|
||||||
else if(e_type.equals(enums.etype.M_SPLASH_DISABLE))
|
else if(e_type.equals(enums.etype.M_SPLASH_DISABLE))
|
||||||
{
|
{
|
||||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_INSTALLED,true));
|
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_INSTALLED,true));
|
||||||
|
@ -2071,7 +2101,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
else if(e_type.equals(enums.etype.M_HOME_PAGE)){
|
else if(e_type.equals(enums.etype.M_HOME_PAGE)){
|
||||||
geckoSession mSession = (geckoSession)dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_HOME_PAGE, null);
|
geckoSession mSession = (geckoSession)dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_HOME_PAGE, null);
|
||||||
if(mSession!=null){
|
if(mSession!=null){
|
||||||
onLoadTab(mSession, false,true);
|
onLoadTab(mSession, false,true, false);
|
||||||
}
|
}
|
||||||
return dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_HOME_PAGE, null);
|
return dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_HOME_PAGE, null);
|
||||||
}
|
}
|
||||||
|
@ -2187,7 +2217,18 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
public Object invokeObserver(List<Object> data, Object e_type)
|
public Object invokeObserver(List<Object> data, Object e_type)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(e_type.equals(enums.etype.ON_EXPAND_TOP_BAR)){
|
if(e_type.equals(enums.etype.M_ON_SCROLL_BOUNDARIES)){
|
||||||
|
mGeckoView.setmForcedScroll(true);
|
||||||
|
}
|
||||||
|
else if(e_type.equals(enums.etype.M_ON_SCROLL_TOP_BOUNDARIES)){
|
||||||
|
if(!mGeckoView.getPressedState()){
|
||||||
|
mHomeViewController.expandTopBar(true, mGeckoView.getMaxY());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(e_type.equals(enums.etype.M_ON_SCROLL_NO_BOUNDARIES)){
|
||||||
|
mGeckoView.setmForcedScroll(false);
|
||||||
|
}
|
||||||
|
else if(e_type.equals(enums.etype.ON_EXPAND_TOP_BAR)){
|
||||||
mHomeViewController.expandTopBar(false, mGeckoView.getMaxY());
|
mHomeViewController.expandTopBar(false, mGeckoView.getMaxY());
|
||||||
}
|
}
|
||||||
else if(e_type.equals(enums.etype.M_ON_BANNER_UPDATE)){
|
else if(e_type.equals(enums.etype.M_ON_BANNER_UPDATE)){
|
||||||
|
@ -2315,7 +2356,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
else if(e_type.equals(enums.etype.M_OPEN_SESSION)){
|
else if(e_type.equals(enums.etype.M_OPEN_SESSION)){
|
||||||
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
|
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
|
||||||
if(model!=null){
|
if(model!=null){
|
||||||
onLoadTab(model.getSession(),true,true);
|
onLoadTab(model.getSession(),true,true, false);
|
||||||
onLoadURL(model.getSession().getCurrentURL());
|
onLoadURL(model.getSession().getCurrentURL());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2331,7 +2372,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
else if(e_type.equals(enums.etype.M_ORBOT_LOADING)){
|
else if(e_type.equals(enums.etype.M_ORBOT_LOADING)){
|
||||||
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(homeController.this), M_ORBOT_LOADING);
|
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(homeController.this), M_ORBOT_LOADING);
|
||||||
}
|
}
|
||||||
|
else if(e_type.equals(enums.etype.M_NEW_IDENTITY)){
|
||||||
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT);
|
||||||
|
}
|
||||||
|
else if(e_type.equals(enums.etype.M_NEW_IDENTITY_MESSAGED)){
|
||||||
|
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT);
|
||||||
|
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(homeController.this), M_NEW_IDENTITY);
|
||||||
|
mGeckoClient.onReload(mGeckoView, homeController.this);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,7 +305,6 @@ class homeViewController
|
||||||
public void onHideTabContainer(){
|
public void onHideTabContainer(){
|
||||||
onHideLoadTabDialog();
|
onHideLoadTabDialog();
|
||||||
if(mTabFragment.getAlpha()>0 || mTabFragment.getVisibility()!=View.GONE){
|
if(mTabFragment.getAlpha()>0 || mTabFragment.getVisibility()!=View.GONE){
|
||||||
Log.i("SUPERFUCK4","SUPERFUCK");
|
|
||||||
mNewTab.setPressed(false);
|
mNewTab.setPressed(false);
|
||||||
new Handler().postDelayed(() ->
|
new Handler().postDelayed(() ->
|
||||||
{
|
{
|
||||||
|
@ -384,13 +383,17 @@ class homeViewController
|
||||||
}else {
|
}else {
|
||||||
mSearchbar.setPadding(mSearchbar.getPaddingLeft(),0,helperMethod.pxFromDp(5),0);
|
mSearchbar.setPadding(mSearchbar.getPaddingLeft(),0,helperMethod.pxFromDp(5),0);
|
||||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mSearchbar.getLayoutParams();
|
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mSearchbar.getLayoutParams();
|
||||||
params.rightMargin = helperMethod.pxFromDp(10);
|
params.rightMargin = helperMethod.pxFromDp(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}else {
|
}else {
|
||||||
|
|
||||||
|
if(!mSearchbar.getText().toString().contains(".")){
|
||||||
onUpdateSearchIcon(0);
|
onUpdateSearchIcon(0);
|
||||||
|
}else {
|
||||||
|
onUpdateSearchIcon(2);
|
||||||
|
}
|
||||||
mSearchbar.setMovementMethod(mSearchBarMovementMethod);
|
mSearchbar.setMovementMethod(mSearchBarMovementMethod);
|
||||||
mSearchbar.setFadingEdgeLength(helperMethod.pxFromDp(0));
|
mSearchbar.setFadingEdgeLength(helperMethod.pxFromDp(0));
|
||||||
|
|
||||||
|
@ -600,12 +603,15 @@ class homeViewController
|
||||||
{
|
{
|
||||||
boolean mFastConnect = !status.sRestoreTabs && status.sAppInstalled && status.sSettingSearchStatus.equals(constants.CONST_BACKEND_GENESIS_URL) && !status.sBridgeStatus;
|
boolean mFastConnect = !status.sRestoreTabs && status.sAppInstalled && status.sSettingSearchStatus.equals(constants.CONST_BACKEND_GENESIS_URL) && !status.sBridgeStatus;
|
||||||
if(mFastConnect){
|
if(mFastConnect){
|
||||||
if(orbotLocalConstants.mNetworkState){
|
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
|
if(orbotLocalConstants.mNetworkState){
|
||||||
orbotLocalConstants.mTorLogsStatus = "Starting Genesis | Please Wait ...";
|
orbotLocalConstants.mTorLogsStatus = "Starting Genesis | Please Wait ...";
|
||||||
mEvent.invokeObserver(Collections.singletonList(status.sSettingSearchStatus), enums.etype.recheck_orbot);
|
mEvent.invokeObserver(Collections.singletonList(status.sSettingSearchStatus), enums.etype.recheck_orbot);
|
||||||
startPostTask(messages.MESSAGE_UPDATE_LOADING_TEXT);
|
startPostTask(messages.MESSAGE_UPDATE_LOADING_TEXT);
|
||||||
break;
|
break;
|
||||||
|
}else{
|
||||||
|
orbotLocalConstants.mTorLogsStatus = "No internet connection";
|
||||||
|
startPostTask(messages.MESSAGE_UPDATE_LOADING_TEXT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -750,6 +756,8 @@ class homeViewController
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void shrinkTopBar(boolean pForced, int pOffsetY){
|
public void shrinkTopBar(boolean pForced, int pOffsetY){
|
||||||
|
|
||||||
if(pOffsetY == -1){
|
if(pOffsetY == -1){
|
||||||
|
@ -823,7 +831,7 @@ class homeViewController
|
||||||
desktop.setChecked(userAgent==USER_AGENT_MODE_DESKTOP);
|
desktop.setChecked(userAgent==USER_AGENT_MODE_DESKTOP);
|
||||||
|
|
||||||
String mExtention = helperMethod.getMimeType(mURL, mContext);
|
String mExtention = helperMethod.getMimeType(mURL, mContext);
|
||||||
if(mExtention == null || mExtention.equals("text/html") || mExtention.equals("application/vnd.ms-htmlhelp") || mExtention.equals("application/vnd.sun.xml.writer") || mExtention.equals("application/vnd.sun.xml.writer.global") || mExtention.equals("application/vnd.sun.xml.writer.template") || mExtention.equals("application/xhtml+xml")){
|
if(!mURL.startsWith("data") && !mURL.startsWith("blob") && (mExtention == null || mExtention.equals("application/x-msdos-program") || mExtention.equals("text/html") || mExtention.equals("application/vnd.ms-htmlhelp") || mExtention.equals("application/vnd.sun.xml.writer") || mExtention.equals("application/vnd.sun.xml.writer.global") || mExtention.equals("application/vnd.sun.xml.writer.template") || mExtention.equals("application/xhtml+xml"))){
|
||||||
mDownload.setEnabled(false);
|
mDownload.setEnabled(false);
|
||||||
mDownload.setColorFilter(Color.argb(255, 191, 191, 191));
|
mDownload.setColorFilter(Color.argb(255, 191, 191, 191));
|
||||||
}
|
}
|
||||||
|
@ -941,12 +949,16 @@ class homeViewController
|
||||||
private Handler searchBarUpdateHandler = new Handler();
|
private Handler searchBarUpdateHandler = new Handler();
|
||||||
private String handlerLocalUrl = "";
|
private String handlerLocalUrl = "";
|
||||||
void onUpdateSearchBar(String url,boolean showProtocol, boolean pClearText, boolean pBypassFocus){
|
void onUpdateSearchBar(String url,boolean showProtocol, boolean pClearText, boolean pBypassFocus){
|
||||||
|
|
||||||
|
if(url.endsWith("genesisconfigurenewidentity.com/")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(url.startsWith(CONST_GENESIS_URL_CACHED) || url.startsWith(CONST_GENESIS_URL_CACHED_DARK)){
|
if(url.startsWith(CONST_GENESIS_URL_CACHED) || url.startsWith(CONST_GENESIS_URL_CACHED_DARK)){
|
||||||
mSearchbar.setTag(R.id.msearchbarProcessing,true);
|
mSearchbar.setTag(R.id.msearchbarProcessing,true);
|
||||||
url = CONST_GENESIS_DOMAIN_URL;
|
url = CONST_GENESIS_DOMAIN_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Log.i("FUCK::5",url);
|
Log.i("FUCK::5",url);
|
||||||
if(!mSearchbar.hasFocus() || pClearText || pBypassFocus){
|
if(!mSearchbar.hasFocus() || pClearText || pBypassFocus){
|
||||||
if(mSearchEngineBar.getVisibility() == View.GONE || pBypassFocus){
|
if(mSearchEngineBar.getVisibility() == View.GONE || pBypassFocus){
|
||||||
|
@ -1218,7 +1230,7 @@ class homeViewController
|
||||||
}
|
}
|
||||||
|
|
||||||
void progressBarReset(){
|
void progressBarReset(){
|
||||||
mProgressBar.setProgress(5);
|
mProgressBar.setProgress(0);
|
||||||
mProgressBar.setVisibility(View.INVISIBLE);
|
mProgressBar.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1239,15 +1251,15 @@ class homeViewController
|
||||||
status.sDisableExpandTemp = false;
|
status.sDisableExpandTemp = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mProgressBar.getProgress() == value || mProgressBar.getProgress() == 0 && value == 100){
|
//if(mProgressBar.getProgress() == value || mProgressBar.getProgress() <= && value == 100){
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
|
|
||||||
if(progressAnimator!=null){
|
if(progressAnimator!=null){
|
||||||
progressAnimator.cancel();
|
progressAnimator.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mSearchbar.getText().toString().equals("genesis.onion") && !mForced || (boolean)mSearchbar.getTag(R.id.msearchbarProcessing)){
|
if((mSearchbar.getText().toString().equals("genesis.onion/search?q=$s&p_num=1&s_type=all") || mSearchbar.getText().toString().equals("genesis.onion")) && !mForced || (boolean)mSearchbar.getTag(R.id.msearchbarProcessing)){
|
||||||
mProgressBar.setProgress(0);
|
mProgressBar.setProgress(0);
|
||||||
mProgressBar.setVisibility(View.GONE);
|
mProgressBar.setVisibility(View.GONE);
|
||||||
return;
|
return;
|
||||||
|
@ -1470,13 +1482,6 @@ class homeViewController
|
||||||
void onSessionChanged(){
|
void onSessionChanged(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void onUpdateLogo(){
|
|
||||||
|
|
||||||
switch (status.sSettingSearchStatus)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-------------------------------------------------------POST UI TASK HANDLER-------------------------------------------------------*/
|
/*-------------------------------------------------------POST UI TASK HANDLER-------------------------------------------------------*/
|
||||||
|
|
||||||
private void startPostTask(int m_id) {
|
private void startPostTask(int m_id) {
|
||||||
|
|
|
@ -42,6 +42,8 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static com.darkweb.genesissearchengine.appManager.tabManager.tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG_FORCED;
|
||||||
|
|
||||||
public class tabController extends Fragment
|
public class tabController extends Fragment
|
||||||
{
|
{
|
||||||
/*Private Views*/
|
/*Private Views*/
|
||||||
|
@ -591,6 +593,8 @@ public class tabController extends Fragment
|
||||||
|
|
||||||
|
|
||||||
public boolean onBackPressed() {
|
public boolean onBackPressed() {
|
||||||
|
mtabViewController.onTrigger(ON_HIDE_UNDO_DIALOG_FORCED, null);
|
||||||
|
|
||||||
if(mTabAdapter!=null){
|
if(mTabAdapter!=null){
|
||||||
boolean mStatus = (boolean) mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_SELECTION_MENU_SHOWING, null);
|
boolean mStatus = (boolean) mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_SELECTION_MENU_SHOWING, null);
|
||||||
onClearTabBackup();
|
onClearTabBackup();
|
||||||
|
@ -631,7 +635,7 @@ public class tabController extends Fragment
|
||||||
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_LOAD_TAB)){
|
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_LOAD_TAB)){
|
||||||
mClosed = true;
|
mClosed = true;
|
||||||
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HOLD_BLOCKER, null);
|
mtabViewController.onTrigger(tabEnums.eTabViewCommands.ON_HOLD_BLOCKER, null);
|
||||||
mHomeController.onLoadTab((geckoSession)data.get(0),(boolean)data.get(1),true);
|
mHomeController.onLoadTab((geckoSession)data.get(0),(boolean)data.get(1),true, true);
|
||||||
}
|
}
|
||||||
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW)){
|
else if(e_type.equals(tabEnums.eTabAdapterCallback.ON_REMOVE_TAB_VIEW)){
|
||||||
onInitRemoveView((Integer) data.get(0), true, true);
|
onInitRemoveView((Integer) data.get(0), true, true);
|
||||||
|
|
|
@ -4,7 +4,7 @@ public class tabEnums
|
||||||
{
|
{
|
||||||
/*Settings Manager*/
|
/*Settings Manager*/
|
||||||
public enum eTabViewCommands {
|
public enum eTabViewCommands {
|
||||||
M_DISMISS_MENU, M_SHOW_MENU, INIT_TAB_COUNT, ON_HIDE_SELECTION, ON_SHOW_SELECTION, ON_SHOW_SELECTION_MENU, ON_SHOW_UNDO_DIALOG, ON_HIDE_UNDO_DIALOG, ON_GENERATE_SWIPABLE_BACKGROUND, ON_EXIT, ON_HIDE_UNDO_DIALOG_INIT, ON_HOLD_BLOCKER, ON_RELEASE_BLOCKER
|
M_DISMISS_MENU, M_SHOW_MENU, INIT_TAB_COUNT, ON_HIDE_SELECTION, ON_SHOW_SELECTION, ON_SHOW_SELECTION_MENU, ON_SHOW_UNDO_DIALOG, ON_HIDE_UNDO_DIALOG, ON_GENERATE_SWIPABLE_BACKGROUND, ON_EXIT, ON_HIDE_UNDO_DIALOG_INIT, ON_HOLD_BLOCKER, ON_RELEASE_BLOCKER, ON_HIDE_UNDO_DIALOG_FORCED
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum eTabAdapterCommands {
|
public enum eTabAdapterCommands {
|
||||||
|
|
|
@ -206,6 +206,16 @@ class tabViewController
|
||||||
mUndoLayout.animate().alpha(0).withEndAction(() -> mUndoLayout.setVisibility(View.GONE));
|
mUndoLayout.animate().alpha(0).withEndAction(() -> mUndoLayout.setVisibility(View.GONE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onHideUndoDialogForced() {
|
||||||
|
if(mUndoLayout.getAlpha()<1){
|
||||||
|
mUndoLayout.animate().cancel();
|
||||||
|
mUndoLayout.setAlpha(0);
|
||||||
|
mUndoLayout.setVisibility(View.GONE);
|
||||||
|
}else {
|
||||||
|
mUndoLayout.animate().setDuration(200).alpha(0).withEndAction(() -> mUndoLayout.setVisibility(View.GONE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void onHideUndoDialogInit() {
|
private void onHideUndoDialogInit() {
|
||||||
mUndoLayout.animate().cancel();
|
mUndoLayout.animate().cancel();
|
||||||
mUndoLayout.setAlpha(0);
|
mUndoLayout.setAlpha(0);
|
||||||
|
@ -291,6 +301,9 @@ class tabViewController
|
||||||
else if(pCommands.equals(tabEnums.eTabViewCommands.ON_RELEASE_BLOCKER)){
|
else if(pCommands.equals(tabEnums.eTabViewCommands.ON_RELEASE_BLOCKER)){
|
||||||
blockUI(false);
|
blockUI(false);
|
||||||
}
|
}
|
||||||
|
else if(pCommands.equals(tabEnums.eTabViewCommands.ON_HIDE_UNDO_DIALOG_FORCED)){
|
||||||
|
onHideUndoDialogForced();
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,11 @@ public class enums
|
||||||
{
|
{
|
||||||
/*Settings Manager*/
|
/*Settings Manager*/
|
||||||
public enum etype{
|
public enum etype{
|
||||||
M_CHANGE_HOME_THEME, on_update_favicon,M_RELOAD,ON_UPDATE_TAB_TITLE, ON_OPEN_TAB_VIEW,ON_NEW_TAB_ANIMATION, M_UPDATE_SESSION_STATE,ON_LOAD_REQUEST, GECKO_SCROLL_UP, GECKO_SCROLL_UP_ALWAYS, GECKO_SCROLL_DOWN, GECKO_SCROLL_DOWN_CALLER,ON_UPDATE_SEARCH_BAR,M_ON_MAIL,SESSION_ID,M_UPDATE_PIXEL_BACKGROUND, M_INIT_PADDING, M_RATE_COUNT,M_CACHE_UPDATE_TAB,
|
M_CHANGE_HOME_THEME, on_update_favicon,M_RELOAD,ON_UPDATE_TAB_TITLE, ON_OPEN_TAB_VIEW,ON_NEW_TAB_ANIMATION, M_UPDATE_SESSION_STATE,ON_LOAD_REQUEST, GECKO_SCROLL_UP, GECKO_SCROLL_UP_ALWAYS, GECKO_SCROLL_DOWN, WAS_SCROLL_CHANGED, GECKO_SCROLL_DOWN_MOVE, GECKO_SCROLL_UP_MOVE, GECKO_SCROLL_DOWN_CALLER,ON_UPDATE_SEARCH_BAR,M_ON_MAIL,SESSION_ID,M_UPDATE_PIXEL_BACKGROUND, M_ON_SCROLL_BOUNDARIES, M_ON_SCROLL_TOP_BOUNDARIES, M_ON_SCROLL_NO_BOUNDARIES, M_INIT_PADDING, M_RATE_COUNT,M_CACHE_UPDATE_TAB,
|
||||||
on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,M_ADMOB_BANNER_RECHECK,M_OPEN_SESSION,M_DOWNLOAD_FAILURE,
|
on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,M_ADMOB_BANNER_RECHECK,M_OPEN_SESSION,M_DOWNLOAD_FAILURE,
|
||||||
welcome, reload,download_folder, M_UPDATE_THEME,M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS,M_INIT_TAB_COUNT_FORCED,M_SPLASH_DISABLE,M_NEW_LINK_IN_NEW_TAB,M_RESET_SUGGESTION,
|
welcome, reload,download_folder, M_UPDATE_THEME,M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS,M_INIT_TAB_COUNT_FORCED,M_SPLASH_DISABLE,M_NEW_LINK_IN_NEW_TAB,M_RESET_SUGGESTION,
|
||||||
url_triggered, url_triggered_new_tab,url_clear,fetch_favicon,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,M_CLOSE_TAB,
|
url_triggered, url_triggered_new_tab,url_clear,fetch_favicon,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,M_CLOSE_TAB,
|
||||||
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_FIRST_PAINT, ON_LOAD_TAB_ON_RESUME, ON_SESSION_REINIT,on_page_loaded,on_load_error, M_ORBOT_LOADING,download_file_popup,on_init_ads,search_update, open_new_tab,open_new_tab_instant
|
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_NEW_IDENTITY, M_NEW_IDENTITY_MESSAGED, M_INITIALIZE_TAB_SINGLE, M_INITIALIZE_TAB_LINK,on_request_completed, on_update_history,on_update_suggestion,M_WELCOME_MESSAGE,ON_FIRST_PAINT, ON_LOAD_TAB_ON_RESUME, ON_SESSION_REINIT,on_page_loaded,on_load_error, M_ORBOT_LOADING,download_file_popup,on_init_ads, M_GET_CURRENT_URL,search_update, open_new_tab,open_new_tab_instant
|
||||||
}
|
}
|
||||||
|
|
||||||
/*General Enums*/
|
/*General Enums*/
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class strings
|
||||||
/*Home Manager*/
|
/*Home Manager*/
|
||||||
|
|
||||||
public static final String HOME_BLANK_PAGE = "about:blank";
|
public static final String HOME_BLANK_PAGE = "about:blank";
|
||||||
public static final String HOME_REFERENCE_WEBSITES_DEFAULT = "[{\"mUrl\":\"https://wikileaks.org/-Leaks-.html\",\"mIcon\":\"https://wikileaks.org/static/img/wl-logo.png\",\"mHeader\":\"WikiLeaks (en)\",\"mBody\":\"WikiLeaks specializes in the publication of censored or otherwise restricted official materials involving war, and corruption\"},{\"mUrl\":\"https://p53lf57qovyuvwsc6xnrppyply3vtqm7l6pcobkmyqsiofyeznfu5uqd.onion/\",\"mIcon\":\"http://assets.p53lf57qovyuvwsc6xnrppyply3vtqm7l6pcobkmyqsiofyeznfu5uqd.onion/static/prod/v4/images/favicon-32x32.png\",\"mHeader\":\"Pro Publica\",\"mBody\":\"ProPublica is an independent, nonprofit newsroom that produces investigative journalism with moral force\"},{\"mUrl\":\"http://nzh3fv6jc6jskki3.onion/\",\"mIcon\":\"http://nzh3fv6jc6jskki3.onion/assets/images/favicon.png\",\"mHeader\":\"Rise UP | Communication Service\",\"mBody\":\"We are a project to create democratic alternatives and practiceself-determination by controlling our own secure means of communications\"},{\"mUrl\":\"http://answerszuvs3gg2l64e6hmnryudl5zgrmwm3vh65hzszdghblddvfiqd.onion/\",\"mIcon\":\"https://www.freeiconspng.com/uploads/questions-and-answers-icon-1.png\",\"mHeader\":\"Hidden Answer\",\"mBody\":\"Once you access the site, you’ll soon notice that the questions on Hidden Answers touch upon a variety of topics\"},{\"mUrl\":\"http://zerobinqmdqd236y.onion/\",\"mIcon\":\"https://icon-library.net//images/zero-icon/zero-icon-15.jpg\",\"mHeader\":\"Zero Bin\",\"mBody\":\"ZeroBin.net is a minimalist, open source online pastebin where the server has zero knowledge of pasted data\"},{\"mUrl\":\"http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion/\",\"mIcon\":\"http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion/img/favicon.ico\",\"mHeader\":\"Imperial Library\",\"mBody\":\"The Imperial Library of Trantor (also known as Galactic Library) is a repository of DRM-free ebooks on ePub format\"},{\"mUrl\":\"http://zqktlwiuavvvqqt4ybvgvi7tyo4hjl5xgfuvpdf6otjiycgwqbym2qad.onion/wiki/index.php/Main_Page\",\"mIcon\":\"http://zqktlwiuavvvqqt4ybvgvi7tyo4hjl5xgfuvpdf6otjiycgwqbym2qad.onion/wiki/resources/favicon.ico\",\"mHeader\":\"Hidden Wiki\",\"mBody\":\"One of the largest repository of categorized hidden web URL's\"},{\"mUrl\":\"https://www.facebookcorewwwi.onion/\",\"mIcon\":\"https://cdn1.iconfinder.com/data/icons/logotypes/32/square-facebook-512.png\",\"mHeader\":\"Facebook\",\"mBody\":\"Connect with friends and the world around you on Facebook\"},{\"mUrl\":\"https://www.bbcnewsv2vjtpsuy.onion/\",\"mIcon\":\"https://gn-web-assets.api.bbc.com/wwhp/20210105-1702-7302953dc6fd22d3eb4efd4d73bfd2a8d91bb7df/responsive/img/apple-touch/apple-touch-180.jpg\",\"mHeader\":\"BBC News\",\"mBody\":\"We’re impartial and independent, and every day we create distinctive, world class programmes and content which inform millions of people around the world\"},{\"mUrl\":\"http://archivecaslytosk.onion/\",\"mIcon\":\"https://archive.is/apple-touch-icon-144x144.png\",\"mHeader\":\"Archieve Today\",\"mBody\":\"It takes a 'snapshot' of a webpage that will always be online even if the original page disappears. It saves a text and a graphical copy of the legacy page\"},{\"mUrl\":\"http://wasabiukrxmkdgve5kynjztuovbg43uxcbcxn6y2okcrsg7gb6jdmbad.onion/\",\"mIcon\":\"http://wasabiukrxmkdgve5kynjztuovbg43uxcbcxn6y2okcrsg7gb6jdmbad.onion/images/favicon.ico\",\"mHeader\":\"Wasabi Wallet\",\"mBody\":\"Wasabi is an open-source, non-custodial, privacy-focused Bitcoin wallet for Desktop, that implements trustless CoinJoin\"},{\"mUrl\":\"http://ow24et3tetp6tvmk.onion/\",\"mIcon\":\"http://ow24et3tetp6tvmk.onion/favicon.ico\",\"mHeader\":\"Onion Wallet\",\"mBody\":\"When using Bitcoin together with Tor you are combining the best online money with the best encryption and privacy technology available\"},{\"mUrl\":\"http://piratebayztemzmv.onion/\",\"mIcon\":\"http://piratebayztemzmv.onion/images/tpb.jpg\",\"mHeader\":\"The Pirate Bay\",\"mBody\":\"The Pirate Bay allows users to search for Magnet links. These are used to reference resources available for download via peer-to-peer networks\"}]";
|
public static final String HOME_REFERENCE_WEBSITES_DEFAULT = "[{\"mUrl\":\"https://www.wikileaks.org/wiki/Wikileaks\",\"mIcon\":\"https://www.wikileaks.org/wiki/Wikileaks/w/images/favicon.ico\",\"mHeader\":\"WikiLeaks (en)\",\"mBody\":\"WikiLeaks specializes in the publication of censored or otherwise restricted official materials involving war, and corruption\"},{\"mUrl\":\"http://p53lf57qovyuvwsc6xnrppyply3vtqm7l6pcobkmyqsiofyeznfu5uqd.onion/\",\"mIcon\":\"http://assets.p53lf57qovyuvwsc6xnrppyply3vtqm7l6pcobkmyqsiofyeznfu5uqd.onion/static/prod/v4/images/favicon-32x32.png\",\"mHeader\":\"Pro Publica\",\"mBody\":\"ProPublica is an independent, nonprofit newsroom that produces investigative journalism with moral force\"},{\"mUrl\":\"http://nzh3fv6jc6jskki3.onion/\",\"mIcon\":\"http://nzh3fv6jc6jskki3.onion/assets/images/favicon.png\",\"mHeader\":\"Rise UP | Communication Service\",\"mBody\":\"We are a project to create democratic alternatives and practiceself-determination by controlling our own secure means of communications\"},{\"mUrl\":\"http://answerszuvs3gg2l64e6hmnryudl5zgrmwm3vh65hzszdghblddvfiqd.onion/\",\"mIcon\":\"https://www.freeiconspng.com/uploads/questions-and-answers-icon-1.png\",\"mHeader\":\"Hidden Answer\",\"mBody\":\"Once you access the site, you’ll soon notice that the questions on Hidden Answers touch upon a variety of topics\"},{\"mUrl\":\"http://zerobinqmdqd236y.onion/\",\"mIcon\":\"https://icon-library.net//images/zero-icon/zero-icon-15.jpg\",\"mHeader\":\"Zero Bin\",\"mBody\":\"ZeroBin.net is a minimalist, open source online pastebin where the server has zero knowledge of pasted data\"},{\"mUrl\":\"http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion/\",\"mIcon\":\"http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion/img/favicon.ico\",\"mHeader\":\"Imperial Library\",\"mBody\":\"The Imperial Library of Trantor (also known as Galactic Library) is a repository of DRM-free ebooks on ePub format\"},{\"mUrl\":\"http://zqktlwiuavvvqqt4ybvgvi7tyo4hjl5xgfuvpdf6otjiycgwqbym2qad.onion/wiki/index.php/Main_Page\",\"mIcon\":\"http://zqktlwiuavvvqqt4ybvgvi7tyo4hjl5xgfuvpdf6otjiycgwqbym2qad.onion/wiki/resources/favicon.ico\",\"mHeader\":\"Hidden Wiki\",\"mBody\":\"One of the largest repository of categorized hidden web URL's\"},{\"mUrl\":\"https://www.facebookcorewwwi.onion/\",\"mIcon\":\"https://cdn1.iconfinder.com/data/icons/logotypes/32/square-facebook-512.png\",\"mHeader\":\"Facebook\",\"mBody\":\"Connect with friends and the world around you on Facebook\"},{\"mUrl\":\"https://www.bbcnewsv2vjtpsuy.onion/\",\"mIcon\":\"https://gn-web-assets.api.bbc.com/wwhp/20210105-1702-7302953dc6fd22d3eb4efd4d73bfd2a8d91bb7df/responsive/img/apple-touch/apple-touch-180.jpg\",\"mHeader\":\"BBC News\",\"mBody\":\"We’re impartial and independent, and every day we create distinctive, world class programmes and content which inform millions of people around the world\"},{\"mUrl\":\"http://archivecaslytosk.onion/\",\"mIcon\":\"https://archive.is/apple-touch-icon-144x144.png\",\"mHeader\":\"Archieve Today\",\"mBody\":\"It takes a 'snapshot' of a webpage that will always be online even if the original page disappears. It saves a text and a graphical copy of the legacy page\"},{\"mUrl\":\"http://wasabiukrxmkdgve5kynjztuovbg43uxcbcxn6y2okcrsg7gb6jdmbad.onion/\",\"mIcon\":\"http://wasabiukrxmkdgve5kynjztuovbg43uxcbcxn6y2okcrsg7gb6jdmbad.onion/images/favicon.ico\",\"mHeader\":\"Wasabi Wallet\",\"mBody\":\"Wasabi is an open-source, non-custodial, privacy-focused Bitcoin wallet for Desktop, that implements trustless CoinJoin\"},{\"mUrl\":\"http://ow24et3tetp6tvmk.onion/\",\"mIcon\":\"http://ow24et3tetp6tvmk.onion/favicon.ico\",\"mHeader\":\"Onion Wallet\",\"mBody\":\"When using Bitcoin together with Tor you are combining the best online money with the best encryption and privacy technology available\"},{\"mUrl\":\"http://piratebayztemzmv.onion/\",\"mIcon\":\"http://piratebayztemzmv.onion/images/tpb.jpg\",\"mHeader\":\"The Pirate Bay\",\"mBody\":\"The Pirate Bay allows users to search for Magnet links. These are used to reference resources available for download via peer-to-peer networks\"}]";
|
||||||
|
|
||||||
/*Message Manager*/
|
/*Message Manager*/
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,9 @@ public class dataController
|
||||||
/*Trigger Tabs*/
|
/*Trigger Tabs*/
|
||||||
|
|
||||||
public Object invokeTab(dataEnums.eTabCommands pCommands, List<Object> pData){
|
public Object invokeTab(dataEnums.eTabCommands pCommands, List<Object> pData){
|
||||||
|
if(mTabModel==null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return mTabModel.onTrigger(pCommands, pData);
|
return mTabModel.onTrigger(pCommands, pData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import android.Manifest;
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.ActivityManager;
|
||||||
import android.app.DownloadManager;
|
import android.app.DownloadManager;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
|
@ -28,6 +29,7 @@ import android.os.Vibrator;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -60,6 +62,8 @@ import java.io.ObjectInputStream;
|
||||||
import java.io.ObjectOutputStream;
|
import java.io.ObjectOutputStream;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.net.SocketException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
@ -96,6 +100,15 @@ public class helperMethod
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getStatusBarHeight(AppCompatActivity pContext) {
|
||||||
|
int result = 0;
|
||||||
|
int resourceId = pContext.getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||||
|
if (resourceId > 0) {
|
||||||
|
result = pContext.getResources().getDimensionPixelSize(resourceId);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public static byte[] convertToBytes(Object object) throws IOException {
|
public static byte[] convertToBytes(Object object) throws IOException {
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
ObjectOutputStream oos = new ObjectOutputStream(bos);
|
ObjectOutputStream oos = new ObjectOutputStream(bos);
|
||||||
|
@ -124,6 +137,20 @@ public class helperMethod
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isAppRunning(final Context context, final String packageName) {
|
||||||
|
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
|
final List<ActivityManager.RunningAppProcessInfo> procInfos = activityManager.getRunningAppProcesses();
|
||||||
|
if (procInfos != null)
|
||||||
|
{
|
||||||
|
for (final ActivityManager.RunningAppProcessInfo processInfo : procInfos) {
|
||||||
|
if (processInfo.processName.equals(packageName)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static void onDelayHandler(AppCompatActivity pActivity, int pTime, Callable<Void> pMethodParam) {
|
public static void onDelayHandler(AppCompatActivity pActivity, int pTime, Callable<Void> pMethodParam) {
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
handler.postDelayed(() ->
|
handler.postDelayed(() ->
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.darkweb.genesissearchengine.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
import com.google.android.gms.ads.*;
|
import com.google.android.gms.ads.*;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class adManager
|
public class adManager
|
||||||
|
@ -47,7 +48,8 @@ public class adManager
|
||||||
{
|
{
|
||||||
bannerAdsLoading = true;
|
bannerAdsLoading = true;
|
||||||
MobileAds.initialize(pAppContext.getApplicationContext(), initializationStatus -> { });
|
MobileAds.initialize(pAppContext.getApplicationContext(), initializationStatus -> { });
|
||||||
|
RequestConfiguration configuration = new RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("B1CF10D1F74698381CFF7BF9C485085B")).build();
|
||||||
|
MobileAds.setRequestConfiguration(configuration);
|
||||||
initializeBannerAds();
|
initializeBannerAds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,6 +84,7 @@ public class adManager
|
||||||
@Override
|
@Override
|
||||||
public void onAdFailedToLoad(@NonNull LoadAdError var1) {
|
public void onAdFailedToLoad(@NonNull LoadAdError var1) {
|
||||||
Log.i("dsa","asd");
|
Log.i("dsa","asd");
|
||||||
|
bannerAdsLoading = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,11 +25,7 @@ public class analyticManager
|
||||||
|
|
||||||
private void initialize()
|
private void initialize()
|
||||||
{
|
{
|
||||||
if(mIsDeveloperBuild){
|
|
||||||
new FlurryAgent.Builder() .withLogEnabled(true) .build(mAppContext.get().getApplicationContext(), "4C4K4T5ND9RJKT4H47GQ");
|
new FlurryAgent.Builder() .withLogEnabled(true) .build(mAppContext.get().getApplicationContext(), "4C4K4T5ND9RJKT4H47GQ");
|
||||||
}else {
|
|
||||||
new FlurryAgent.Builder() .withLogEnabled(true) .build(mAppContext.get().getApplicationContext(), "5RQYRV23928K6DXH8VWV");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*External Triggers*/
|
/*External Triggers*/
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
package com.darkweb.genesissearchengine.pluginManager.downloadPluginManager;
|
package com.darkweb.genesissearchengine.pluginManager.downloadPluginManager;
|
||||||
|
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.content.Context;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.eventObserver;
|
import com.darkweb.genesissearchengine.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
|
@ -15,6 +18,8 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static org.webrtc.ContextUtils.getApplicationContext;
|
||||||
|
|
||||||
public class downloadManager
|
public class downloadManager
|
||||||
{
|
{
|
||||||
/* Private Variables */
|
/* Private Variables */
|
||||||
|
@ -43,7 +48,25 @@ public class downloadManager
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cancelDownload(int pID) {
|
private void cancelDownload(int pID) {
|
||||||
Objects.requireNonNull(mDownloads.get(pID)).onCancel();
|
if(mDownloads!=null && mDownloads.containsKey(pID)){
|
||||||
|
downloadReciever mReciever = mDownloads.get(pID);
|
||||||
|
if(mReciever!=null){
|
||||||
|
mDownloads.get(pID).onCancel();
|
||||||
|
}else {
|
||||||
|
try {
|
||||||
|
if(!status.sSettingIsAppRunning){
|
||||||
|
NotificationManager notificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
notificationManager.cancelAll();
|
||||||
|
}
|
||||||
|
}catch (Exception ignored){}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onSwipeDownload(int pID) {
|
||||||
|
if(mDownloads!=null && mDownloads.get(pID)!=null){
|
||||||
|
mDownloads.get(pID).onCancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onTriggerDownload(int pID) {
|
private void onTriggerDownload(int pID) {
|
||||||
|
@ -83,6 +106,10 @@ public class downloadManager
|
||||||
{
|
{
|
||||||
return downloadBlob((String) pData.get(0));
|
return downloadBlob((String) pData.get(0));
|
||||||
}
|
}
|
||||||
|
else if(pEventType.equals(pluginEnums.eDownloadManager.M_SWIPE))
|
||||||
|
{
|
||||||
|
onSwipeDownload((int) pData.get(0));
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,11 +23,13 @@ import androidx.core.app.NotificationCompat;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.eventObserver;
|
import com.darkweb.genesissearchengine.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
import com.darkweb.genesissearchengine.libs.netcipher.client.StrongHttpsClient;
|
import com.darkweb.genesissearchengine.libs.netcipher.client.StrongHttpsClient;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
import com.darkweb.genesissearchengine.pluginManager.pluginController;
|
||||||
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
||||||
|
import com.darkweb.genesissearchengine.pluginManager.pluginReciever.downloadNotificationReciever;
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log;
|
import org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log;
|
||||||
import org.torproject.android.proxy.util.Prefs;
|
import org.torproject.android.proxy.util.Prefs;
|
||||||
|
@ -110,9 +112,9 @@ public class downloadReciever extends AsyncTask<String, Integer, String> {
|
||||||
.setCategory(Notification.CATEGORY_SERVICE)
|
.setCategory(Notification.CATEGORY_SERVICE)
|
||||||
.setPriority(Notification.PRIORITY_DEFAULT)
|
.setPriority(Notification.PRIORITY_DEFAULT)
|
||||||
.addAction(R.drawable.ic_download, "Cancel",pendingIntent)
|
.addAction(R.drawable.ic_download, "Cancel",pendingIntent)
|
||||||
.setSmallIcon(android.R.drawable.stat_sys_download);
|
.setSmallIcon(android.R.drawable.stat_sys_download)
|
||||||
|
.setDeleteIntent(pendingIntent)
|
||||||
// build.setOngoing(Prefs.persistNotifications());
|
.setOngoing(false);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
NotificationChannel channel = new NotificationChannel(mID + "",
|
NotificationChannel channel = new NotificationChannel(mID + "",
|
||||||
|
@ -173,6 +175,9 @@ public class downloadReciever extends AsyncTask<String, Integer, String> {
|
||||||
long total = 0;
|
long total = 0;
|
||||||
|
|
||||||
while ((count = mStream.read(data)) != -1) {
|
while ((count = mStream.read(data)) != -1) {
|
||||||
|
if(!status.sSettingIsAppRunning){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
total += count;
|
total += count;
|
||||||
int cur = (int) ((total * 100) / lenghtOfFile);
|
int cur = (int) ((total * 100) / lenghtOfFile);
|
||||||
if(lenghtOfFile<0){
|
if(lenghtOfFile<0){
|
||||||
|
@ -236,6 +241,9 @@ public class downloadReciever extends AsyncTask<String, Integer, String> {
|
||||||
float lenghtOfFile = response.getEntity().getContentLength();
|
float lenghtOfFile = response.getEntity().getContentLength();
|
||||||
int read;
|
int read;
|
||||||
while ((read = mStream.read(data)) != -1) {
|
while ((read = mStream.read(data)) != -1) {
|
||||||
|
if(!status.sSettingIsAppRunning){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
total += read;
|
total += read;
|
||||||
int cur = (int) ((total * 100) / response.getEntity().getContentLength());
|
int cur = (int) ((total * 100) / response.getEntity().getContentLength());
|
||||||
mDownloadByte = cur;
|
mDownloadByte = cur;
|
||||||
|
@ -309,6 +317,7 @@ public class downloadReciever extends AsyncTask<String, Integer, String> {
|
||||||
build.setOngoing(false);
|
build.setOngoing(false);
|
||||||
build.addAction(android.R.drawable.stat_sys_download, "Open",pendingIntent);
|
build.addAction(android.R.drawable.stat_sys_download, "Open",pendingIntent);
|
||||||
build.addAction(R.drawable.ic_download, "Cancel",pendingIntent1);
|
build.addAction(R.drawable.ic_download, "Cancel",pendingIntent1);
|
||||||
|
build.setOngoing(false);
|
||||||
build.setPriority(Notification.PRIORITY_LOW);
|
build.setPriority(Notification.PRIORITY_LOW);
|
||||||
mNotifyManager.notify(mID, build.build());
|
mNotifyManager.notify(mID, build.build());
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ public class messageManager
|
||||||
((SwitchMaterial) mDialog.findViewById(R.id.pTPStatus)).setChecked(false);
|
((SwitchMaterial) mDialog.findViewById(R.id.pTPStatus)).setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
((TextView) mDialog.findViewById(R.id.pHeaderSubpart)).setText(helperMethod.getDomainName(mData.get(0).toString()));
|
((TextView) mDialog.findViewById(R.id.pHeaderSubpart)).setText(helperMethod.getDomainName(mData.get(0).toString().replace("genesishiddentechnologies.com", "genesis.onion")));
|
||||||
mDialog.setOnDismissListener(dialog -> onClearReference());
|
mDialog.setOnDismissListener(dialog -> onClearReference());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,11 +98,6 @@ public class orbotManager
|
||||||
|
|
||||||
private void onSetProxy(){
|
private void onSetProxy(){
|
||||||
|
|
||||||
PrefsHelper.setPref(keys.PROXY_TYPE, 1);
|
|
||||||
PrefsHelper.setPref(keys.PROXY_SOCKS, constants.CONST_PROXY_SOCKS);
|
|
||||||
PrefsHelper.setPref(keys.PROXY_SOCKS_PORT, 9055);
|
|
||||||
PrefsHelper.setPref(keys.PROXY_SOCKS_VERSION,constants.CONST_PROXY_SOCKS_VERSION);
|
|
||||||
PrefsHelper.setPref(keys.PROXY_SOCKS_REMOTE_DNS,constants.CONST_PROXY_SOCKS_REMOTE_DNS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeProxy(int pShowImages, boolean mClearOnExit)
|
private void initializeProxy(int pShowImages, boolean mClearOnExit)
|
||||||
|
@ -115,7 +110,7 @@ public class orbotManager
|
||||||
|
|
||||||
PrefsHelper.setPref(keys.PROXY_TYPE, 1);
|
PrefsHelper.setPref(keys.PROXY_TYPE, 1);
|
||||||
PrefsHelper.setPref(keys.PROXY_SOCKS,constants.CONST_PROXY_SOCKS);
|
PrefsHelper.setPref(keys.PROXY_SOCKS,constants.CONST_PROXY_SOCKS);
|
||||||
PrefsHelper.setPref(keys.PROXY_SOCKS_PORT, 9055);
|
PrefsHelper.setPref(keys.PROXY_SOCKS_PORT, 9050);
|
||||||
PrefsHelper.setPref(keys.PROXY_SOCKS_VERSION,constants.CONST_PROXY_SOCKS_VERSION);
|
PrefsHelper.setPref(keys.PROXY_SOCKS_VERSION,constants.CONST_PROXY_SOCKS_VERSION);
|
||||||
PrefsHelper.setPref(keys.PROXY_SOCKS_REMOTE_DNS,constants.CONST_PROXY_SOCKS_REMOTE_DNS);
|
PrefsHelper.setPref(keys.PROXY_SOCKS_REMOTE_DNS,constants.CONST_PROXY_SOCKS_REMOTE_DNS);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class pluginEnums
|
||||||
|
|
||||||
/*Download Manager*/
|
/*Download Manager*/
|
||||||
public enum eDownloadManager{
|
public enum eDownloadManager{
|
||||||
M_DOWNLOAD_FILE, M_CANCEL, M_TRIGGER, M_START_SERVICE, M_DOWNLOAD_BLOB
|
M_DOWNLOAD_FILE, M_CANCEL, M_TRIGGER, M_START_SERVICE, M_DOWNLOAD_BLOB, M_SWIPE
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Notification Manager*/
|
/*Notification Manager*/
|
||||||
|
|
|
@ -16,6 +16,8 @@ public class downloadNotificationReciever extends BroadcastReceiver {
|
||||||
pluginController.getInstance().onDownloadInvoke(Collections.singletonList(intent.getExtras().getInt(CONST_DOWNLOAD_INTENT_KEY)), pluginEnums.eDownloadManager.M_TRIGGER);
|
pluginController.getInstance().onDownloadInvoke(Collections.singletonList(intent.getExtras().getInt(CONST_DOWNLOAD_INTENT_KEY)), pluginEnums.eDownloadManager.M_TRIGGER);
|
||||||
}else if(mCommand==0 || mCommand==2) {
|
}else if(mCommand==0 || mCommand==2) {
|
||||||
pluginController.getInstance().onDownloadInvoke(Collections.singletonList(intent.getExtras().getInt(CONST_DOWNLOAD_INTENT_KEY)), pluginEnums.eDownloadManager.M_CANCEL);
|
pluginController.getInstance().onDownloadInvoke(Collections.singletonList(intent.getExtras().getInt(CONST_DOWNLOAD_INTENT_KEY)), pluginEnums.eDownloadManager.M_CANCEL);
|
||||||
|
}else if(mCommand==3) {
|
||||||
|
pluginController.getInstance().onDownloadInvoke(Collections.singletonList(intent.getExtras().getInt(CONST_DOWNLOAD_INTENT_KEY)), pluginEnums.eDownloadManager.M_CANCEL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@xml/hox_rounded_corner"
|
android:background="@xml/hox_rounded_corner"
|
||||||
android:minHeight="150dp"
|
android:minHeight="130dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
|
@ -79,10 +79,12 @@
|
||||||
android:id="@+id/pDivider"
|
android:id="@+id/pDivider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
android:background="@color/c_view_divier_background"
|
android:background="@color/c_view_divier_background"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/pNavigationContainer"
|
app:layout_constraintBottom_toTopOf="@+id/pNavigationContainer"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/pDescription" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/pNavigationContainer"
|
android:id="@+id/pNavigationContainer"
|
||||||
|
@ -91,7 +93,8 @@
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/pDivider">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/pDismiss"
|
android:id="@+id/pDismiss"
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/pLock"
|
android:id="@+id/pLock"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="18dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="18dp"
|
||||||
android:layout_marginStart="7dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:contentDescription="@string/GENERAL_TODO"
|
android:contentDescription="@string/GENERAL_TODO"
|
||||||
android:src="@xml/ic_baseline_lock"
|
android:src="@xml/ic_baseline_lock"
|
||||||
|
@ -31,9 +31,9 @@
|
||||||
android:id="@+id/pHeader"
|
android:id="@+id/pHeader"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="14dp"
|
||||||
android:paddingStart="5dp"
|
android:paddingStart="5dp"
|
||||||
android:text="@string/ALERT_SECURE"
|
android:text="onion:"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/green_button"
|
android:textColor="@color/green_button"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
|
@ -44,14 +44,20 @@
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/pHeaderSubpart"
|
android:id="@+id/pHeaderSubpart"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginStart="2dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
android:alpha="0.8"
|
android:alpha="0.8"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:text="www.bbc.com"
|
android:text="www.bbc.com"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/c_alert_text"
|
android:textColor="@color/c_alert_text"
|
||||||
android:textSize="14sp"
|
android:textSize="15sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_weight="1"
|
||||||
app:layout_constraintStart_toEndOf="@+id/pHeader"
|
app:layout_constraintStart_toEndOf="@+id/pHeader"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
@ -256,8 +262,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="20dp"
|
||||||
android:alpha="0.6"
|
android:alpha="0.6"
|
||||||
|
android:visibility="gone"
|
||||||
android:paddingEnd="10dp"
|
android:paddingEnd="10dp"
|
||||||
android:text="@string/ALERT_SECURE_INFO"
|
android:text="@string/ALERT_SECURE_INFO"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
|
@ -272,8 +279,8 @@
|
||||||
android:id="@+id/pDescription2"
|
android:id="@+id/pDescription2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="11dp"
|
||||||
android:layout_marginTop="7dp"
|
android:layout_marginTop="12dp"
|
||||||
android:alpha="0.6"
|
android:alpha="0.6"
|
||||||
android:paddingEnd="10dp"
|
android:paddingEnd="10dp"
|
||||||
android:text="@string/ALERT_SECURE_INFO_DETAIL"
|
android:text="@string/ALERT_SECURE_INFO_DETAIL"
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
android:id="@+id/fProfilCollapsing"
|
android:id="@+id/fProfilCollapsing"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
app:scrimAnimationDuration="10"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
||||||
|
@ -92,10 +93,10 @@
|
||||||
android:id="@+id/pSearchInput"
|
android:id="@+id/pSearchInput"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="-35dp"
|
android:layout_marginStart="-36dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:imeOptions="flagNoExtractUi"
|
android:imeOptions="flagNoExtractUi"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
|
@ -110,7 +111,7 @@
|
||||||
android:importantForAutofill="no"
|
android:importantForAutofill="no"
|
||||||
android:inputType="textNoSuggestions"
|
android:inputType="textNoSuggestions"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingStart="40dp"
|
android:paddingStart="38dp"
|
||||||
android:paddingEnd="15dp"
|
android:paddingEnd="15dp"
|
||||||
android:popupElevation="0dp"
|
android:popupElevation="0dp"
|
||||||
android:requiresFadingEdge="horizontal"
|
android:requiresFadingEdge="horizontal"
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
android:id="@+id/pIcon"
|
android:id="@+id/pIcon"
|
||||||
android:layout_width="33dp"
|
android:layout_width="33dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_marginStart="5.5dp"
|
android:layout_marginStart="9dp"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:contentDescription="@string/GENERAL_TODO"
|
android:contentDescription="@string/GENERAL_TODO"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="5dp"
|
||||||
android:paddingTop="11dp"
|
android:paddingTop="11dp"
|
||||||
android:text="@string/GENERAL_SEARCH_ENGINE"
|
android:text="@string/GENERAL_SEARCH_ENGINE"
|
||||||
android:textColor="@color/c_text_v1"
|
android:textColor="@color/c_text_v1"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Version */
|
/* Version */
|
||||||
project.ext.vname = 'Build | Dark-Origin 1.0'
|
project.ext.vname = 'Build | Dark-Origin 1.3'
|
||||||
project.ext.vcode = 45
|
project.ext.vcode = 60
|
||||||
project.ext.buildType = 'release'
|
project.ext.buildType = 'release'
|
||||||
|
|
||||||
/* dimension */
|
/* dimension */
|
||||||
|
|
|
@ -50,7 +50,7 @@ dependencies {
|
||||||
|
|
||||||
implementation 'com.jaredrummler:android-shell:1.0.0'
|
implementation 'com.jaredrummler:android-shell:1.0.0'
|
||||||
implementation fileTree(dir: 'libs', include: ['.so'])
|
implementation fileTree(dir: 'libs', include: ['.so'])
|
||||||
implementation 'androidx.core:core:1.3.2'
|
implementation 'androidx.core:core:1.5.0'
|
||||||
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
|
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
|
|
@ -200,6 +200,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Log.i("sda","ASd");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -242,9 +243,18 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
mNotificationManager.createNotificationChannel(mChannel);
|
mNotificationManager.createNotificationChannel(mChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean mToolbarUpdating = false;
|
||||||
@SuppressLint({"NewApi", "RestrictedApi"})
|
@SuppressLint({"NewApi", "RestrictedApi"})
|
||||||
public void showToolbarNotification(String notifyMsg, int notifyType, int icon) {
|
public void showToolbarNotification(String notifyMsg, int notifyType, int icon) {
|
||||||
|
if(!mToolbarUpdating){
|
||||||
|
mToolbarUpdating = true;
|
||||||
|
}else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
if(isAppClosed){
|
if(isAppClosed){
|
||||||
|
Log.i("superman", "superman");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PackageManager pm = getPackageManager();
|
PackageManager pm = getPackageManager();
|
||||||
|
@ -289,8 +299,10 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
} else {
|
} else {
|
||||||
mNotificationManager.notify(NOTIFY_ID, notification);
|
mNotificationManager.notify(NOTIFY_ID, notification);
|
||||||
}
|
}
|
||||||
|
}catch (Exception ignored){}
|
||||||
|
|
||||||
mNotificationShowing = true;
|
mNotificationShowing = true;
|
||||||
|
mToolbarUpdating = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -315,7 +327,10 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
Intent intent = new Intent(this, DummyActivity.class);
|
Intent intent = new Intent(this, DummyActivity.class);
|
||||||
intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}catch (Exception ignored){}
|
}catch (Exception ignored){
|
||||||
|
Log.i("sda","ASd");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -743,6 +758,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
try {
|
try {
|
||||||
if (conn != null) torProcId = conn.getInfo("process/pid");
|
if (conn != null) torProcId = conn.getInfo("process/pid");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Log.i("sda","ASd");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -958,6 +974,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
// logNotice("waiting...");
|
// logNotice("waiting...");
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Log.i("sda","ASd");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1205,12 +1222,13 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
try {
|
try {
|
||||||
int iconId = R.drawable.ic_stat_tor;
|
int iconId = R.drawable.ic_stat_tor;
|
||||||
|
|
||||||
if (conn != null && mCurrentStatus == STATUS_ON && Prefs.expandedNotifications())
|
if (conn != null && mCurrentStatus == STATUS_ON && Prefs.expandedNotifications() && mConnectivity)
|
||||||
showToolbarNotification(getString(R.string.newnym), NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo);
|
showToolbarNotification(getString(R.string.newnym), NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo);
|
||||||
|
|
||||||
conn.signal(TorControlCommands.SIGNAL_NEWNYM);
|
conn.signal(TorControlCommands.SIGNAL_NEWNYM);
|
||||||
|
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
|
if(mConnectivity)
|
||||||
enableNotification();
|
enableNotification();
|
||||||
|
|
||||||
} catch (Exception ioe) {
|
} catch (Exception ioe) {
|
||||||
|
@ -1608,6 +1626,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
hidden_services.close();
|
hidden_services.close();
|
||||||
}
|
}
|
||||||
} catch (SecurityException se) {
|
} catch (SecurityException se) {
|
||||||
|
Log.i("sda","ASd");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1628,6 +1647,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
client_cookies.close();
|
client_cookies.close();
|
||||||
}
|
}
|
||||||
} catch (SecurityException se) {
|
} catch (SecurityException se) {
|
||||||
|
Log.i("sda","ASd");
|
||||||
}
|
}
|
||||||
|
|
||||||
return extraLines;
|
return extraLines;
|
||||||
|
|
Loading…
Reference in New Issue