mirror of https://github.com/LeOS-GSI/LeOS-Genesis
parent
617083f48f
commit
faac9cd676
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="C:\Users\msman\.android\avd\Nexus_6P_API_33.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2023-02-07T21:45:12.561778Z" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,3 +1,3 @@
|
|||
#Sat Feb 04 14:33:30 PKT 2023
|
||||
#Thu Feb 09 03:08:42 PKT 2023
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
json=2027486056
|
||||
json=-1378969876
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
#Sat Feb 04 14:33:30 PKT 2023
|
||||
#Thu Feb 09 03:08:42 PKT 2023
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
sdk_analysis_plugin_version=4.8.3
|
||||
set_multidex=true
|
||||
|
|
|
@ -3,15 +3,14 @@ import com.android.build.OutputFile
|
|||
plugins {
|
||||
id "com.jetbrains.python.envs" version "0.0.26"
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply from: 'variables.gradle'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'applovin-quality-service'
|
||||
applovin {
|
||||
apiKey "pCPe4EeU2ZQVwQPeHLgseRqHBX1V5pvo9Piuu4J809dRhadEgukXa1A8po_UeXu5hmPOTaP1v4QPaMKIEOhh50"
|
||||
}
|
||||
|
||||
applovin {
|
||||
apiKey project.ext.applovin_key
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
|
@ -30,7 +29,7 @@ android {
|
|||
}
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
jvmTarget = project.ext.jvmTarget
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
|
@ -76,7 +75,7 @@ android {
|
|||
|
||||
orionRelease.root = project.ext.releaseRoot
|
||||
}
|
||||
namespace 'com.example.myapplication'
|
||||
namespace project.ext.application_id
|
||||
}
|
||||
dependencies {
|
||||
|
||||
|
@ -105,7 +104,7 @@ dependencies {
|
|||
/* Ads Manager */
|
||||
|
||||
implementation 'com.applovin:applovin-sdk:11.7.0'
|
||||
implementation 'com.facebook.android:audience-network-sdk:6.10.0'
|
||||
implementation 'com.facebook.android:audience-network-sdk:6.12.0'
|
||||
implementation 'com.applovin.mediation:facebook-adapter:6.12.0.1'
|
||||
|
||||
/* Orbot Service */
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
#Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public.
|
||||
#Wed May 01 00:42:45 PKT 2019
|
||||
apiSecret=042501af0b2390b9f064ff9a0823e52a2dd04b2280c9b675925cebbb9620ecbf
|
||||
|
||||
|
|
|
@ -1,35 +1,32 @@
|
|||
-keep,includedescriptorclasses class net.sqlcipher.** { *; }
|
||||
-keep,includedescriptorclasses interface net.sqlcipher.** { *; }
|
||||
-keep class org.mozilla.** {*;}
|
||||
-keep class com.flurry.** { *; }
|
||||
-keep class okhttp3.** { *; }
|
||||
-keep interface okhttp3.** { *; }
|
||||
-keepattributes Signature
|
||||
-keepattributes Annotation
|
||||
-keepattributes *Annotation*,EnclosingMethod,Signature
|
||||
-keepclasseswithmembers class * { public <init>(android.content.Context, android.util.AttributeSet, int); }
|
||||
|
||||
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable
|
||||
|
||||
-dontwarn javax.annotation.**
|
||||
-dontwarn org.codehaus.mojo.animal_sniffer.*
|
||||
-dontwarn okhttp3.internal.platform.ConscryptPlatform
|
||||
-dontwarn org.conscrypt.ConscryptHostnameVerifier
|
||||
-dontwarn okhttp3.*
|
||||
-dontwarn org.chromium.net.*
|
||||
|
||||
-keep class org.mozilla.** {*;}
|
||||
-keep class com.flurry.** { *; }
|
||||
-dontwarn com.flurry.**
|
||||
-keepattributes *Annotation*,EnclosingMethod,Signature
|
||||
-keepclasseswithmembers class * {
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
|
||||
-dontobfuscate
|
||||
# https://stackoverflow.com/questions/9651703/using-proguard-with-android-without-obfuscation
|
||||
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable
|
||||
|
||||
-keep class org.orbotproject.android.service.vpn.Tun2Socks {
|
||||
void logTun2Socks(java.lang.String, java.lang.String, java.lang.String);
|
||||
}
|
||||
|
||||
-keepattributes Signature
|
||||
-keepattributes Annotation
|
||||
-keep class okhttp3.** { *; }
|
||||
-keep interface okhttp3.** { *; }
|
||||
-dontwarn okhttp3.**
|
||||
-dontwarn okio.**
|
||||
|
||||
-dontobfuscate
|
||||
-dontoptimize
|
||||
-dontpreverify
|
||||
|
||||
# -dontwarn okhttp3.internal.platform.ConscryptPlatform
|
||||
# -dontwarn org.conscrypt.ConscryptHostnameVerifier
|
||||
# -keep class org.orbotproject.android.service.vpn.Tun2Socks {
|
||||
# void logTun2Socks(java.lang.String, java.lang.String, java.lang.String);
|
||||
# }
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import static com.hiddenservices.onionservices.constants.constants.CONST_PACKAGE
|
|||
import android.content.Context;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.hiddenservices.onionservices.appManager.bookmarkManager.bookmarkHome.bookmarkController;
|
||||
import com.hiddenservices.onionservices.appManager.bridgeManager.bridgeController;
|
||||
import com.hiddenservices.onionservices.appManager.historyManager.historyController;
|
||||
|
|
|
@ -8,7 +8,7 @@ import android.webkit.WebChromeClient;
|
|||
import android.webkit.WebView;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -6,7 +6,7 @@ import android.widget.ProgressBar;
|
|||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.sharedUIMethod;
|
||||
|
||||
|
|
|
@ -15,11 +15,12 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.hiddenservices.onionservices.constants.enums;
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.hiddenservices.onionservices.dataManager.models.bookmarkRowModel;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -446,10 +447,12 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
|
|||
mDescription.setText("https://" + mDescription.getText().toString());
|
||||
}
|
||||
|
||||
if (model.getDescription().contains("167.86.99.31") || model.getDescription().contains("orion.onion")) {
|
||||
mFaviconLogo.setImageDrawable(itemView.getResources().getDrawable(R.drawable.genesis));
|
||||
} else {
|
||||
mEvent.invokeObserver(Arrays.asList(mFaviconLogo, "http://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
|
||||
if(status.sLowMemory != enums.MemoryStatus.LOW_MEMORY && status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY){
|
||||
if (model.getDescription().contains("167.86.99.31") || model.getDescription().contains("orion.onion")) {
|
||||
mFaviconLogo.setImageDrawable(itemView.getResources().getDrawable(R.drawable.genesis));
|
||||
} else {
|
||||
mEvent.invokeObserver(Arrays.asList(mFaviconLogo, "https://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
|
||||
}
|
||||
}
|
||||
|
||||
mRowMenu.setOnClickListener(this::onClick);
|
||||
|
|
|
@ -12,7 +12,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -30,7 +30,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.hiddenservices.onionservices.eventObserver;
|
|||
import com.hiddenservices.onionservices.helperManager.sharedUIMethod;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -8,7 +8,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.hiddenservices.onionservices.helperManager.sharedUIMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -17,7 +17,7 @@ import androidx.core.content.ContextCompat;
|
|||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.hiddenservices.onionservices.helperManager.sharedUIMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.hiddenservices.onionservices.constants.status;
|
|||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.hiddenservices.onionservices.dataManager.dataController;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import android.os.Handler;
|
|||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.hiddenservices.onionservices.appManager.activityContextManager;
|
||||
import com.hiddenservices.onionservices.appManager.advertManager.advertController;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeController;
|
||||
|
|
|
@ -16,7 +16,7 @@ import androidx.annotation.NonNull;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -14,7 +14,7 @@ import androidx.core.content.ContextCompat;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.hiddenservices.onionservices.constants.strings;
|
|||
import com.hiddenservices.onionservices.dataManager.models.historyRowModel;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -517,7 +517,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
|
|||
mWebLogo.setText((helperMethod.getDomainName(model.getHeader()).toUpperCase().charAt(0) + ""));
|
||||
String header = model.getHeader();
|
||||
|
||||
if(status.sLowMemory == enums.MemoryStatus.STABLE){
|
||||
if(status.sLowMemory != enums.MemoryStatus.LOW_MEMORY && status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY){
|
||||
if (model.getDescription().contains("167.86.99.31") || model.getDescription().contains("orion.onion")) {
|
||||
mFaviconLogo.setImageDrawable(itemView.getResources().getDrawable(R.drawable.genesis));
|
||||
} else {
|
||||
|
|
|
@ -12,7 +12,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -30,7 +30,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
# Contents of /data/local/tmp/com.yourcompany.yourapp-geckoview-config.yaml
|
||||
|
||||
env:
|
||||
MOZ_LOG: nsHttp:5
|
||||
|
||||
|
||||
prefs:
|
||||
network.proxy.type: 1
|
||||
# network.proxy.socks: "127.0.0.1"
|
||||
# network.proxy.socks_port: 9050
|
||||
network.proxy.socks_version: 5
|
||||
network.proxy.socks_remote_dns: true
|
||||
permissions.default.image: 1
|
||||
browser.display.show_image_placeholders: true
|
||||
browser.cache.disk.enable: false
|
||||
browser.cache.memory.enable: true
|
||||
browser.cache.disk.capacity: 0
|
||||
privacy.resistFingerprinting: true
|
||||
privacy.donottrackheader.enabled: false
|
||||
privacy.donottrackheader.value: 1
|
||||
network.http.sendRefererHeader: 0
|
||||
security.checkloaduri: false
|
||||
security.mixed_content.block_active_content: false
|
||||
security.mixed_content.block_display_content: false
|
||||
media.peerconnection.enabled: false //webrtc disabled
|
||||
browser.cache.disk_cache_ssl: true
|
||||
signon.formlessCapture.enabled: true
|
||||
signon.storeWhenAutocompleteOff: true
|
||||
dom.event.contextmenu.enabled: true
|
||||
layout.css.visited_links_enabled: true
|
||||
security.ssl3.ecdhe_rsa_aes_128_sha: true
|
||||
security.ssl3.ecdhe_ecdsa_aes_128_sha: true
|
||||
security.ssl3.dhe_rsa_aes_128_sha: true
|
||||
security.ssl3.rsa_des_ede3_sha: true
|
||||
security.ssl3.dhe_rsa_aes_256_sha: true
|
||||
browser.safebrowsing.blockedURIs.enabled: false
|
||||
media.gmp-provider.enabled: false
|
||||
browser.send_pings.require_same_host: false
|
||||
webgl.disabled: false
|
||||
pdfjs.enableWebGL: false
|
||||
browser.safebrowsing.malware.enabled: false
|
||||
security.csp.experimentalEnabled: false
|
||||
network.http.referer.spoofSource: false
|
||||
security.OCSP.require: false
|
||||
security.ssl.require_safe_negotiation: false
|
||||
privacy.clearOnShutdown.cache: true
|
||||
privacy.clearOnShutdown.downloads: true
|
||||
privacy.clearOnShutdown.formdata: true
|
||||
privacy.clearOnShutdown.history: true
|
||||
privacy.clearOnShutdown.offlineApps: true
|
||||
privacy.clearOnShutdown.passwords: true
|
||||
privacy.clearOnShutdown.sessions: true
|
||||
privacy.clearOnShutdown.siteSettings: true
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.dataModel;
|
||||
|
||||
public class geckoDataModel {
|
||||
public int mCurrentURL_ID = -1;
|
||||
|
||||
public boolean mFullScreenStatus = false;
|
||||
public boolean mThemeChanged = false;
|
||||
|
||||
public String mCurrentURL = "about:blank";
|
||||
public String mTheme = null;
|
||||
public String mSessionID;
|
||||
public String mCurrentTitle = "loading";
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.delegateModel;
|
||||
|
||||
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.view.autofill.AutofillManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.mozilla.geckoview.Autofill;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
import org.mozilla.geckoview.GeckoView;
|
||||
|
||||
public class autofillDelegate implements Autofill.Delegate {
|
||||
|
||||
private GeckoView mGeckoView;
|
||||
|
||||
public autofillDelegate(GeckoView pGeckoView){
|
||||
mGeckoView = pGeckoView;
|
||||
}
|
||||
|
||||
private Rect displayRectForId(@NonNull final GeckoSession session, @NonNull final Autofill.Node node) {
|
||||
final Matrix matrix = new Matrix();
|
||||
final RectF rectF = new RectF(node.getDimensions());
|
||||
session.getPageToScreenMatrix(matrix);
|
||||
matrix.mapRect(rectF);
|
||||
|
||||
final Rect screenRect = new Rect();
|
||||
rectF.roundOut(screenRect);
|
||||
return screenRect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNodeUpdate(@NonNull final GeckoSession session, @NonNull final Autofill.Node node, @NonNull final Autofill.NodeData data) {
|
||||
final AutofillManager manager;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
manager = mGeckoView.getContext().getSystemService(AutofillManager.class);
|
||||
if (manager == null) {
|
||||
return;
|
||||
}
|
||||
manager.notifyViewEntered(mGeckoView, data.getId(),displayRectForId(session, node));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNodeFocus(@NonNull final GeckoSession session, @NonNull final Autofill.Node node, @NonNull final Autofill.NodeData data) {
|
||||
final AutofillManager manager;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
manager = mGeckoView.getContext().getSystemService(AutofillManager.class);
|
||||
if (manager == null) {
|
||||
return;
|
||||
}
|
||||
manager.notifyViewEntered(mGeckoView, data.getId(),displayRectForId(session, node));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,218 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.delegateModel;
|
||||
|
||||
|
||||
import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_HELP_URL_CACHE;
|
||||
import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_HELP_URL_CACHE_DARK;
|
||||
import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_URL_CACHED;
|
||||
import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_URL_CACHED_DARK;
|
||||
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_URL;
|
||||
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_WITH_LINK;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.dataModel.geckoDataModel;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.geckoDownloadManager;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.geckoSession;
|
||||
import com.hiddenservices.onionservices.constants.enums;
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import org.json.JSONObject;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
import org.mozilla.geckoview.WebResponse;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class contentDelegate implements GeckoSession.ContentDelegate {
|
||||
|
||||
/*Private Variables*/
|
||||
|
||||
private WeakReference<AppCompatActivity> mContext;
|
||||
private eventObserver.eventListener mEvent;
|
||||
private geckoDataModel mGeckoDataModel;
|
||||
private geckoSession mGeckoSession;
|
||||
|
||||
private geckoDownloadManager mDownloadManager;
|
||||
private int mCrashCount = 0;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
public contentDelegate(WeakReference<AppCompatActivity> pContext, eventObserver.eventListener pEvent, geckoDataModel pGeckoDataModel, geckoSession pGeckoSession) {
|
||||
this.mContext = pContext;
|
||||
this.mEvent = pEvent;
|
||||
this.mGeckoDataModel = pGeckoDataModel;
|
||||
this.mGeckoSession = pGeckoSession;
|
||||
|
||||
mDownloadManager = new geckoDownloadManager();
|
||||
}
|
||||
|
||||
/*Local Listeners*/
|
||||
|
||||
@UiThread
|
||||
public void onTitleChange(@NonNull GeckoSession var1, @Nullable String var2) {
|
||||
if (var2 != null && !var2.equals(strings.GENERIC_EMPTY_STR) && var2.length() > 2 && !var2.equals("about:blank")) {
|
||||
mGeckoDataModel.mCurrentTitle = var2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFullScreen(@NonNull GeckoSession var1, boolean var2) {
|
||||
mGeckoDataModel.mFullScreenStatus = var2;
|
||||
mEvent.invokeObserver(Arrays.asList(var2, mGeckoDataModel.mSessionID), enums.etype.ON_FULL_SCREEN);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
@Override
|
||||
public void onContextMenu(@NonNull GeckoSession var1, int var2, int var3, @NonNull GeckoSession.ContentDelegate.ContextElement var4) {
|
||||
|
||||
String title = strings.GENERIC_EMPTY_STR;
|
||||
if (var4.title != null) {
|
||||
title = var4.title;
|
||||
}
|
||||
if (var4.type != 0 && var4.srcUri != null) {
|
||||
if (var4.linkUri != null) {
|
||||
mEvent.invokeObserver(Arrays.asList(var4.linkUri, mGeckoDataModel.mSessionID, var4.srcUri, title, mGeckoDataModel.mTheme, var4.altText, mGeckoSession, mContext.get()), M_LONG_PRESS_WITH_LINK);
|
||||
} else {
|
||||
try {
|
||||
String mTitle = var4.title;
|
||||
if (mTitle == null || mTitle.length() <= 0) {
|
||||
mTitle = helperMethod.getDomainName(mGeckoDataModel.mCurrentURL) + "\n" + var4.srcUri;
|
||||
}
|
||||
mEvent.invokeObserver(Arrays.asList(var4.srcUri, mGeckoDataModel.mSessionID, mTitle, mGeckoDataModel.mTheme, mGeckoSession, mContext.get()), enums.etype.on_long_press);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
Log.i("", "");
|
||||
}
|
||||
}
|
||||
} else if (var4.linkUri != null) {
|
||||
mEvent.invokeObserver(Arrays.asList(var4.linkUri, mGeckoDataModel.mSessionID, title, mGeckoDataModel.mTheme, mGeckoSession, mContext.get()), M_LONG_PRESS_URL);
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
@Override
|
||||
public void onExternalResponse(@NonNull GeckoSession session, @NonNull WebResponse response) {
|
||||
try {
|
||||
if (response.headers.containsKey("Content-Disposition")) {
|
||||
mDownloadManager.downloadFile(response, mGeckoSession, mContext.get(), mEvent);
|
||||
} else if (response.headers.containsKey("Content-Type")) {
|
||||
mDownloadManager.downloadFile(response, mGeckoSession, mContext.get(), mEvent);
|
||||
}
|
||||
} catch (ActivityNotFoundException e) {
|
||||
mEvent.invokeObserver(Arrays.asList(response, mGeckoDataModel.mSessionID), enums.etype.on_handle_external_intent);
|
||||
mGeckoSession.stop();
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void onFirstContentfulPaint(@NonNull GeckoSession var1) {
|
||||
if (mGeckoDataModel.mCurrentURL.contains("167.86.99.31") || mGeckoDataModel.mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED) || mGeckoDataModel.mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoDataModel.mCurrentURL.startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoDataModel.mCurrentURL.startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, false), enums.etype.M_ON_BANNER_UPDATE);
|
||||
} else {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, true), enums.etype.M_ON_BANNER_UPDATE);
|
||||
}
|
||||
|
||||
if (!mGeckoDataModel.mCurrentURL.equals("about:blank")) {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), enums.etype.ON_FIRST_PAINT);
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), enums.etype.ON_LOAD_REQUEST);
|
||||
}
|
||||
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mTheme), enums.etype.ON_EXPAND_TOP_BAR);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void onWebAppManifest(@NonNull GeckoSession var1, @NonNull JSONObject var2) {
|
||||
try {
|
||||
mGeckoDataModel.mThemeChanged = true;
|
||||
mGeckoDataModel.mTheme = var2.getString("theme_color");
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mTheme), enums.etype.ON_UPDATE_THEME);
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL,mGeckoDataModel.mSessionID,mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), enums.etype.M_INDEX_WEBSITE);
|
||||
} catch (Exception ex) {
|
||||
mGeckoDataModel.mTheme = null;
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mTheme), enums.etype.ON_UPDATE_THEME);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), enums.etype.ON_UPDATE_TAB_TITLE);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void onCrash(@NonNull GeckoSession session) {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, mGeckoSession), enums.etype.ON_DESTROY_MEDIA);
|
||||
|
||||
if (!mGeckoSession.isClosed() && status.sSettingIsAppStarted) {
|
||||
if (mEvent == null) {
|
||||
return;
|
||||
}
|
||||
Object mSessionObject = mEvent.invokeObserver(null, enums.etype.SESSION_ID);
|
||||
if (mSessionObject == null || mGeckoDataModel.mSessionID == null) {
|
||||
return;
|
||||
}
|
||||
String mSessionID = (String) mSessionObject;
|
||||
if (mSessionID.equals(mGeckoDataModel.mSessionID)) {
|
||||
if (mCrashCount <= 5) {
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() -> {
|
||||
try {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, this), enums.etype.M_OPEN_SESSION);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}, mCrashCount * 500L);
|
||||
}
|
||||
mCrashCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void onKill(@NonNull GeckoSession session) {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, mGeckoSession), enums.etype.ON_DESTROY_MEDIA);
|
||||
|
||||
if (!mGeckoSession.isClosed() && status.sSettingIsAppStarted) {
|
||||
if (mEvent == null) {
|
||||
return;
|
||||
}
|
||||
Object mSessionObject = mEvent.invokeObserver(null, enums.etype.SESSION_ID);
|
||||
if (mSessionObject == null || mGeckoDataModel.mSessionID == null) {
|
||||
return;
|
||||
}
|
||||
String mSessionID = (String) mSessionObject;
|
||||
|
||||
|
||||
if (mSessionID.equals(mGeckoDataModel.mSessionID)) {
|
||||
if (mCrashCount <= 5) {
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() -> {
|
||||
if (status.sSettingIsAppStarted && !session.isOpen()) {
|
||||
try {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, this), enums.etype.M_OPEN_SESSION);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}, mCrashCount * 500L);
|
||||
}
|
||||
mCrashCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*Local Triggers*/
|
||||
|
||||
public boolean getFullScreenStatus() {
|
||||
return !mGeckoDataModel.mFullScreenStatus;
|
||||
}
|
||||
|
||||
public void resetCrash() {
|
||||
mCrashCount = 0;
|
||||
}
|
||||
|
||||
public geckoDownloadManager getDownloadManager(){
|
||||
return this.mDownloadManager;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.delegateModel;
|
||||
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.UiThread;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.dataModel.geckoDataModel;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.geckoSession;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.helperClasses.intentHandler;
|
||||
import com.hiddenservices.onionservices.constants.enums;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class historyDelegate implements GeckoSession.HistoryDelegate {
|
||||
|
||||
/*Private Variables*/
|
||||
|
||||
private WeakReference<AppCompatActivity> mContext;
|
||||
private GeckoSession.HistoryDelegate.HistoryList mHistory = null;
|
||||
private eventObserver.eventListener mEvent;
|
||||
private geckoDataModel mGeckoDataModel;
|
||||
private geckoSession mGeckoSession;
|
||||
private int mCurrentIndex = 0;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
public historyDelegate(WeakReference<AppCompatActivity> pContext, eventObserver.eventListener pEvent, geckoDataModel pGeckoDataModel, geckoSession pGeckoSession) {
|
||||
this.mContext = pContext;
|
||||
this.mEvent = pEvent;
|
||||
this.mGeckoDataModel = pGeckoDataModel;
|
||||
this.mGeckoSession = pGeckoSession;
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void onHistoryStateChange(@NonNull GeckoSession var1, @NonNull GeckoSession.HistoryDelegate.HistoryList var2) {
|
||||
mHistory = var2;
|
||||
if(mHistory !=null){
|
||||
setURL(mHistory.get(mHistory.getCurrentIndex()).getUri());
|
||||
mEvent.invokeObserver(Arrays.asList(mHistory, mGeckoDataModel.mSessionID), enums.etype.on_url_load);
|
||||
if(mCurrentIndex != var2.getCurrentIndex()){
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mHistory.get(mHistory.getCurrentIndex()).getTitle(), mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, mGeckoSession), enums.etype.ON_UPDATE_SEARCH_BAR);
|
||||
}
|
||||
|
||||
Object mID = mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mHistory.get(mHistory.getCurrentIndex()).getTitle(), -1, mGeckoDataModel.mTheme, mGeckoSession, false), enums.etype.ON_UPDATE_HISTORY);
|
||||
if (mID != null) {
|
||||
mGeckoDataModel.mCurrentURL_ID = (int) mID;
|
||||
}
|
||||
}
|
||||
mCurrentIndex = var2.getCurrentIndex();
|
||||
}
|
||||
|
||||
/*Local Triggers*/
|
||||
|
||||
public void setURL(String pURL) {
|
||||
if (helperMethod.getHost(pURL).endsWith(".onion")) {
|
||||
pURL = pURL.replace("www.", "");
|
||||
}
|
||||
|
||||
this.mGeckoDataModel.mCurrentURL = pURL;
|
||||
if(pURL.startsWith("tel:")){
|
||||
intentHandler.actionDial(pURL, mContext);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isHistoryEmpty(){
|
||||
if(mHistory!=null && mHistory.size()>0){
|
||||
return false;
|
||||
}else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager;
|
||||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.delegateModel;
|
||||
|
||||
|
||||
import static android.content.Context.NOTIFICATION_SERVICE;
|
||||
import android.app.Activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
|
@ -12,27 +13,42 @@ import android.content.Intent;
|
|||
import android.graphics.Bitmap;
|
||||
import android.os.Build;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginReciever.mediaNotificationReciever;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
|
||||
public class mediaDelegate implements GeckoSession.MediaDelegate {
|
||||
private Context mContext;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public mediaDelegate(Activity activity, Context pContext) {
|
||||
public class mediaDelegate implements GeckoSession.MediaDelegate {
|
||||
|
||||
/*Private Variables*/
|
||||
|
||||
private WeakReference<AppCompatActivity> mContext;
|
||||
private static int S_NOTIFICATION_ID = 1030;
|
||||
private static String S_NOTIFICATION_CHANNEL_ID = "1030";
|
||||
private static String S_NOTIFICATION_CHANNEL_NAME = "MEDIA_NOTIFICATION";
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
public mediaDelegate(WeakReference<AppCompatActivity> pContext) {
|
||||
mContext = pContext;
|
||||
}
|
||||
|
||||
public void onHideDefaultNotification(){
|
||||
NotificationManagerCompat.from(mContext).cancel(1030);
|
||||
NotificationManagerCompat.from(mContext.get()).cancel(S_NOTIFICATION_ID);
|
||||
}
|
||||
|
||||
public void showNotification(Context context, String title, String url, Bitmap mediaImage, boolean not_status) {
|
||||
NotificationManager mNotificationManager = (NotificationManager) mContext.getSystemService( NOTIFICATION_SERVICE ) ;
|
||||
/*Triggers*/
|
||||
|
||||
@SuppressLint("InlinedApi")
|
||||
public void showNotification(Context context, String title, String url, Bitmap mediaImage, boolean media_status) {
|
||||
NotificationManager mNotificationManager = (NotificationManager) mContext.get().getSystemService( NOTIFICATION_SERVICE ) ;
|
||||
if(title.length()<=0 || !status.sBackgroundMusic){
|
||||
return;
|
||||
}
|
||||
|
@ -57,8 +73,8 @@ public class mediaDelegate implements GeckoSession.MediaDelegate {
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (not_status){
|
||||
PendingIntent pIntent = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_play", 0);
|
||||
if (!media_status){
|
||||
PendingIntent pIntent = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, S_NOTIFICATION_ID, "media_play", 0);
|
||||
contentView.setOnClickPendingIntent(R.id.trigger, pIntent);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ) {
|
||||
contentView.setImageViewResource(R.id.trigger, R.drawable.ic_baseline_play_arrow_no_tint);
|
||||
|
@ -66,7 +82,7 @@ public class mediaDelegate implements GeckoSession.MediaDelegate {
|
|||
contentView.setImageViewResource(R.id.trigger, R.drawable.ic_baseline_play_arrow);
|
||||
}
|
||||
}else {
|
||||
PendingIntent pIntent = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_pause", 1);
|
||||
PendingIntent pIntent = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, S_NOTIFICATION_ID, "media_pause", 1);
|
||||
contentView.setOnClickPendingIntent(R.id.trigger, pIntent);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ) {
|
||||
contentView.setImageViewResource(R.id.trigger, R.drawable.ic_baseline_pause_no_tint);
|
||||
|
@ -75,15 +91,15 @@ public class mediaDelegate implements GeckoSession.MediaDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
PendingIntent pIntentPrev = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_next", 2);
|
||||
PendingIntent pIntentPrev = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, S_NOTIFICATION_ID, "media_next", 2);
|
||||
contentView.setOnClickPendingIntent(R.id.next, pIntentPrev);
|
||||
|
||||
if(android.os.Build.VERSION. SDK_INT > Build.VERSION_CODES.N){
|
||||
PendingIntent pIntentNext = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, 1030, "media_back", 3);
|
||||
PendingIntent pIntentNext = helperMethod.onCreateActionIntent(context, mediaNotificationReciever.class, S_NOTIFICATION_ID, "media_back", 3);
|
||||
contentView.setOnClickPendingIntent(R.id.back, pIntentNext);
|
||||
}
|
||||
|
||||
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext, "1030" ) ;
|
||||
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext.get(), S_NOTIFICATION_CHANNEL_ID ) ;
|
||||
|
||||
mBuilder.setPriority(Notification.PRIORITY_LOW);
|
||||
mBuilder.setAutoCancel(true);
|
||||
|
@ -98,29 +114,23 @@ public class mediaDelegate implements GeckoSession.MediaDelegate {
|
|||
mBuilder.setAutoCancel( true ) ;
|
||||
if (android.os.Build.VERSION. SDK_INT >= android.os.Build.VERSION_CODES. O ) {
|
||||
int importance = NotificationManager.IMPORTANCE_LOW ;
|
||||
NotificationChannel notificationChannel = new NotificationChannel( "1030" , "NOTIFICATION_CHANNEL_NAME" , importance) ;
|
||||
NotificationChannel notificationChannel = new NotificationChannel( S_NOTIFICATION_CHANNEL_ID , S_NOTIFICATION_CHANNEL_NAME , importance) ;
|
||||
notificationChannel.setSound(null, null);
|
||||
mBuilder.setChannelId("1030") ;
|
||||
mBuilder.setChannelId(S_NOTIFICATION_CHANNEL_ID) ;
|
||||
assert mNotificationManager != null;
|
||||
mNotificationManager.createNotificationChannel(notificationChannel) ;
|
||||
}
|
||||
Notification notification = mBuilder.build();
|
||||
|
||||
mBuilder.setContentIntent(PendingIntent.getActivity(context, 1030, new Intent(context, mediaDelegate.class), PendingIntent.FLAG_IMMUTABLE));
|
||||
PendingIntent dummyIntent = null;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
PendingIntent.getActivity(context, 1030, new Intent(), PendingIntent.FLAG_IMMUTABLE);
|
||||
}else {
|
||||
PendingIntent.getActivity(context, 1030, new Intent(), 0);
|
||||
}
|
||||
notification.fullScreenIntent = dummyIntent;
|
||||
mBuilder.setContentIntent(PendingIntent.getActivity(context, S_NOTIFICATION_ID, new Intent(context, mediaDelegate.class), PendingIntent.FLAG_IMMUTABLE));
|
||||
notification.fullScreenIntent = null;
|
||||
|
||||
if(!not_status){
|
||||
if(media_status){
|
||||
notification.flags |= Notification.FLAG_NO_CLEAR;
|
||||
}
|
||||
|
||||
notification.defaults = 0;
|
||||
mNotificationManager.notify(1030 , notification) ;
|
||||
mNotificationManager.notify(S_NOTIFICATION_ID , notification) ;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,124 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.delegateModel;
|
||||
|
||||
import static com.hiddenservices.onionservices.constants.strings.GENERIC_EMPTY_STR;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.dataModel.geckoDataModel;
|
||||
import com.hiddenservices.onionservices.constants.enums;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
import org.mozilla.geckoview.MediaSession;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class mediaSessionDelegate implements MediaSession.Delegate{
|
||||
|
||||
/*Private Variables*/
|
||||
|
||||
private MediaSession mMediaSession = null;
|
||||
private mediaDelegate mMediaDelegate;
|
||||
private WeakReference<AppCompatActivity> mContext;
|
||||
private geckoDataModel mGeckoDataModel;
|
||||
|
||||
private Bitmap mMediaImage;
|
||||
private String mMediaTitle = GENERIC_EMPTY_STR;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
public mediaSessionDelegate(WeakReference<AppCompatActivity> pContext, geckoDataModel pGeckoDataModel, mediaDelegate pMediaDelegate){
|
||||
this.mContext = pContext;
|
||||
this.mMediaDelegate = pMediaDelegate;
|
||||
this.mGeckoDataModel = pGeckoDataModel;
|
||||
}
|
||||
|
||||
/*Local Listeners*/
|
||||
|
||||
@Override
|
||||
public void onActivated(@NonNull GeckoSession session, @NonNull MediaSession mediaSession) {
|
||||
MediaSession.Delegate.super.onActivated(session, mediaSession);
|
||||
mMediaSession = mediaSession;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeactivated(@NonNull GeckoSession session, @NonNull MediaSession mediaSession) {
|
||||
MediaSession.Delegate.super.onPause(session, mediaSession);
|
||||
mMediaDelegate.onHideDefaultNotification();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMetadata(@NonNull GeckoSession session, @NonNull MediaSession mediaSession, @NonNull MediaSession.Metadata meta) {
|
||||
|
||||
try {
|
||||
mMediaTitle = meta.title;
|
||||
mMediaImage = meta.artwork.getBitmap(250).poll(2500);
|
||||
mMediaDelegate.showNotification(mContext.get(), mMediaTitle, helperMethod.getHost(mGeckoDataModel.mCurrentURL), mMediaImage, true);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
MediaSession.Delegate.super.onMetadata(session, mediaSession, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFeatures(@NonNull GeckoSession session, @NonNull MediaSession mediaSession, long features) {
|
||||
MediaSession.Delegate.super.onFeatures(session, mediaSession, features);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlay(@NonNull GeckoSession session, @NonNull MediaSession mediaSession) {
|
||||
MediaSession.Delegate.super.onPlay(session, mediaSession);
|
||||
mMediaDelegate.showNotification(this.mContext.get(), mMediaTitle, helperMethod.getHost(mGeckoDataModel.mCurrentURL), mMediaImage, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause(@NonNull GeckoSession session, @NonNull MediaSession mediaSession) {
|
||||
MediaSession.Delegate.super.onPause(session, mediaSession);
|
||||
mMediaDelegate.showNotification(this.mContext.get(), mMediaTitle, helperMethod.getHost(mGeckoDataModel.mCurrentURL), mMediaImage, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop(@NonNull GeckoSession session, @NonNull MediaSession mediaSession) {
|
||||
MediaSession.Delegate.super.onStop(session, mediaSession);
|
||||
mMediaDelegate.showNotification(this.mContext.get(), mMediaTitle, helperMethod.getHost(mGeckoDataModel.mCurrentURL), mMediaImage, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPositionState(@NonNull GeckoSession session, @NonNull MediaSession mediaSession, @NonNull MediaSession.PositionState state) {
|
||||
MediaSession.Delegate.super.onPositionState(session, mediaSession, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFullscreen(@NonNull GeckoSession session, @NonNull MediaSession mediaSession, boolean enabled, @Nullable @org.jetbrains.annotations.Nullable MediaSession.ElementMetadata meta) {
|
||||
MediaSession.Delegate.super.onFullscreen(session, mediaSession, enabled, meta);
|
||||
}
|
||||
|
||||
/*Triggers*/
|
||||
|
||||
public void onTrigger(enums.MediaController pCommands){
|
||||
if(mMediaSession!=null){
|
||||
if(pCommands.equals(enums.MediaController.PLAY)){
|
||||
mMediaDelegate.showNotification(this.mContext.get(), mMediaTitle, helperMethod.getHost(mGeckoDataModel.mCurrentURL), mMediaImage, true);
|
||||
mMediaSession.play();
|
||||
}
|
||||
else if(pCommands.equals(enums.MediaController.PAUSE)){
|
||||
mMediaDelegate.showNotification(this.mContext.get(), mMediaTitle, helperMethod.getHost(mGeckoDataModel.mCurrentURL), mMediaImage, false);
|
||||
mMediaSession.pause();
|
||||
}
|
||||
else if(pCommands.equals(enums.MediaController.STOP)){
|
||||
mMediaSession.stop();
|
||||
}
|
||||
else if(pCommands.equals(enums.MediaController.DESTROY)){
|
||||
mMediaSession.stop();
|
||||
mMediaDelegate.onHideDefaultNotification();
|
||||
}
|
||||
else if(pCommands.equals(enums.MediaController.SKIP_BACKWARD)){
|
||||
mMediaSession.previousTrack();
|
||||
}
|
||||
else if(pCommands.equals(enums.MediaController.SKIP_FORWARD)){
|
||||
mMediaSession.nextTrack();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager;
|
||||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.delegateModel;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
|
@ -22,7 +22,6 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckedTextView;
|
||||
import android.widget.DatePicker;
|
||||
|
@ -34,14 +33,11 @@ import android.widget.ScrollView;
|
|||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TimePicker;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ShareCompat;
|
||||
|
||||
import com.hiddenservices.onionservices.appManager.activityContextManager;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
@ -49,22 +45,21 @@ import java.util.ArrayList;
|
|||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.mozilla.geckoview.AllowOrDeny;
|
||||
import org.mozilla.geckoview.GeckoResult;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
import org.mozilla.geckoview.SlowScriptResponse;
|
||||
|
||||
final class geckoPromptView implements GeckoSession.PromptDelegate {
|
||||
protected static final String LOGTAG = "BasicGeckoViewPrompt";
|
||||
public final class promptDelegate implements GeckoSession.PromptDelegate {
|
||||
|
||||
private final AppCompatActivity mActivity;
|
||||
public int filePickerRequestCode = 1;
|
||||
private int mFileType;
|
||||
private GeckoResult<PromptResponse> mFileResponse;
|
||||
private FilePrompt mFilePrompt;
|
||||
|
||||
public geckoPromptView(final AppCompatActivity activity) {
|
||||
static final String LOGTAG = "BasicGeckoViewPrompt";
|
||||
public int filePickerRequestCode = 1;
|
||||
|
||||
public promptDelegate(final AppCompatActivity activity) {
|
||||
mActivity = activity;
|
||||
}
|
||||
|
||||
|
@ -75,8 +70,8 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
}
|
||||
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onAlertPrompt(final GeckoSession session,
|
||||
final AlertPrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onAlertPrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final AlertPrompt prompt) {
|
||||
stopMedia();
|
||||
final Activity activity = mActivity;
|
||||
if (activity == null) {
|
||||
|
@ -85,15 +80,15 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
final AlertDialog.Builder builder = new AlertDialog.Builder(activity)
|
||||
.setTitle(prompt.title)
|
||||
.setMessage(prompt.message)
|
||||
.setPositiveButton(android.R.string.ok, /* onClickListener */ null);
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<PromptResponse>();
|
||||
.setPositiveButton(android.R.string.ok, null);
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<>();
|
||||
createStandardDialog(builder, prompt, res).show();
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onButtonPrompt(final GeckoSession session,
|
||||
final ButtonPrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onButtonPrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final ButtonPrompt prompt) {
|
||||
stopMedia();
|
||||
final Activity activity = mActivity;
|
||||
if (activity == null) {
|
||||
|
@ -103,19 +98,16 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
.setTitle(prompt.title)
|
||||
.setMessage(prompt.message);
|
||||
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<PromptResponse>();
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<>();
|
||||
|
||||
final DialogInterface.OnClickListener listener =
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
if (which == DialogInterface.BUTTON_POSITIVE) {
|
||||
res.complete(prompt.confirm(ButtonPrompt.Type.POSITIVE));
|
||||
} else if (which == DialogInterface.BUTTON_NEGATIVE) {
|
||||
res.complete(prompt.confirm(ButtonPrompt.Type.NEGATIVE));
|
||||
} else {
|
||||
res.complete(prompt.dismiss());
|
||||
}
|
||||
(dialog, which) -> {
|
||||
if (which == DialogInterface.BUTTON_POSITIVE) {
|
||||
res.complete(prompt.confirm(ButtonPrompt.Type.POSITIVE));
|
||||
} else if (which == DialogInterface.BUTTON_NEGATIVE) {
|
||||
res.complete(prompt.confirm(ButtonPrompt.Type.NEGATIVE));
|
||||
} else {
|
||||
res.complete(prompt.dismiss());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -146,8 +138,8 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
|
||||
static boolean mPopupOpened = false;
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onSharePrompt(final GeckoSession session,
|
||||
final SharePrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onSharePrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final SharePrompt prompt) {
|
||||
stopMedia();
|
||||
new Thread(){
|
||||
public void run(){
|
||||
|
@ -183,8 +175,8 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onRepostConfirmPrompt(final GeckoSession session,
|
||||
final RepostConfirmPrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onRepostConfirmPrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final RepostConfirmPrompt prompt) {
|
||||
stopMedia();
|
||||
final Activity activity = mActivity;
|
||||
if (activity == null) {
|
||||
|
@ -220,8 +212,8 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onBeforeUnloadPrompt(final GeckoSession session,
|
||||
final BeforeUnloadPrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onBeforeUnloadPrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final BeforeUnloadPrompt prompt) {
|
||||
stopMedia();
|
||||
final Activity activity = mActivity;
|
||||
if (activity == null) {
|
||||
|
@ -281,20 +273,17 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
final GeckoResult<PromptResponse> response) {
|
||||
final AlertDialog dialog = builder.create();
|
||||
stopMedia();
|
||||
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(final DialogInterface dialog) {
|
||||
if (!prompt.isComplete()) {
|
||||
response.complete(prompt.dismiss());
|
||||
}
|
||||
dialog.setOnDismissListener(dialog1 -> {
|
||||
if (!prompt.isComplete()) {
|
||||
response.complete(prompt.dismiss());
|
||||
}
|
||||
});
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onTextPrompt(final GeckoSession session,
|
||||
final TextPrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onTextPrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final TextPrompt prompt) {
|
||||
final Activity activity = mActivity;
|
||||
stopMedia();
|
||||
if (activity == null) {
|
||||
|
@ -306,24 +295,19 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
editText.setText(prompt.defaultValue);
|
||||
container.addView(editText);
|
||||
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<PromptResponse>();
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<>();
|
||||
|
||||
builder.setNegativeButton(android.R.string.cancel, /* listener */ null)
|
||||
.setPositiveButton(android.R.string.ok,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
res.complete(prompt.confirm(editText.getText().toString()));
|
||||
}
|
||||
});
|
||||
(dialog, which) -> res.complete(prompt.confirm(editText.getText().toString())));
|
||||
|
||||
createStandardDialog(builder, prompt, res).show();
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onAuthPrompt(final GeckoSession session,
|
||||
final AuthPrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onAuthPrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final AuthPrompt prompt) {
|
||||
final Activity activity = mActivity;
|
||||
stopMedia();
|
||||
if (activity == null) {
|
||||
|
@ -357,20 +341,17 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
container.addView(secure);
|
||||
}
|
||||
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<PromptResponse>();
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<>();
|
||||
|
||||
builder.setNegativeButton(android.R.string.cancel, /* listener */ null)
|
||||
.setPositiveButton(android.R.string.ok,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
if ((flags & AuthPrompt.AuthOptions.Flags.ONLY_PASSWORD) == 0) {
|
||||
res.complete(prompt.confirm(username.getText().toString(),
|
||||
password.getText().toString()));
|
||||
(dialog, which) -> {
|
||||
if ((flags & AuthPrompt.AuthOptions.Flags.ONLY_PASSWORD) == 0) {
|
||||
res.complete(prompt.confirm(username.getText().toString(),
|
||||
password.getText().toString()));
|
||||
|
||||
} else {
|
||||
res.complete(prompt.confirm(password.getText().toString()));
|
||||
}
|
||||
} else {
|
||||
res.complete(prompt.confirm(password.getText().toString()));
|
||||
}
|
||||
});
|
||||
createStandardDialog(builder, prompt, res).show();
|
||||
|
@ -422,7 +403,7 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
private void onChoicePromptImpl(final GeckoSession session, final String title,
|
||||
private void onChoicePromptImpl(final String title,
|
||||
final String message, final int type,
|
||||
final ChoicePrompt.Choice[] choices, final ChoicePrompt prompt,
|
||||
final GeckoResult<PromptResponse> res) {
|
||||
|
@ -545,51 +526,39 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
final AlertDialog dialog;
|
||||
if (type == ChoicePrompt.Type.SINGLE || type == ChoicePrompt.Type.MENU) {
|
||||
dialog = createStandardDialog(builder, prompt, res);
|
||||
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(final AdapterView<?> parent, final View v,
|
||||
final int position, final long id) {
|
||||
final ModifiableChoice item = adapter.getItem(position);
|
||||
if (type == ChoicePrompt.Type.MENU) {
|
||||
final ChoicePrompt.Choice[] children = item.choice.items;
|
||||
if (children != null) {
|
||||
// Show sub-menu.
|
||||
dialog.setOnDismissListener(null);
|
||||
dialog.dismiss();
|
||||
onChoicePromptImpl(session, item.modifiableLabel, /* msg */ null,
|
||||
type, children, prompt, res);
|
||||
return;
|
||||
}
|
||||
list.setOnItemClickListener((parent, v, position, id) -> {
|
||||
final ModifiableChoice item = adapter.getItem(position);
|
||||
if (type == ChoicePrompt.Type.MENU) {
|
||||
final ChoicePrompt.Choice[] children = item.choice.items;
|
||||
if (children != null) {
|
||||
// Show sub-menu.
|
||||
dialog.setOnDismissListener(null);
|
||||
dialog.dismiss();
|
||||
onChoicePromptImpl(item.modifiableLabel, /* msg */ null,
|
||||
type, children, prompt, res);
|
||||
return;
|
||||
}
|
||||
res.complete(prompt.confirm(item.choice));
|
||||
dialog.dismiss();
|
||||
}
|
||||
res.complete(prompt.confirm(item.choice));
|
||||
dialog.dismiss();
|
||||
});
|
||||
} else if (type == ChoicePrompt.Type.MULTIPLE) {
|
||||
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(final AdapterView<?> parent, final View v,
|
||||
final int position, final long id) {
|
||||
final ModifiableChoice item = adapter.getItem(position);
|
||||
item.modifiableSelected = ((CheckedTextView) v).isChecked();
|
||||
}
|
||||
list.setOnItemClickListener((parent, v, position, id) -> {
|
||||
final ModifiableChoice item = adapter.getItem(position);
|
||||
item.modifiableSelected = ((CheckedTextView) v).isChecked();
|
||||
});
|
||||
builder.setNegativeButton(android.R.string.cancel, /* listener */ null)
|
||||
.setPositiveButton(android.R.string.ok,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog,
|
||||
final int which) {
|
||||
final int len = adapter.getCount();
|
||||
ArrayList<String> items = new ArrayList<>(len);
|
||||
for (int i = 0; i < len; i++) {
|
||||
final ModifiableChoice item = adapter.getItem(i);
|
||||
if (item.modifiableSelected) {
|
||||
items.add(item.choice.id);
|
||||
}
|
||||
(dialog1, which) -> {
|
||||
final int len = adapter.getCount();
|
||||
ArrayList<String> items = new ArrayList<>(len);
|
||||
for (int i = 0; i < len; i++) {
|
||||
final ModifiableChoice item = adapter.getItem(i);
|
||||
if (item.modifiableSelected) {
|
||||
items.add(item.choice.id);
|
||||
}
|
||||
res.complete(prompt.confirm(items.toArray(new String[items.size()])));
|
||||
}
|
||||
res.complete(prompt.confirm(items.toArray(new String[0])));
|
||||
});
|
||||
dialog = createStandardDialog(builder, prompt, res);
|
||||
} else {
|
||||
|
@ -604,11 +573,11 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
}
|
||||
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onChoicePrompt(final GeckoSession session,
|
||||
final ChoicePrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onChoicePrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final ChoicePrompt prompt) {
|
||||
stopMedia();
|
||||
final GeckoResult<PromptResponse> res = new GeckoResult<PromptResponse>();
|
||||
onChoicePromptImpl(session, prompt.title, prompt.message, prompt.type, prompt.choices,
|
||||
final GeckoResult<PromptResponse> res = new GeckoResult<>();
|
||||
onChoicePromptImpl(prompt.title, prompt.message, prompt.type, prompt.choices,
|
||||
prompt, res);
|
||||
return res;
|
||||
}
|
||||
|
@ -622,8 +591,8 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
}
|
||||
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onColorPrompt(final GeckoSession session,
|
||||
final ColorPrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onColorPrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final ColorPrompt prompt) {
|
||||
stopMedia();
|
||||
final Activity activity = mActivity;
|
||||
if (activity == null) {
|
||||
|
@ -683,16 +652,12 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
list.setAdapter(adapter);
|
||||
builder.setView(list);
|
||||
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<PromptResponse>();
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<>();
|
||||
|
||||
final AlertDialog dialog = createStandardDialog(builder, prompt, res);
|
||||
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(final AdapterView<?> parent, final View v,
|
||||
final int position, final long id) {
|
||||
res.complete(prompt.confirm(String.format("#%06x", 0xffffff & adapter.getItem(position))));
|
||||
dialog.dismiss();
|
||||
}
|
||||
list.setOnItemClickListener((parent, v, position, id) -> {
|
||||
res.complete(prompt.confirm(String.format("#%06x", 0xffffff & adapter.getItem(position))));
|
||||
dialog.dismiss();
|
||||
});
|
||||
dialog.show();
|
||||
|
||||
|
@ -734,8 +699,8 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
}
|
||||
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onDateTimePrompt(final GeckoSession session,
|
||||
final DateTimePrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onDateTimePrompt(@NonNull final GeckoSession session,
|
||||
@NonNull final DateTimePrompt prompt) {
|
||||
stopMedia();
|
||||
final Activity activity = mActivity;
|
||||
if (activity == null) {
|
||||
|
@ -768,7 +733,7 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
final DatePicker datePicker;
|
||||
if (prompt.type == DateTimePrompt.Type.DATE || prompt.type == DateTimePrompt.Type.MONTH ||
|
||||
prompt.type == DateTimePrompt.Type.WEEK || prompt.type == DateTimePrompt.Type.DATETIME_LOCAL) {
|
||||
final int resId = builder.getContext().getResources().getIdentifier(
|
||||
@SuppressLint("DiscouragedApi") final int resId = builder.getContext().getResources().getIdentifier(
|
||||
"date_picker_dialog", "layout", "android");
|
||||
DatePicker picker = null;
|
||||
if (resId != 0) {
|
||||
|
@ -795,7 +760,7 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
|
||||
final TimePicker timePicker;
|
||||
if (prompt.type == DateTimePrompt.Type.TIME || prompt.type == DateTimePrompt.Type.DATETIME_LOCAL) {
|
||||
final int resId = builder.getContext().getResources().getIdentifier(
|
||||
@SuppressLint("DiscouragedApi") final int resId = builder.getContext().getResources().getIdentifier(
|
||||
"time_picker_dialog", "layout", "android");
|
||||
TimePicker picker = null;
|
||||
if (resId != 0) {
|
||||
|
@ -823,26 +788,23 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
container.addView(timePicker);
|
||||
}
|
||||
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<PromptResponse>();
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<>();
|
||||
|
||||
final DialogInterface.OnClickListener listener =
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
if (which == DialogInterface.BUTTON_NEUTRAL) {
|
||||
// Clear
|
||||
res.complete(prompt.confirm(""));
|
||||
return;
|
||||
}
|
||||
if (datePicker != null) {
|
||||
cal.set(datePicker.getYear(), datePicker.getMonth(),
|
||||
datePicker.getDayOfMonth());
|
||||
}
|
||||
if (timePicker != null) {
|
||||
setCalendarTime(cal, timePicker);
|
||||
}
|
||||
res.complete(prompt.confirm(formatter.format(cal.getTime())));
|
||||
(dialog, which) -> {
|
||||
if (which == DialogInterface.BUTTON_NEUTRAL) {
|
||||
// Clear
|
||||
res.complete(prompt.confirm(""));
|
||||
return;
|
||||
}
|
||||
if (datePicker != null) {
|
||||
cal.set(datePicker.getYear(), datePicker.getMonth(),
|
||||
datePicker.getDayOfMonth());
|
||||
}
|
||||
if (timePicker != null) {
|
||||
setCalendarTime(cal, timePicker);
|
||||
}
|
||||
res.complete(prompt.confirm(formatter.format(cal.getTime())));
|
||||
};
|
||||
builder.setNegativeButton(android.R.string.cancel, /* listener */ null)
|
||||
.setNeutralButton("Clear", listener)
|
||||
|
@ -853,8 +815,7 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
}
|
||||
|
||||
@Override
|
||||
@TargetApi(19)
|
||||
public GeckoResult<PromptResponse> onFilePrompt(GeckoSession session, FilePrompt prompt) {
|
||||
public GeckoResult<PromptResponse> onFilePrompt(@NonNull GeckoSession session, @NonNull FilePrompt prompt) {
|
||||
stopMedia();
|
||||
final Activity activity = mActivity;
|
||||
if (activity == null) {
|
||||
|
@ -892,14 +853,14 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
(mimeSubtype != null ? mimeSubtype : "*"));
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
|
||||
if (Build.VERSION.SDK_INT >= 18 && prompt.type == FilePrompt.Type.MULTIPLE) {
|
||||
if (prompt.type == FilePrompt.Type.MULTIPLE) {
|
||||
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 19 && prompt.mimeTypes.length > 0) {
|
||||
if (prompt.mimeTypes.length > 0) {
|
||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, prompt.mimeTypes);
|
||||
}
|
||||
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<PromptResponse>();
|
||||
GeckoResult<PromptResponse> res = new GeckoResult<>();
|
||||
|
||||
try {
|
||||
mFileResponse = res;
|
||||
|
@ -947,11 +908,11 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
for (int i = 0; i < count; i++) {
|
||||
uris.add(clip.getItemAt(i).getUri());
|
||||
}
|
||||
res.complete(prompt.confirm(mActivity, uris.toArray(new Uri[uris.size()])));
|
||||
res.complete(prompt.confirm(mActivity, uris.toArray(new Uri[0])));
|
||||
}
|
||||
}
|
||||
|
||||
public void onPermissionPrompt(final GeckoSession session, final String title,
|
||||
public void onPermissionPrompt(final String title,
|
||||
final GeckoSession.PermissionDelegate.Callback callback) {
|
||||
stopMedia();
|
||||
final Activity activity = mActivity;
|
||||
|
@ -961,24 +922,14 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
}
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle(title)
|
||||
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
callback.reject();
|
||||
}
|
||||
})
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
callback.grant();
|
||||
}
|
||||
});
|
||||
.setNegativeButton(android.R.string.cancel, (dialog, which) -> callback.reject())
|
||||
.setPositiveButton(android.R.string.ok, (dialog, which) -> callback.grant());
|
||||
|
||||
final AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public void onSlowScriptPrompt(GeckoSession geckoSession, String title, GeckoResult<SlowScriptResponse> reportAction) {
|
||||
public void onSlowScriptPrompt(String title, GeckoResult<SlowScriptResponse> reportAction) {
|
||||
stopMedia();
|
||||
final Activity activity = mActivity;
|
||||
if (activity == null) {
|
||||
|
@ -986,18 +937,8 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
}
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle(title)
|
||||
.setNegativeButton("Wait", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
reportAction.complete(SlowScriptResponse.CONTINUE);
|
||||
}
|
||||
})
|
||||
.setPositiveButton("Stop", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
reportAction.complete(SlowScriptResponse.STOP);
|
||||
}
|
||||
});
|
||||
.setNegativeButton("Wait", (dialog, which) -> reportAction.complete(SlowScriptResponse.CONTINUE))
|
||||
.setPositiveButton("Stop", (dialog, which) -> reportAction.complete(SlowScriptResponse.STOP));
|
||||
|
||||
final AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
|
@ -1009,7 +950,6 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
context, android.R.layout.simple_spinner_item) {
|
||||
private View convertView(final int position, final View view) {
|
||||
if (view != null) {
|
||||
final GeckoSession.PermissionDelegate.MediaSource item = getItem(position);
|
||||
((TextView) view).setText(sourceNames != null ? sourceNames[position] : "media");
|
||||
}
|
||||
return view;
|
||||
|
@ -1023,7 +963,7 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
|
||||
@Override
|
||||
public View getDropDownView(final int position, final View view,
|
||||
final ViewGroup parent) {
|
||||
@NonNull final ViewGroup parent) {
|
||||
return convertView(position, super.getDropDownView(position, view, parent));
|
||||
}
|
||||
};
|
||||
|
@ -1037,7 +977,7 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
return spinner;
|
||||
}
|
||||
|
||||
public void onMediaPrompt(final GeckoSession session, final String title,
|
||||
public void onMediaPrompt(final String title,
|
||||
final GeckoSession.PermissionDelegate.MediaSource[] video, final GeckoSession.PermissionDelegate.MediaSource[] audio,
|
||||
final String[] videoNames, final String[] audioNames,
|
||||
final GeckoSession.PermissionDelegate.MediaCallback callback) {
|
||||
|
@ -1048,7 +988,7 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
return;
|
||||
}
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
final LinearLayout container = addStandardLayout(builder, title, /* msg */ null);
|
||||
final LinearLayout container = addStandardLayout(builder, title, null);
|
||||
|
||||
final Spinner videoSpinner;
|
||||
if (video != null) {
|
||||
|
@ -1064,38 +1004,30 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
|
|||
audioSpinner = null;
|
||||
}
|
||||
|
||||
builder.setNegativeButton(android.R.string.cancel, /* listener */ null)
|
||||
builder.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
final GeckoSession.PermissionDelegate.MediaSource video = (videoSpinner != null)
|
||||
? (GeckoSession.PermissionDelegate.MediaSource) videoSpinner.getSelectedItem() : null;
|
||||
final GeckoSession.PermissionDelegate.MediaSource audio = (audioSpinner != null)
|
||||
? (GeckoSession.PermissionDelegate.MediaSource) audioSpinner.getSelectedItem() : null;
|
||||
callback.grant(video, audio);
|
||||
}
|
||||
(dialog, which) -> {
|
||||
final GeckoSession.PermissionDelegate.MediaSource video1 = (videoSpinner != null)
|
||||
? (GeckoSession.PermissionDelegate.MediaSource) videoSpinner.getSelectedItem() : null;
|
||||
final GeckoSession.PermissionDelegate.MediaSource audio1 = (audioSpinner != null)
|
||||
? (GeckoSession.PermissionDelegate.MediaSource) audioSpinner.getSelectedItem() : null;
|
||||
callback.grant(video1, audio1);
|
||||
});
|
||||
|
||||
final AlertDialog dialog = builder.create();
|
||||
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(final DialogInterface dialog) {
|
||||
callback.reject();
|
||||
}
|
||||
});
|
||||
dialog.setOnDismissListener(dialog1 -> callback.reject());
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public void onMediaPrompt(final GeckoSession session, final String title,
|
||||
public void onMediaPrompt(final String title,
|
||||
final GeckoSession.PermissionDelegate.MediaSource[] video, final GeckoSession.PermissionDelegate.MediaSource[] audio,
|
||||
final GeckoSession.PermissionDelegate.MediaCallback callback) {
|
||||
stopMedia();
|
||||
onMediaPrompt(session, title, video, audio, null, null, callback);
|
||||
onMediaPrompt(title, video, audio, null, null, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeckoResult<PromptResponse> onPopupPrompt(final GeckoSession session,
|
||||
public GeckoResult<PromptResponse> onPopupPrompt(@NonNull final GeckoSession session,
|
||||
final PopupPrompt prompt) {
|
||||
stopMedia();
|
||||
return GeckoResult.fromValue(prompt.confirm(AllowOrDeny.ALLOW));
|
|
@ -0,0 +1,51 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.delegateModel;
|
||||
|
||||
|
||||
import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.UiThread;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.dataModel.geckoDataModel;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.geckoSession;
|
||||
import com.hiddenservices.onionservices.constants.enums;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class scrollDelegate implements GeckoSession.ScrollDelegate {
|
||||
|
||||
/*Private Variables*/
|
||||
|
||||
private eventObserver.eventListener mEvent;
|
||||
private geckoDataModel mGeckoDataModel;
|
||||
|
||||
private int mScollOffset = 0;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
public scrollDelegate(eventObserver.eventListener pEvent, geckoDataModel pGeckoDataModel) {
|
||||
this.mEvent = pEvent;
|
||||
this.mGeckoDataModel = pGeckoDataModel;
|
||||
}
|
||||
|
||||
/*Scroll Delegate*/
|
||||
@UiThread
|
||||
public void onScrollChanged(@NonNull GeckoSession session, int scrollX, int scrollY) {
|
||||
Log.i("fucker111 : ", scrollY + "");
|
||||
mScollOffset = scrollY;
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), enums.etype.M_UPDATE_PIXEL_BACKGROUND);
|
||||
if (scrollY <= 3) {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), enums.etype.M_ON_SCROLL_TOP_BOUNDARIES);
|
||||
} else if (scrollY <= helperMethod.pxFromDp(30)) {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), enums.etype.M_ON_SCROLL_BOUNDARIES);
|
||||
} else {
|
||||
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), enums.etype.M_ON_SCROLL_NO_BOUNDARIES);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getScrollOffset() {
|
||||
return mScollOffset;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager;
|
||||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.delegateModel;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
|
@ -12,6 +12,7 @@ import android.os.Build;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
import android.util.Log;
|
||||
|
@ -41,11 +42,11 @@ import org.mozilla.geckoview.GeckoSession;
|
|||
* 4) Override {@link #performAction} to perform a custom action when used.
|
||||
*/
|
||||
@UiThread
|
||||
public class selectionActionDelegate implements ActionMode.Callback,
|
||||
public class selectionDelegate implements ActionMode.Callback,
|
||||
GeckoSession.SelectionActionDelegate {
|
||||
private static final String LOGTAG = "BasicSelectionAction";
|
||||
|
||||
protected static final String ACTION_PROCESS_TEXT = Intent.ACTION_PROCESS_TEXT;
|
||||
protected static final String ACTION_PROCESS_TEXT = "android.intent.action.PROCESS_TEXT";
|
||||
|
||||
private static final String[] FLOATING_TOOLBAR_ACTIONS = new String[]{
|
||||
ACTION_CUT, ACTION_COPY, ACTION_PASTE, ACTION_SELECT_ALL, "SEARCH"
|
||||
|
@ -81,39 +82,39 @@ public class selectionActionDelegate implements ActionMode.Callback,
|
|||
private class Callback2Wrapper extends ActionMode.Callback2 {
|
||||
@Override
|
||||
public boolean onCreateActionMode(final ActionMode actionMode, final Menu menu) {
|
||||
return selectionActionDelegate.this.onCreateActionMode(actionMode, menu);
|
||||
return selectionDelegate.this.onCreateActionMode(actionMode, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPrepareActionMode(final ActionMode actionMode, final Menu menu) {
|
||||
return selectionActionDelegate.this.onPrepareActionMode(actionMode, menu);
|
||||
return selectionDelegate.this.onPrepareActionMode(actionMode, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActionItemClicked(final ActionMode actionMode, final MenuItem menuItem) {
|
||||
return selectionActionDelegate.this.onActionItemClicked(actionMode, menuItem);
|
||||
return selectionDelegate.this.onActionItemClicked(actionMode, menuItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyActionMode(final ActionMode actionMode) {
|
||||
selectionActionDelegate.this.onDestroyActionMode(actionMode);
|
||||
selectionDelegate.this.onDestroyActionMode(actionMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetContentRect(final ActionMode mode, final View view, final Rect outRect) {
|
||||
super.onGetContentRect(mode, view, outRect);
|
||||
selectionActionDelegate.this.onGetContentRect(mode, view, outRect);
|
||||
selectionDelegate.this.onGetContentRect(mode, view, outRect);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("checkstyle:javadocmethod")
|
||||
public selectionActionDelegate(final @NonNull Activity activity) {
|
||||
public selectionDelegate(final @NonNull Activity activity) {
|
||||
this(activity, Build.VERSION.SDK_INT >= 23);
|
||||
}
|
||||
|
||||
@SuppressWarnings("checkstyle:javadocmethod")
|
||||
public selectionActionDelegate(final @NonNull Activity activity,
|
||||
final boolean useFloatingToolbar) {
|
||||
public selectionDelegate(final @NonNull Activity activity,
|
||||
final boolean useFloatingToolbar) {
|
||||
mActivity = activity;
|
||||
mUseFloatingToolbar = useFloatingToolbar;
|
||||
mExternalActionsEnabled = true;
|
||||
|
@ -169,7 +170,9 @@ public class selectionActionDelegate implements ActionMode.Callback,
|
|||
if (mExternalActionsEnabled && !mSelection.text.isEmpty() &&
|
||||
ACTION_PROCESS_TEXT.equals(id)) {
|
||||
final PackageManager pm = mActivity.getPackageManager();
|
||||
return pm.resolveActivity(getProcessTextIntent(), PackageManager.MATCH_DEFAULT_ONLY) != null;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
return pm.resolveActivity(getProcessTextIntent(), PackageManager.MATCH_DEFAULT_ONLY) != null;
|
||||
}
|
||||
}
|
||||
if (id.equals("SEARCH") && !mSelection.text.isEmpty() && mExternalActionsEnabled) {
|
||||
return true;
|
||||
|
@ -296,12 +299,12 @@ public class selectionActionDelegate implements ActionMode.Callback,
|
|||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
private Intent getProcessTextIntent() {
|
||||
final Intent intent = new Intent(Intent.ACTION_PROCESS_TEXT);
|
||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
intent.setType("text/plain");
|
||||
intent.putExtra(Intent.EXTRA_PROCESS_TEXT, mSelection.text);
|
||||
// TODO: implement ability to replace text in Gecko for editable selection (bug 1453137).
|
||||
intent.putExtra(Intent.EXTRA_PROCESS_TEXT_READONLY, true);
|
||||
return intent;
|
||||
}
|
||||
|
@ -340,10 +343,12 @@ public class selectionActionDelegate implements ActionMode.Callback,
|
|||
|
||||
if (ACTION_PROCESS_TEXT.equals(actionId)) {
|
||||
if (mExternalActionsEnabled && !mSelection.text.isEmpty()) {
|
||||
menu.addIntentOptions(menuId, menuId, menuId,
|
||||
mActivity.getComponentName(),
|
||||
/* specifiec */ null, getProcessTextIntent(),
|
||||
/* flags */ 0, /* items */ null);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
menu.addIntentOptions(menuId, menuId, menuId,
|
||||
mActivity.getComponentName(),
|
||||
/* specifiec */ null, getProcessTextIntent(),
|
||||
/* flags */ 0, /* items */ null);
|
||||
}
|
||||
changed = true;
|
||||
} else if (menu.findItem(menuId) != null) {
|
||||
menu.removeGroup(menuId);
|
||||
|
@ -419,7 +424,7 @@ public class selectionActionDelegate implements ActionMode.Callback,
|
|||
|
||||
@TargetApi(Build.VERSION_CODES.M)
|
||||
@Override
|
||||
public void onShowActionRequest(final GeckoSession session, final Selection selection) {
|
||||
public void onShowActionRequest(@NonNull final GeckoSession session, @NonNull final Selection selection) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
mSession = session;
|
||||
mSelection = selection;
|
||||
|
@ -449,7 +454,7 @@ public class selectionActionDelegate implements ActionMode.Callback,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onHideAction(final GeckoSession session, final int reason) {
|
||||
public void onHideAction(@NonNull final GeckoSession session, final int reason) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
if (mActionMode == null) {
|
||||
return;
|
|
@ -7,13 +7,8 @@ import android.net.Uri;
|
|||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.hiddenservices.onionservices.appManager.activityContextManager;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeController;
|
||||
import com.hiddenservices.onionservices.appManager.kotlinHelperLibraries.BrowserIconManager;
|
||||
import com.hiddenservices.onionservices.constants.*;
|
||||
import com.hiddenservices.onionservices.dataManager.dataController;
|
||||
|
@ -25,14 +20,12 @@ import java.io.File;
|
|||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_URL_CACHED;
|
||||
import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_URL_CACHED_DARK;
|
||||
import static com.hiddenservices.onionservices.constants.constants.CONST_PRIVACY_POLICY_URL_NON_TOR;
|
||||
import static com.hiddenservices.onionservices.constants.constants.CONST_REPORT_URL;
|
||||
import static com.hiddenservices.onionservices.constants.enums.etype.M_INDEX_WEBSITE;
|
||||
import static com.hiddenservices.onionservices.constants.enums.etype.on_handle_external_intent;
|
||||
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE;
|
||||
import static org.mozilla.geckoview.StorageController.ClearFlags.AUTH_SESSIONS;
|
||||
|
@ -44,15 +37,10 @@ import static org.mozilla.geckoview.StorageController.ClearFlags.PERMISSIONS;
|
|||
import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_DATA;
|
||||
import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_SETTINGS;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import org.mozilla.gecko.EventDispatcher;
|
||||
import org.mozilla.gecko.util.GeckoBundle;
|
||||
import org.mozilla.geckoview.ContentBlocking;
|
||||
import org.mozilla.geckoview.GeckoResult;
|
||||
import org.mozilla.geckoview.GeckoRuntime;
|
||||
import org.mozilla.geckoview.GeckoRuntimeSettings;
|
||||
import org.mozilla.geckoview.GeckoView;
|
||||
import org.mozilla.geckoview.WebExtension;
|
||||
import org.mozilla.geckoview.WebResponse;
|
||||
import org.torproject.android.service.wrapper.orbotLocalConstants;
|
||||
|
||||
|
@ -211,126 +199,6 @@ public class geckoClients {
|
|||
return cacheFile.getAbsolutePath();
|
||||
}
|
||||
|
||||
/*
|
||||
@SuppressLint("WrongThread")
|
||||
public void installExtension() {
|
||||
|
||||
mRuntime.getWebExtensionController()
|
||||
.ensureBuiltIn("resource://android/assets/parser/", "messaging@example.com")
|
||||
.accept(
|
||||
extension -> {
|
||||
Log.i("MessageDelegate", "Extension installed: " + extension);
|
||||
extension.setMessageDelegate(mMessagingDelegate, "browser");
|
||||
},
|
||||
e -> {
|
||||
Log.e("MessageDelegate", "Error registering WebExtension", e);
|
||||
}
|
||||
);
|
||||
|
||||
mRuntime.getWebExtensionController()
|
||||
.ensureBuiltIn("resource://android/assets/adblock/", "messaging@example.com")
|
||||
.accept(
|
||||
extension -> {
|
||||
Log.i("MessageDelegate", "Extension installed: " + extension);
|
||||
extension.setMessageDelegate(mMessagingDelegate, "browser");
|
||||
},
|
||||
e -> {
|
||||
Log.e("MessageDelegate", "Error registering WebExtension", e);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private final WebExtension.MessageDelegate mMessagingDelegate = new WebExtension.MessageDelegate() {
|
||||
|
||||
@Override
|
||||
public void onConnect(@NonNull WebExtension.Port port) {
|
||||
Log.e("MessageDelegate", "onConnect");
|
||||
mPort = port;
|
||||
mPort.setDelegate(mPortDelegate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeckoResult<Object> onMessage(final @NonNull String nativeApp, final @NonNull Object message, final @NonNull WebExtension.MessageSender sender) {
|
||||
Log.e("MessageDelegate", "onConnect");
|
||||
return null;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private final WebExtension.PortDelegate mPortDelegate = new WebExtension.PortDelegate() {
|
||||
@Override
|
||||
public void onPortMessage(final @NonNull Object message, final @NonNull WebExtension.Port port) {
|
||||
if(mSession!=null){
|
||||
if (message != null && mSession.getProgress() == 100 && !mSession.mCloseRequested && mSession.isFirstPaintExecuted && !mSession.mOnBackPressed) {
|
||||
//event.invokeObserver(Arrays.asList(message, mSession.getCurrentURL()), M_INDEX_WEBSITE);
|
||||
}
|
||||
mSession.mOnBackPressed = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisconnect(final @NonNull WebExtension.Port port) {
|
||||
Log.e("MessageDelegate:", "onDisconnect");
|
||||
if (port == mPort) {
|
||||
mPort = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private WebExtension.Port mPort;
|
||||
|
||||
public void onExtentionClicked() {
|
||||
try {
|
||||
if (mPort == null) {
|
||||
return;
|
||||
}
|
||||
long id = System.currentTimeMillis();
|
||||
Log.e("evalJavascript:id:", id + "");
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("action", "evalJavascript");
|
||||
jsonObject.put("data", "evalJavascript");
|
||||
jsonObject.put("id", id);
|
||||
Log.e("evalJavascript:", jsonObject.toString());
|
||||
mPort.postMessage(jsonObject);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
static boolean mCreated = false;*/
|
||||
|
||||
/* package *//* class Pref<T> {
|
||||
public final String name;
|
||||
public final T defaultValue;
|
||||
private T mValue;
|
||||
private boolean mIsSet;
|
||||
|
||||
public Pref(@NonNull final String name, final T defaultValue) {
|
||||
this.name = name;
|
||||
this.defaultValue = defaultValue;
|
||||
mValue = defaultValue;
|
||||
|
||||
}
|
||||
public void add() {
|
||||
final GeckoBundle prefs = new GeckoBundle(1);
|
||||
prefs.putInt(this.name, (Integer)this.defaultValue);
|
||||
EventDispatcher.getInstance().dispatch("GeckoView:SetDefaultPrefs", prefs);
|
||||
addToBundle(prefs);
|
||||
}
|
||||
|
||||
private void addToBundle(final GeckoBundle bundle) {
|
||||
final T value = mIsSet ? mValue : defaultValue;
|
||||
if (value instanceof String) {
|
||||
bundle.putString(name, (String) value);
|
||||
} else if (value instanceof Integer) {
|
||||
bundle.putInt(name, (Integer) value);
|
||||
} else if (value instanceof Boolean) {
|
||||
bundle.putBoolean(name, (Boolean) value);
|
||||
} else {
|
||||
throw new UnsupportedOperationException("Unhandled pref type for " + name);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
@SuppressLint("WrongConstant")
|
||||
public void initRuntimeSettings(AppCompatActivity context) {
|
||||
|
@ -375,7 +243,7 @@ public class geckoClients {
|
|||
|
||||
|
||||
public void onGetFavIcon(ImageView pImageView, String pURL, AppCompatActivity pcontext) {
|
||||
if(status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY){
|
||||
if(status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY && status.sLowMemory != enums.MemoryStatus.LOW_MEMORY){
|
||||
initBrowserManager(pcontext);
|
||||
pURL = helperMethod.completeURL(helperMethod.getDomainName(pURL));
|
||||
Log.i("FUCKSSS1111","111");
|
||||
|
@ -407,22 +275,22 @@ public class geckoClients {
|
|||
}
|
||||
|
||||
public void onKillMedia(){
|
||||
mSession.onKillMedia();
|
||||
mSession.getMediaSessionDelegate().onTrigger(enums.MediaController.DESTROY);
|
||||
}
|
||||
|
||||
public void onPlayMedia(){
|
||||
mSession.onPlayMedia();
|
||||
mSession.getMediaSessionDelegate().onTrigger(enums.MediaController.PLAY);
|
||||
}
|
||||
|
||||
public void onPauseMedia(){
|
||||
mSession.onPauseMedia();
|
||||
mSession.getMediaSessionDelegate().onTrigger(enums.MediaController.PAUSE);
|
||||
}
|
||||
|
||||
public void onSkipForwardMedia(){
|
||||
mSession.onSkipForwardMedia();
|
||||
mSession.getMediaSessionDelegate().onTrigger(enums.MediaController.SKIP_FORWARD);
|
||||
}
|
||||
public void onSkipBackwardMedia(){
|
||||
mSession.onSkipBackwardMedia();
|
||||
mSession.getMediaSessionDelegate().onTrigger(enums.MediaController.SKIP_BACKWARD);
|
||||
}
|
||||
|
||||
|
||||
|
@ -446,7 +314,7 @@ public class geckoClients {
|
|||
}
|
||||
|
||||
public void onStopMedia() {
|
||||
mSession.onStopMedia();
|
||||
mSession.getMediaSessionDelegate().onTrigger(enums.MediaController.STOP);
|
||||
}
|
||||
|
||||
public void onUploadRequest(int resultCode, Intent data) {
|
||||
|
@ -521,7 +389,7 @@ public class geckoClients {
|
|||
}
|
||||
|
||||
public void onRedrawPixel(AppCompatActivity pcontext) {
|
||||
if(status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY){
|
||||
if(status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY && status.sLowMemory != enums.MemoryStatus.LOW_MEMORY){
|
||||
mSession.onRedrawPixel();
|
||||
onLoadFavIcon(pcontext);
|
||||
}
|
||||
|
@ -605,7 +473,7 @@ public class geckoClients {
|
|||
}
|
||||
|
||||
public boolean getFullScreenStatus() {
|
||||
return mSession.getFullScreenStatus();
|
||||
return mSession.getContentDelegate().getFullScreenStatus();
|
||||
}
|
||||
|
||||
public void onExitFullScreen() {
|
||||
|
@ -740,18 +608,25 @@ public class geckoClients {
|
|||
}
|
||||
|
||||
public int getScrollOffset() {
|
||||
return mSession.getScrollOffset();
|
||||
return mSession.getmScrollDelegate().getScrollOffset();
|
||||
}
|
||||
|
||||
public class geckoViewClientCallback implements eventObserver.eventListener {
|
||||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object e_type) {
|
||||
if (e_type.equals(enums.etype.ON_FULL_SCREEN)) {
|
||||
mSession.onFullScreenInvoke((boolean)data.get(0));
|
||||
}
|
||||
if (e_type.equals(enums.etype.ON_DESTROY_MEDIA)) {
|
||||
mSession.getMediaSessionDelegate().onTrigger(enums.MediaController.DESTROY);
|
||||
}
|
||||
if (e_type.equals(enums.etype.M_CHANGE_HOME_THEME)) {
|
||||
reinitHomeTheme();
|
||||
} else if (mSession != null) {
|
||||
}
|
||||
else if (mSession != null) {
|
||||
if (e_type.equals(enums.etype.SESSION_ID)) {
|
||||
return mSession.getSessionID();
|
||||
} else if (mSessionID != null && mSessionID.equals(data.get(1)) || e_type.equals(enums.etype.ON_INVOKE_PARSER) || 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.ON_INVOKE_PARSER) || 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;
|
||||
}
|
||||
|
|
|
@ -20,15 +20,15 @@ import java.util.Arrays;
|
|||
|
||||
import mozilla.components.support.utils.DownloadUtils;
|
||||
|
||||
class geckoDownloadManager {
|
||||
public class geckoDownloadManager {
|
||||
private Uri downloadURL;
|
||||
private String downloadFile = strings.GENERIC_EMPTY_STR;
|
||||
|
||||
geckoDownloadManager() {
|
||||
public geckoDownloadManager() {
|
||||
|
||||
}
|
||||
|
||||
void downloadFile(WebResponse response, geckoSession session, AppCompatActivity context, eventObserver.eventListener event) {
|
||||
public void downloadFile(WebResponse response, geckoSession session, AppCompatActivity context, eventObserver.eventListener event) {
|
||||
session.getUserAgent().accept(userAgent -> downloadFile(response, userAgent, context, session, event),
|
||||
exception -> {
|
||||
throw new IllegalStateException("Could not get UserAgent string.");
|
||||
|
@ -62,11 +62,11 @@ class geckoDownloadManager {
|
|||
event.invokeObserver(Arrays.asList(downloadFile, session.getSessionID(), downloadURL), enums.etype.download_file_popup);
|
||||
}
|
||||
|
||||
Uri getDownloadURL() {
|
||||
public Uri getDownloadURL() {
|
||||
return downloadURL;
|
||||
}
|
||||
|
||||
String getDownloadFile() {
|
||||
public String getDownloadFile() {
|
||||
return downloadFile;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,11 +1,11 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager;
|
||||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.helperClasses;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import org.mozilla.geckoview.WebRequestError;
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.helperClasses;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class intentHandler {
|
||||
|
||||
public static void actionDial(String pIntentHander, WeakReference<AppCompatActivity> mContext) {
|
||||
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(pIntentHander));
|
||||
mContext.get().startActivity(intent);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.helperClasses;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import org.mozilla.gecko.EventDispatcher;
|
||||
import org.mozilla.gecko.util.GeckoBundle;
|
||||
|
||||
public class preferences<T> {
|
||||
public final String name;
|
||||
public final T defaultValue;
|
||||
private T mValue;
|
||||
|
||||
public preferences(@NonNull final String name, final T defaultValue) {
|
||||
this.name = name;
|
||||
this.defaultValue = defaultValue;
|
||||
mValue = defaultValue;
|
||||
|
||||
}
|
||||
public void add() {
|
||||
final GeckoBundle prefs = new GeckoBundle(1);
|
||||
prefs.putInt(this.name, (Integer)this.defaultValue);
|
||||
EventDispatcher.getInstance().dispatch("GeckoView:SetDefaultPrefs", prefs);
|
||||
addToBundle(prefs);
|
||||
}
|
||||
|
||||
private void addToBundle(final GeckoBundle bundle) {
|
||||
final T value = mValue;
|
||||
if (value instanceof String) {
|
||||
bundle.putString(name, (String) value);
|
||||
} else if (value instanceof Integer) {
|
||||
bundle.putInt(name, (Integer) value);
|
||||
} else if (value instanceof Boolean) {
|
||||
bundle.putBoolean(name, (Boolean) value);
|
||||
} else {
|
||||
throw new UnsupportedOperationException("Unhandled pref type for " + name);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ import com.hiddenservices.onionservices.constants.enums;
|
|||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -210,7 +210,7 @@ public class hintAdapter extends RecyclerView.Adapter<hintAdapter.listViewHolder
|
|||
mHindTypeIconTemp.setImageDrawable(null);
|
||||
mEvent.invokeObserver(Arrays.asList(mHindTypeIconTemp, "https://" + helperMethod.getDomainName(model.getDescription())), enums.etype.fetch_favicon);
|
||||
|
||||
if(status.sLowMemory == enums.MemoryStatus.STABLE){
|
||||
if(status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY && status.sLowMemory != enums.MemoryStatus.LOW_MEMORY){
|
||||
if (mHindTypeIconTemp.getDrawable() != null) {
|
||||
pHintWebIconImage.setImageTintList(null);
|
||||
pHintWebIconImage.setImageDrawable(mHindTypeIconTemp.getDrawable());
|
||||
|
|
|
@ -89,7 +89,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginReciever.defaultNotificationReciever;
|
||||
import com.widget.onionservices.widgetManager.widgetController;
|
||||
import org.mozilla.geckoview.ContentBlocking;
|
||||
|
@ -164,6 +164,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
private View mBannerAds = null;
|
||||
private ImageButton mGatewaySplash;
|
||||
private ImageButton mPanicButton;
|
||||
private ImageButton mSupportButton;
|
||||
private ImageButton mPanicButtonLandscape;
|
||||
private LinearLayout mTopBar;
|
||||
private ImageView mBackSplash;
|
||||
|
@ -243,7 +244,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.home_view);
|
||||
|
||||
onMemoryCalculate();
|
||||
initPreFixes();
|
||||
activityContextManager.getInstance().setHomeController(this);
|
||||
pluginController.getInstance().initializeAllServices(this);
|
||||
|
@ -262,6 +262,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
initPreFixes();
|
||||
initBundle();
|
||||
initTor();
|
||||
onMemoryCalculate();
|
||||
pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_INIT_ADS);
|
||||
mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
|
||||
}
|
||||
|
||||
|
@ -583,6 +585,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mCoordinatorLayout = findViewById(R.id.pCoordinatorLayout);
|
||||
mImageDivider = findViewById(R.id.pImageDivider);
|
||||
mPanicButton = findViewById(R.id.pPanicButton);
|
||||
mSupportButton = findViewById(R.id.pSupportButton);
|
||||
mPanicButtonLandscape = findViewById(R.id.pPanicButtonLandscape);
|
||||
mGenesisLogo = findViewById(R.id.pGenesisLogo);
|
||||
mPopoupFindCopy = findViewById(R.id.pPopoupFindCopy);
|
||||
|
@ -594,7 +597,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mGeckoView.setAutofillEnabled(true);
|
||||
|
||||
mGeckoClient = new geckoClients();
|
||||
mHomeViewController.initialization(new homeViewCallback(), this, mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds, mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mConnectNoTorButton, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager, mInfoLandscape, mInfoPortrait, mProgressBarIndeterminate, mTabFragment, mTopBarContainer, mSearchLock, mTopBarHider, mNewTabBlocker, mCoordinatorLayout, mImageDivider, mPanicButton, mGenesisLogo, mPanicButtonLandscape, mTorDisabled);
|
||||
mHomeViewController.initialization(new homeViewCallback(), this, mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds, mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mConnectNoTorButton, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager, mInfoLandscape, mInfoPortrait, mProgressBarIndeterminate, mTabFragment, mTopBarContainer, mSearchLock, mTopBarHider, mNewTabBlocker, mCoordinatorLayout, mImageDivider, mPanicButton, mGenesisLogo, mPanicButtonLandscape, mTorDisabled, mSupportButton);
|
||||
mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback());
|
||||
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this, false);
|
||||
mGeckoClient.onValidateInitializeFromStartup(mGeckoView, homeController.this);
|
||||
|
@ -772,8 +775,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
mGeckoClient.loadURL(url.replace("orion.onion", "167.86.99.31"), mGeckoView, homeController.this);
|
||||
|
||||
if(!mHomeViewController.isOrientationLandscapce()){
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
if(!mHomeViewController.isOrientationLandscapce() && status.sSettingIsAppRunning){
|
||||
new Handler().postDelayed(() ->
|
||||
{
|
||||
if(status.sSettingIsAppStarted) {
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -783,7 +791,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
|
||||
public void onLoadTab(geckoSession mTempSession, boolean isSessionClosed, boolean pExpandAppBar, boolean pForced, boolean pGeneratePixel) {
|
||||
|
||||
mGeckoClient.getSession().onKillMedia();
|
||||
mGeckoClient.getSession().getMediaSessionDelegate().onTrigger(enums.MediaController.DESTROY);
|
||||
if (!isSessionClosed) {
|
||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.MOVE_TAB_TO_TOP, Collections.singletonList(mTempSession));
|
||||
}
|
||||
|
@ -1103,7 +1111,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
NotificationManagerCompat.from(this).cancel(1025);
|
||||
if(mGeckoClient.getSession() !=null){
|
||||
mGeckoClient.getSession().onDestroyMedia();
|
||||
mGeckoClient.getSession().getMediaSessionDelegate().onTrigger(enums.MediaController.DESTROY);
|
||||
onHideDefaultNotification();
|
||||
}
|
||||
if (!status.sSettingIsAppStarted) {
|
||||
|
@ -1563,7 +1571,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
geckoSession mNewSession = mGeckoClient.initializeBackground(mGeckoView, new geckoViewCallback(), this, true);
|
||||
onSaveCurrentTab(mNewSession, false);
|
||||
|
||||
mNewSession.setURL(url);
|
||||
mNewSession.getHistoryDelegate().setURL(url);
|
||||
mHomeViewController.progressBarReset();
|
||||
initTabCountForced();
|
||||
mNewSession.loadUri(url);
|
||||
|
@ -1574,7 +1582,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
}
|
||||
|
||||
public void onNewTab(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened) {
|
||||
mGeckoClient.getSession().onKillMedia();
|
||||
mGeckoClient.getSession().getMediaSessionDelegate().onTrigger(enums.MediaController.DESTROY);
|
||||
try {
|
||||
if(status.sLowMemory != enums.MemoryStatus.STABLE){
|
||||
mRenderedBitmap = mGeckoView.capturePixels();
|
||||
|
@ -1735,7 +1743,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onClearAdapter();
|
||||
} else if (!mGeckoClient.getFullScreenStatus()) {
|
||||
mGeckoClient.onExitFullScreen();
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
if(status.sSettingIsAppStarted){
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
}
|
||||
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
|
||||
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
|
||||
} else if (mSearchbar.isFocused() || isKeyboardOpened) {
|
||||
|
@ -1789,7 +1799,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mHomeViewController.removeBanner();
|
||||
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||
if(mGeckoClient.getFullScreenStatus()){
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
if(status.sSettingIsAppStarted){
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
}
|
||||
}else {
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
|
||||
}
|
||||
|
@ -1837,7 +1849,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
if(!mGeckoClient.getFullScreenStatus()){
|
||||
mGeckoClient.onExitFullScreen();
|
||||
}
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
if(status.sSettingIsAppStarted){
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
}
|
||||
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
|
||||
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||
pluginController.getInstance().onNotificationInvoke(Collections.singletonList(172800000), pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION);
|
||||
|
@ -1852,7 +1866,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, true);
|
||||
|
||||
if (mGeckoClient.getSession() != null && mGeckoClient != null) {
|
||||
mGeckoClient.onStopMedia();
|
||||
mGeckoClient.onPauseMedia();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2710,7 +2724,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
if((boolean)data.get(0)){
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
|
||||
}else {
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
if(status.sSettingIsAppStarted){
|
||||
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
|
||||
}
|
||||
}
|
||||
} else if (e_type.equals(enums.etype.M_ON_BANNER_UPDATE)) {
|
||||
Object mStatus = pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED);
|
||||
|
@ -2986,7 +3002,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
|
||||
} else if (e_type.equals(enums.etype.start_proxy)) {
|
||||
pluginController.getInstance().onOrbotInvoke(data, pluginEnums.eOrbotManager.M_SET_PROXY);
|
||||
} else if (e_type.equals(enums.etype.on_update_history)) {
|
||||
} else if (e_type.equals(enums.etype.ON_UPDATE_HISTORY)) {
|
||||
return dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_ADD_HISTORY, data);
|
||||
} else if (e_type.equals(enums.etype.on_page_loaded)) {
|
||||
onInvokePixelGenerator();
|
||||
|
@ -3014,10 +3030,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mData.addAll(data);
|
||||
mData.add(homeController.this);
|
||||
pluginController.getInstance().onMessageManagerInvoke(mData, M_DOWNLOAD_SINGLE);
|
||||
} else if (e_type.equals(enums.etype.on_full_screen)) {
|
||||
} else if (e_type.equals(enums.etype.ON_FULL_SCREEN)) {
|
||||
boolean status = (Boolean) data.get(0);
|
||||
if(!status){
|
||||
mGeckoClient.onStopMedia();
|
||||
mGeckoClient.onPauseMedia();
|
||||
}
|
||||
mHomeViewController.onFullScreenUpdate(status);
|
||||
mHomeViewController.onUpdateSearchEngineBar(false, 0);
|
||||
|
|
|
@ -51,7 +51,7 @@ import com.hiddenservices.onionservices.dataManager.dataEnums;
|
|||
import com.hiddenservices.onionservices.libs.views.ColorAnimator;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
|
||||
import org.mozilla.geckoview.GeckoView;
|
||||
|
@ -115,6 +115,7 @@ class homeViewController {
|
|||
private CoordinatorLayout mCoordinatorLayout;
|
||||
private ImageView mImageDivider;
|
||||
private ImageButton mPanicButton;
|
||||
private ImageButton mSupportButton;
|
||||
private ImageButton mPanicButtonLandscape;
|
||||
private ImageView mGenesisLogo;
|
||||
private ImageView mTorDisabled;
|
||||
|
@ -127,7 +128,7 @@ class homeViewController {
|
|||
private boolean mIsTopBarExpanded = true;
|
||||
private NestedScrollView.MarginLayoutParams mDefaultMargin = null;
|
||||
|
||||
void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, ProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, View banner_ads, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, Button connect_no_tor_button, View pFindBar, EditText pFindText, TextView pFindCount, androidx.constraintlayout.widget.ConstraintLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, androidx.core.widget.NestedScrollView pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager, ConstraintLayout pInfoLandscape, ConstraintLayout pInfoPortrait, ProgressBar pProgressBarIndeterminate, FragmentContainerView pTabFragment, LinearLayout pTopBarContainer, ImageView pSearchLock, ImageView pTopBarHider, ImageView pNewTabBlocker, CoordinatorLayout mCoordinatorLayout, ImageView pImageDivider, ImageButton pPanicButton, ImageView pGenesisLogo, ImageButton pPanicButtonLandscape, ImageView pTorDisabled) {
|
||||
void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, ProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, View banner_ads, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, Button connect_no_tor_button, View pFindBar, EditText pFindText, TextView pFindCount, androidx.constraintlayout.widget.ConstraintLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, androidx.core.widget.NestedScrollView pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager, ConstraintLayout pInfoLandscape, ConstraintLayout pInfoPortrait, ProgressBar pProgressBarIndeterminate, FragmentContainerView pTabFragment, LinearLayout pTopBarContainer, ImageView pSearchLock, ImageView pTopBarHider, ImageView pNewTabBlocker, CoordinatorLayout mCoordinatorLayout, ImageView pImageDivider, ImageButton pPanicButton, ImageView pGenesisLogo, ImageButton pPanicButtonLandscape, ImageView pTorDisabled, ImageButton pSupportButton) {
|
||||
this.mContext = context;
|
||||
this.mProgressBar = progressBar;
|
||||
this.mSearchbar = searchbar;
|
||||
|
@ -171,6 +172,7 @@ class homeViewController {
|
|||
this.mPanicButtonLandscape = pPanicButtonLandscape;
|
||||
this.mLogHandler = new LogHandler();
|
||||
this.mTorDisabled = pTorDisabled;
|
||||
this.mSupportButton = pSupportButton;
|
||||
|
||||
initSplashScreen();
|
||||
createUpdateUiHandler();
|
||||
|
@ -530,7 +532,7 @@ class homeViewController {
|
|||
|
||||
public void initStatusBarColor(boolean mInstant) {
|
||||
int mDelay = 1500;
|
||||
if (!status.sTorBrowsing || status.mThemeApplying || mInstant || status.sSettingIsAppStarted) {
|
||||
if (status.mThemeApplying || mInstant || status.sSettingIsAppStarted) {
|
||||
mDelay = 0;
|
||||
}
|
||||
|
||||
|
@ -566,7 +568,7 @@ class homeViewController {
|
|||
});
|
||||
animator.start();
|
||||
} else {
|
||||
mSplashScreen.animate().alpha(0).setDuration(200).setStartDelay(mDelay).withEndAction(() -> onPostScreenDisable());
|
||||
mSplashScreen.animate().alpha(0).setDuration(200).setStartDelay(2000).withEndAction(() -> onPostScreenDisable());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -582,6 +584,7 @@ class homeViewController {
|
|||
mConnectButton.setVisibility(View.GONE);
|
||||
mConnectNoTorButton.setVisibility(View.GONE);
|
||||
mPanicButton.setVisibility(View.GONE);
|
||||
mSupportButton.setVisibility(View.GONE);
|
||||
mPanicButtonLandscape.setVisibility(View.GONE);
|
||||
|
||||
mEvent.invokeObserver(null, enums.etype.M_CACHE_UPDATE_TAB);
|
||||
|
@ -1386,24 +1389,12 @@ class homeViewController {
|
|||
mProgressBar.setAlpha(1);
|
||||
mProgressBar.animate().cancel();
|
||||
mProgressBar.animate().alpha(0);
|
||||
value = 100;
|
||||
mProgressBar.animate().alpha(0).withEndAction(() -> mProgressBar.setProgress(0));
|
||||
return;
|
||||
}
|
||||
|
||||
if (value == 100) {
|
||||
changeRefreshMenu();
|
||||
new Handler().postDelayed(() ->
|
||||
{
|
||||
if(mProgressBar.getProgress()==100){
|
||||
progressAnimator.cancel();
|
||||
mProgressBar.setAlpha(1);
|
||||
mProgressBar.animate().cancel();
|
||||
mProgressBar.animate().alpha(0).withEndAction(() -> mProgressBar.setProgress(0));
|
||||
}
|
||||
onResetTabAnimation();
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
|
||||
mProgressBar = activityContextManager.getInstance().getHomeController().mProgressBar;
|
||||
|
|
|
@ -17,7 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -11,7 +11,7 @@ import androidx.appcompat.app.AppCompatDelegate;
|
|||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.hiddenservices.onionservices.appManager.activityContextManager;
|
|||
import com.hiddenservices.onionservices.appManager.tabManager.tabEnums;
|
||||
import com.hiddenservices.onionservices.constants.constants;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import org.torproject.android.service.wrapper.logRowModel;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import org.torproject.android.service.wrapper.logRowModel;
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -14,7 +14,7 @@ import androidx.core.content.ContextCompat;
|
|||
import com.hiddenservices.onionservices.constants.constants;
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -4,7 +4,7 @@ import android.view.View;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import androidx.core.content.ContextCompat;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -16,7 +16,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import org.mozilla.geckoview.ContentBlocking;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import androidx.appcompat.app.AppCompatDelegate;
|
|||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -16,7 +16,7 @@ import com.hiddenservices.onionservices.constants.enums;
|
|||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -11,7 +11,7 @@ import androidx.core.content.ContextCompat;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
class settingNotificationViewController {
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -4,7 +4,7 @@ import android.view.View;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import androidx.core.content.ContextCompat;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -17,7 +17,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -11,7 +11,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -18,7 +18,7 @@ import androidx.core.content.ContextCompat;
|
|||
import com.hiddenservices.onionservices.constants.constants;
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.hiddenservices.onionservices.appManager.activityContextManager;
|
|||
import com.hiddenservices.onionservices.constants.constants;
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.hiddenservices.onionservices.helperManager.helperMethod;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -4,7 +4,7 @@ import android.view.View;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import org.mozilla.geckoview.ContentBlocking;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import androidx.core.content.ContextCompat;
|
|||
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import org.mozilla.geckoview.ContentBlocking;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.hiddenservices.onionservices.constants.status;
|
|||
import com.hiddenservices.onionservices.dataManager.models.tabRowModel;
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -39,7 +39,7 @@ import com.hiddenservices.onionservices.dataManager.models.tabRowModel;
|
|||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -27,7 +27,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
import com.hiddenservices.onionservices.constants.enums;
|
||||
import com.hiddenservices.onionservices.constants.status;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@ package com.hiddenservices.onionservices.constants;
|
|||
public class enums {
|
||||
/*Settings Manager*/
|
||||
public enum etype {
|
||||
M_CHANGE_HOME_THEME, M_IS_ERROR_PAGE, 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_ON_STOP_SCROLL, M_INIT_PADDING, M_RATE_COUNT, M_CACHE_UPDATE_TAB, M_DEFAULT_BROWSER,
|
||||
M_CHANGE_HOME_THEME, M_IS_ERROR_PAGE, 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, ON_DESTROY_MEDIA, M_ON_MAIL, SESSION_ID, M_UPDATE_PIXEL_BACKGROUND, M_ON_SCROLL_BOUNDARIES, M_ON_SCROLL_TOP_BOUNDARIES, M_ON_SCROLL_NO_BOUNDARIES, M_ON_STOP_SCROLL, M_INIT_PADDING, M_RATE_COUNT, M_CACHE_UPDATE_TAB, M_DEFAULT_BROWSER,
|
||||
on_verify_selected_url_menu, FINDER_RESULT_CALLBACK, M_ADMOB_BANNER_RECHECK, M_OPEN_SESSION, M_DOWNLOAD_FAILURE, M_ADVERT_LOADED,
|
||||
welcome, reload, download_folder, M_UPDATE_THEME, M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS, M_INIT_TAB_COUNT_FORCED, M_GET_SSL_STATUS, M_SPLASH_DISABLE, M_NEW_LINK_IN_NEW_TAB, M_NEW_LINK_IN_NEW_TAB_LOAD, M_RESET_SUGGESTION,
|
||||
url_triggered, url_triggered_new_tab, url_clear, fetch_favicon, M_OPEN_BOOKMARK_SETTING, M_COPY_URL, url_clear_at, remove_from_database, is_empty, M_HOME_PAGE, M_PRELOAD_URL, ON_KEYBOARD_CLOSE, M_CLOSE_TAB, M_CLOSE_TAB_BACK,
|
||||
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_INDEX_WEBSITE, M_INIT_RUNTIME_SETTINGS, M_INIT_TOR, M_NEW_IDENTITY_MESSAGED, M_INITIALIZE_TAB_SINGLE, M_HOME_BUTTON_PRESSED, M_INITIALIZE_TAB_LINK, on_request_completed, on_update_history, on_update_suggestion, M_WELCOME_MESSAGE, ON_FIRST_PAINT, ON_INVOKE_PARSER, ON_LOAD_TAB_ON_RESUME, ON_LOAD_ADVERT, ON_SESSION_REINIT, on_page_loaded, on_load_error, M_ORBOT_LOADING, download_file_popup, on_init_ads, on_full_screen_ads, M_GET_CURRENT_URL, 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_INDEX_WEBSITE, M_INIT_RUNTIME_SETTINGS, M_INIT_TOR, M_NEW_IDENTITY_MESSAGED, M_INITIALIZE_TAB_SINGLE, M_HOME_BUTTON_PRESSED, M_INITIALIZE_TAB_LINK, on_request_completed, ON_UPDATE_HISTORY, on_update_suggestion, M_WELCOME_MESSAGE, ON_FIRST_PAINT, ON_INVOKE_PARSER, ON_LOAD_TAB_ON_RESUME, ON_LOAD_ADVERT, ON_SESSION_REINIT, on_page_loaded, on_load_error, M_ORBOT_LOADING, download_file_popup, on_init_ads, on_full_screen_ads, M_GET_CURRENT_URL, search_update, open_new_tab, open_new_tab_instant
|
||||
}
|
||||
|
||||
/*General Enums*/
|
||||
|
@ -25,6 +25,10 @@ public class enums {
|
|||
public static final int CRITICAL_MEMORY = 3;
|
||||
}
|
||||
|
||||
public enum MediaController {
|
||||
DESTROY, PLAY, PAUSE, SKIP_FORWARD, SKIP_BACKWARD, STOP;
|
||||
}
|
||||
|
||||
public static class AddTabCallback {
|
||||
public static final int TAB_ADDED = 0;
|
||||
public static final int TAB_FULL = 1;
|
||||
|
@ -42,12 +46,6 @@ public class enums {
|
|||
public static final int SEARCHBAR = 2;
|
||||
}
|
||||
|
||||
public static class ImageQueueStatus {
|
||||
public static final int M_IMAGE_LOADING = 0;
|
||||
public static final int M_IMAGE_LOADED_SUCCESSFULLY = 1;
|
||||
public static final int M_IMAGE_LOADING_FAILED = 2;
|
||||
}
|
||||
|
||||
public static class ScrollDirection {
|
||||
public static final int HORIZONTAL = 0;
|
||||
public static final int VERTICAL = 1;
|
||||
|
@ -58,11 +56,5 @@ public class enums {
|
|||
public static final String OPEN_VOICE = "mOpenVoice";
|
||||
}
|
||||
|
||||
public static class LandingPageTypes {
|
||||
public static final int M_LANDING_WELCOME = 0;
|
||||
public static final int M_LANDING_INTRO = 1;
|
||||
public static final int M_LANDING_START = 2;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -31,9 +31,10 @@ public class bookmarkDataModel {
|
|||
|
||||
void initializebookmark(ArrayList<bookmarkRowModel> pBookmark) {
|
||||
mBookmarks = pBookmark;
|
||||
for (int mCounter = 0; mCounter < pBookmark.size(); mCounter++) {
|
||||
for (int mCounter = pBookmark.size()-1; mCounter >= 0; mCounter--) {
|
||||
if (mAvailableBookmark.containsKey(pBookmark.get(mCounter).getDescription())) {
|
||||
deleteBookmark(pBookmark.get(mCounter).getID());
|
||||
mCounter++;
|
||||
} else {
|
||||
mAvailableBookmark.put(pBookmark.get(mCounter).getDescription(), pBookmark.get(mCounter).getID());
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class tabRowModel {
|
|||
public void setSession(geckoSession pSession, String pURL, String pTitle, String pTheme, GeckoSession.SessionState pSessionState) {
|
||||
mSession = pSession;
|
||||
mSession.setTitle(pTitle);
|
||||
mSession.setURL(pURL);
|
||||
mSession.getHistoryDelegate().setURL(pURL);
|
||||
mSession.setTheme(pTheme);
|
||||
|
||||
if (pSessionState != null) {
|
||||
|
@ -63,7 +63,7 @@ public class tabRowModel {
|
|||
if (!status.sSettingIsAppStarted) {
|
||||
if (pTitle.equals("$TITLE") || pTitle.startsWith("http://loading") || pTitle.startsWith("loading") || pURL.equals("$TITLE") || pURL.startsWith("http://loading") || pURL.startsWith("loading")) {
|
||||
mSession.setTitle("about:blank");
|
||||
mSession.setURL("about:blank");
|
||||
mSession.getHistoryDelegate().setURL("about:blank");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ import androidx.core.content.ContextCompat;
|
|||
import androidx.core.content.FileProvider;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
|
||||
import com.example.myapplication.BuildConfig;
|
||||
import com.hiddenservices.onionservices.BuildConfig;
|
||||
import com.hiddenservices.onionservices.appManager.activityContextManager;
|
||||
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.geckoSession;
|
||||
import com.hiddenservices.onionservices.appManager.kotlinHelperLibraries.defaultBrowser;
|
||||
|
@ -66,7 +66,7 @@ import com.hiddenservices.onionservices.constants.keys;
|
|||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.hiddenservices.onionservices.libs.trueTime.trueTimeEncryption;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
|
@ -387,9 +387,9 @@ public class helperMethod {
|
|||
ss.setSpan(new ForegroundColorSpan(Color.GRAY), 5, 8, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
if(pTheme != enums.Theme.THEME_DARK){
|
||||
ss.setSpan(new ForegroundColorSpan(Color.BLACK), getHost(url).length()+7, url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new ForegroundColorSpan(Color.BLACK), getHost(url).length()+8, url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}else {
|
||||
ss.setSpan(new ForegroundColorSpan(Color.WHITE), getHost(url).length()+7, url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new ForegroundColorSpan(Color.WHITE), getHost(url).length()+8, url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
return ss;
|
||||
}else {
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.hiddenservices.onionservices.appManager.activityContextManager;
|
|||
import com.hiddenservices.onionservices.appManager.activityThemeManager;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginController;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package com.hiddenservices.onionservices.libs.netcipher.client;
|
|||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
|
|
@ -22,32 +22,32 @@ public class appLovinManager {
|
|||
public appLovinManager(eventObserver.eventListener pEvent, View pBannerAds, AppCompatActivity pContext) {
|
||||
this.mEvent = pEvent;
|
||||
this.mContext = pContext;
|
||||
|
||||
onInitializeAdvertisement(pContext);
|
||||
}
|
||||
|
||||
private void onInitializeAdvertisement(AppCompatActivity pContext) {
|
||||
AppLovinSdk.getInstance(pContext).getSettings().setVerboseLogging(true);
|
||||
AppLovinSdk.getInstance(pContext).setMediationProvider("max");
|
||||
AppLovinSdk.initializeSdk(pContext, configuration -> {
|
||||
if(!mLowMemoryReached){
|
||||
this.mSupportManager = new applovinSupportManager(pContext);
|
||||
this.mBannerManager = new applovinBannerManager(pContext, mEvent);
|
||||
}
|
||||
});
|
||||
private void onInitializeAdvertisement() {
|
||||
if(!mLowMemoryReached){
|
||||
AppLovinSdk.getInstance(mContext).getSettings().setVerboseLogging(true);
|
||||
AppLovinSdk.getInstance(mContext).setMediationProvider("max");
|
||||
AppLovinSdk.initializeSdk(mContext, configuration -> {
|
||||
if(!mLowMemoryReached){
|
||||
this.mSupportManager = new applovinSupportManager(mContext);
|
||||
this.mBannerManager = new applovinBannerManager(mContext, mEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*Local Helper Methods*/
|
||||
|
||||
private void onShowInterstitial() {
|
||||
if(AppLovinSdk.getInstance(mContext).isInitialized()){
|
||||
if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mSupportManager!=null){
|
||||
this.mSupportManager.onShow();
|
||||
}
|
||||
}
|
||||
|
||||
private void onToggleBannerShow(boolean pStatus) {
|
||||
if(AppLovinSdk.getInstance(mContext).isInitialized()){
|
||||
this.mBannerManager.onShow(pStatus);
|
||||
if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mBannerManager!=null){
|
||||
this.mBannerManager.onShowToggle(pStatus);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,9 @@ public class appLovinManager {
|
|||
|
||||
private void onDestroy() {
|
||||
mLowMemoryReached = true;
|
||||
mBannerManager.onDestroy();
|
||||
if(mBannerManager!=null){
|
||||
mBannerManager.onDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
/*External Triggers*/
|
||||
|
@ -71,6 +73,8 @@ public class appLovinManager {
|
|||
onToggleBannerShow(false);
|
||||
} else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_INTERSTITIAL)) {
|
||||
onShowInterstitial();
|
||||
} else if (pEventType.equals(pluginEnums.eAdManager.M_INIT_ADS)) {
|
||||
onInitializeAdvertisement();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class applovinBannerManager implements MaxAdViewAdListener{
|
|||
|
||||
private static final String S_UNIT_ID = "642ec6302c7cecd2";
|
||||
private MaxAdView mBanner;
|
||||
eventObserver.eventListener mEvent;
|
||||
private eventObserver.eventListener mEvent;
|
||||
|
||||
/* Initializations */
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class applovinBannerManager implements MaxAdViewAdListener{
|
|||
|
||||
/* Helper Methods */
|
||||
|
||||
public void onShow(boolean pStatus) {
|
||||
public void onShowToggle(boolean pStatus) {
|
||||
if(mBanner!=null){
|
||||
if(pStatus){
|
||||
mBanner.startAutoRefresh();
|
||||
|
|
|
@ -9,7 +9,7 @@ import android.webkit.JavascriptInterface;
|
|||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.hiddenservices.onionservices.constants.status;
|
|||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.hiddenservices.onionservices.libs.netcipher.client.StrongHttpsClient;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import org.torproject.android.service.wrapper.orbotLocalConstants;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.hiddenservices.onionservices.constants.strings;
|
|||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.helperManager.helperMethod;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import org.mozilla.geckoview.ContentBlocking;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -15,7 +15,7 @@ import androidx.core.app.NotificationCompat;
|
|||
|
||||
import com.hiddenservices.onionservices.appManager.activityContextManager;
|
||||
import com.hiddenservices.onionservices.constants.strings;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import androidx.core.app.NotificationCompat;
|
|||
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
|
|
@ -4,7 +4,7 @@ public class pluginEnums {
|
|||
|
||||
/*Advert Manager*/
|
||||
public enum eAdManager {
|
||||
M_IS_ADVERT_LOADED, M_LOW_MEMORY_DESTROY, M_HIDE_BANNER, M_SHOW_BANNER, M_SHOW_INTERSTITIAL
|
||||
M_IS_ADVERT_LOADED, M_LOW_MEMORY_DESTROY, M_HIDE_BANNER, M_SHOW_BANNER, M_SHOW_INTERSTITIAL, M_INIT_ADS
|
||||
}
|
||||
|
||||
public enum eAdManagerCallbacks {
|
||||
|
|
|
@ -10,7 +10,7 @@ import android.os.Bundle;
|
|||
import android.util.Log;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
import com.widget.onionservices.helperMethod.helperMethod;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -6,7 +6,7 @@ import android.view.View;
|
|||
import android.widget.RemoteViews;
|
||||
|
||||
import com.hiddenservices.onionservices.eventObserver;
|
||||
import com.example.myapplication.R;
|
||||
import com.hiddenservices.onionservices.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:bottom="1dp"
|
||||
android:left="-2dp"
|
||||
android:right="-2dp"
|
||||
android:top="-2dp">
|
||||
<shape android:shape="rectangle" >
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/c_ripple_v2" />
|
||||
|
||||
<solid android:color="#00FFFFFF" />
|
||||
|
||||
<padding android:left="10dp"
|
||||
android:right="10dp"
|
||||
android:top="10dp"
|
||||
android:bottom="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
|
@ -156,7 +156,7 @@
|
|||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_weight="17"
|
||||
android:background="@xml/gx_ripple_blue"
|
||||
android:background="@xml/bx_border_recycleview"
|
||||
android:textAllCaps="false"
|
||||
android:paddingStart="20dp"
|
||||
android:stateListAnimator="@null"
|
||||
|
@ -179,6 +179,7 @@
|
|||
android:id="@+id/pRecycleView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="100dp"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
|
|
@ -180,6 +180,7 @@
|
|||
android:id="@+id/pRecycleView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="100dp"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
android:layout_marginEnd="10dp"
|
||||
android:clickable="false"
|
||||
android:ellipsize="end"
|
||||
android:textAlignment="viewStart"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="0dp"
|
||||
|
|
|
@ -473,7 +473,7 @@
|
|||
android:background="@xml/hox_rounded_corner_splash_right"
|
||||
android:contentDescription="@string/GENERAL_TODO"
|
||||
android:onClick="onSupportSplash"
|
||||
app:tint="@color/c_setting_icon_tint"
|
||||
app:tint="#425e8a"
|
||||
android:padding="6dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@xml/ic_baseline_support"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue