From 70901fdcadcd4b2b9742789e118ddb925c8a1152 Mon Sep 17 00:00:00 2001
From: Abdul Mannan Saeed <111820160@umt.edu.pk>
Date: Sun, 1 May 2022 03:11:28 -0700
Subject: [PATCH] Bug Fixes
Bug Fixes
---
.idea/misc.xml | 3 +
app/src/main/AndroidManifest.xml | 10 +
.../main/assets/homepage/homepage-dark.html | 16 +-
app/src/main/assets/homepage/homepage.html | 16 +-
.../advertManager/advertController.java | 1 -
.../advertManager/advertViewController.java | 4 +
.../homeController/homeController.java | 25 +-
.../orionAdvertController.java | 77 ++
.../orionAdvertManager/orionAdvertEnums.java | 13 +
.../orionAdvertViewController.java | 58 ++
.../orionAdvertWebViewClient.java | 34 +
.../advertResources/advert_constants.java | 14 +
.../advertSettingController.java | 157 ++++
.../advertSetttings/advertSettingEnums.java | 15 +
.../advertSetttings/advertSettingModel.java | 24 +
.../advertSettingViewController.java | 85 ++
.../adPluginManager/orionAdvertManager.java | 110 +++
.../downloadManager.java | 1 -
.../pluginManager/pluginController.java | 14 +-
.../adview/layout-land/certificate_info.xml | 99 +++
.../layout-land/secure_connection_popup.xml | 361 +++++++++
.../adview/layout/certificate_info.xml | 101 +++
.../adview/layout/popup_bridge_mail.xml | 97 +++
.../layout/popup_bridge_setting_custom.xml | 184 +++++
.../adview/layout/popup_create_bookmark.xml | 131 +++
.../layout/popup_data_cleared_shortcut.xml | 78 ++
.../adview/layout/popup_download_full.xml | 461 +++++++++++
.../adview/layout/popup_download_url.xml | 139 ++++
.../adview/layout/popup_file_longpress.xml | 316 ++++++++
.../res/layouts/adview/layout/popup_find.xml | 102 +++
.../res/layouts/adview/layout/popup_panic.xml | 97 +++
.../adview/layout/popup_rate_failure.xml | 97 +++
.../layouts/adview/layout/popup_rate_us.xml | 115 +++
.../adview/layout/popup_toast_generic.xml | 78 ++
.../adview/layout/popup_toast_undo.xml | 84 ++
.../adview/layout/popup_tor_change.xml | 98 +++
.../adview/layout/popup_url_longpress.xml | 263 ++++++
.../adview/layout/secure_connection_popup.xml | 361 +++++++++
.../activity_orion_adview_controller.xml | 96 +++
.../res/layouts/home/layout/home_view.xml | 24 +-
.../setting/layout/setting_advert_view.xml | 751 ++++++++++++++++++
app/src/main/res/values/strings.xml | 4 +-
42 files changed, 4778 insertions(+), 36 deletions(-)
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertController.java
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertEnums.java
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertViewController.java
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertWebViewClient.java
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/advertSetttings/advertResources/advert_constants.java
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/advertSetttings/advertSettingController.java
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/advertSetttings/advertSettingEnums.java
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/advertSetttings/advertSettingModel.java
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/advertSetttings/advertSettingViewController.java
create mode 100644 app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/orionAdvertManager.java
create mode 100644 app/src/main/res/layouts/adview/layout-land/certificate_info.xml
create mode 100644 app/src/main/res/layouts/adview/layout-land/secure_connection_popup.xml
create mode 100644 app/src/main/res/layouts/adview/layout/certificate_info.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_bridge_mail.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_bridge_setting_custom.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_create_bookmark.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_data_cleared_shortcut.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_download_full.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_download_url.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_file_longpress.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_find.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_panic.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_rate_failure.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_rate_us.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_toast_generic.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_toast_undo.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_tor_change.xml
create mode 100644 app/src/main/res/layouts/adview/layout/popup_url_longpress.xml
create mode 100644 app/src/main/res/layouts/adview/layout/secure_connection_popup.xml
create mode 100644 app/src/main/res/layouts/history/layout/activity_orion_adview_controller.xml
create mode 100644 app/src/main/res/layouts/setting/layout/setting_advert_view.xml
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 91255167..d1072453 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -84,7 +84,9 @@
+
+
@@ -95,6 +97,7 @@
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b0982c79..a7bc428d 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -33,6 +33,11 @@
android:name="com.hiddenservices.onionservices.appManager.advertManager.advertController"
android:exported="true" />
+
+
+
+
-
-
+
+
-
-
+
+
@@ -110,11 +110,11 @@
diff --git a/app/src/main/assets/homepage/homepage.html b/app/src/main/assets/homepage/homepage.html
index 99685de6..ac47e150 100755
--- a/app/src/main/assets/homepage/homepage.html
+++ b/app/src/main/assets/homepage/homepage.html
@@ -92,11 +92,11 @@
-
-
+
+
-
-
+
+
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertController.java
index 4db1ff3d..f370da24 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertController.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertController.java
@@ -56,7 +56,6 @@ public class advertController extends AppCompatActivity {
finish();
}
-
/* Callbacks */
public class webivewViewCallback implements eventObserver.eventListener {
@Override
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertViewController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertViewController.java
index 19db75c4..f499dfb3 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertViewController.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertViewController.java
@@ -6,12 +6,14 @@ import android.widget.ProgressBar;
import androidx.appcompat.app.AppCompatActivity;
import com.example.myapplication.R;
import com.hiddenservices.onionservices.eventObserver;
+import com.hiddenservices.onionservices.helperManager.sharedUIMethod;
import java.util.List;
public class advertViewController extends AppCompatActivity {
private WebView mWebView;
+ private AppCompatActivity mContext;
private ProgressBar mProgressBar;
@Override
@@ -22,6 +24,7 @@ public class advertViewController extends AppCompatActivity {
advertViewController(AppCompatActivity pContext, eventObserver.eventListener pEvent, WebView pGeckoView, ProgressBar pProgressBar)
{
+ this.mContext = pContext;
this.mWebView = pGeckoView;
this.mProgressBar = pProgressBar;
@@ -29,6 +32,7 @@ public class advertViewController extends AppCompatActivity {
}
private void initViews(){
+ sharedUIMethod.updateStatusBar(mContext);
}
public void onUpdateProgressBar(boolean status){
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java
index 2c441093..a3213624 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java
@@ -1,10 +1,10 @@
package com.hiddenservices.onionservices.appManager.homeManager.homeController;
+import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
+
import android.annotation.SuppressLint;
import android.app.ActivityManager;
-import android.app.AlarmManager;
import android.app.DownloadManager;
-import android.app.PendingIntent;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ClipData;
@@ -52,9 +52,11 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.applovin.mediation.ads.MaxAdView;
import com.hiddenservices.onionservices.appManager.activityContextManager;
+import com.hiddenservices.onionservices.appManager.advertManager.advertController;
import com.hiddenservices.onionservices.appManager.bookmarkManager.bookmarkSettings.bookmarkSettingController;
import com.hiddenservices.onionservices.appManager.bookmarkManager.bookmarkHome.bookmarkController;
import com.hiddenservices.onionservices.appManager.historyManager.historyController;
+import com.hiddenservices.onionservices.appManager.orionAdvertManager.orionAdvertController;
import com.hiddenservices.onionservices.dataManager.models.historyRowModel;
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.NestedGeckoView;
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.*;
@@ -99,8 +101,6 @@ import java.util.Locale;
import java.util.Objects;
import java.util.concurrent.Callable;
import mozilla.components.support.utils.DownloadUtils;
-import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
-import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
import static androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode;
import static com.hiddenservices.onionservices.constants.constants.CONST_EXTERNAL_SHORTCUT_COMMAND_ERASE_OPEN;
import static com.hiddenservices.onionservices.constants.constants.CONST_EXTERNAL_SHORTCUT_COMMAND_RESTART;
@@ -197,7 +197,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
private boolean mSearchBarLoading = false;
private boolean mSearchBarLoadingOpening = false;
private boolean mSearchBarWasBackButtonPressed = false;
- private boolean mWasEdittextChanged = false;
private String mSearchBarPreviousText = strings.GENERIC_EMPTY_STR;
private Handler mScrollHandler = null;
private Runnable mScrollRunnable = null;
@@ -341,6 +340,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mSearchBarLoading = false;
}
+ public void onAdvertClick(View view){
+ Intent myIntent = new Intent(this, orionAdvertController.class);
+ startActivity(myIntent);
+ }
+
public void initSuggestions(){
mSuggestions = (ArrayList)dataController.getInstance().invokeSuggestions(dataEnums.eSuggestionCommands.M_GET_SUGGESTIONS, Collections.singletonList(mSearchbar.getText().toString()));
}
@@ -978,7 +982,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
- mWasEdittextChanged = true;
+
new Handler().postDelayed(() ->
{
String mText = mSearchbar.getText().toString();
@@ -1010,7 +1014,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(mSuggestions.size()>0){
mSuggestions = (ArrayList)dataController.getInstance().invokeSuggestions(dataEnums.eSuggestionCommands.M_GET_SUGGESTIONS, Collections.singletonList(mText));
if(mHintListView.getAdapter()==null){
- initSuggestionView(mSuggestions, mText.toString());
+ initSuggestionView(mSuggestions, mText);
}else if(!mSearchBarLoadingOpening){
mEdittextChanged.removeCallbacks(postToServerRunnable);
if(!mSearchBarLoading){
@@ -1064,7 +1068,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(!hasFocus)
{
msearchstatuscopy = false;
- mWasEdittextChanged = false;
mSearchBarWasBackButtonPressed = true;
new Handler().postDelayed(() ->
{
@@ -1115,7 +1118,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
};
public void onSearchBarInvoked(View view){
- String url = mGeckoClient.getSession().getCurrentURL();
+ String url;
if(!mSearchBarPreviousText.equals(mSearchbar.getText().toString())){
url = mSearchbar.getText().toString();
}else {
@@ -1610,7 +1613,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
{
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
activityContextManager.getInstance().setCurrentActivity(this);
- if (mGeckoClient.getSession()!=null && mGeckoClient!=null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mGeckoClient.getUriPermission()!=null) {
+ if (mGeckoClient.getSession() != null && mGeckoClient != null && mGeckoClient.getUriPermission() != null) {
this.revokeUriPermission(mGeckoClient.getUriPermission(), Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
}
if(isSuggestionSearchOpened){
@@ -1643,7 +1646,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mProgressBar.setProgress(0);
}
}else {
- if(model.getSession().getSessionID() != mGeckoClient.getSession().getSessionID()){
+ if(!model.getSession().getSessionID().equals(mGeckoClient.getSession().getSessionID())){
onLoadTab(model.getSession(),false,true, false);
}
if(mGeckoClient.getSession().getProgress()!=100){
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertController.java
new file mode 100644
index 00000000..cdcb6bf3
--- /dev/null
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertController.java
@@ -0,0 +1,77 @@
+package com.hiddenservices.onionservices.appManager.orionAdvertManager;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.webkit.WebView;
+import android.widget.ProgressBar;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.myapplication.R;
+import com.hiddenservices.onionservices.appManager.settingManager.advertSetttings.advertSettingController;
+import com.hiddenservices.onionservices.eventObserver;
+
+import java.util.Collections;
+import java.util.List;
+
+public class orionAdvertController extends AppCompatActivity {
+
+ WebView mWebView;
+ ProgressBar mProgressBar;
+ orionAdvertViewController mAdvertViewController;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_orion_adview_controller);
+
+ initializeViews();
+ onInitializeAdvertisements();
+ onInitAdvert();
+ }
+
+ private void initializeViews() {
+ mWebView = findViewById(R.id.pWebView);
+ mProgressBar = findViewById(R.id.mProgressBar);
+ mAdvertViewController = new orionAdvertViewController(this, null, mWebView, mProgressBar);
+ }
+
+ void onInitAdvert(){
+ mWebView.getSettings().setDomStorageEnabled(true);
+ mWebView.getSettings().setGeolocationEnabled(true);
+ mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
+ mWebView.getSettings().setUseWideViewPort(true);
+ mWebView.getSettings().setAppCacheEnabled(true);
+ mWebView.getSettings().setDatabaseEnabled(true);
+ mWebView.setWebViewClient(new orionAdvertWebViewClient(new webivewViewCallback()));
+ }
+
+ private void onInitializeAdvertisements(){
+ mWebView.loadUrl("https://360wise.com");
+ }
+
+ /* Helper Methods */
+ public void onClose(View view) {
+ finish();
+ }
+
+ public void onSettings(View view) {
+ Intent myIntent = new Intent(this, advertSettingController.class);
+ startActivity(myIntent);
+ }
+
+
+ /* Callbacks */
+ public class webivewViewCallback implements eventObserver.eventListener {
+ @Override
+ public Object invokeObserver(List