From c6e9180e5dec6d4e48107da87117b71b5d59e18e Mon Sep 17 00:00:00 2001 From: Abdul Mannan Date: Sun, 13 Feb 2022 02:41:31 +0500 Subject: [PATCH] Bug Fixes Bug Fixes --- app/build.gradle | 1 + .../assets/Homepage/style/cs-homepage.css | 4 +- .../dataManager/crawlerDataModel.java | 47 +++++-------------- 3 files changed, 16 insertions(+), 36 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 70b724d4..87b751ef 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -140,6 +140,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'com.google.android.gms:play-services-ads:20.5.0' implementation group: 'com.macasaet.fernet', name: 'fernet-java8', version: '1.4.2' + implementation 'org.apache.commons:commons-text:1.3' } /* Automated APK Generation */ diff --git a/app/src/main/assets/Homepage/style/cs-homepage.css b/app/src/main/assets/Homepage/style/cs-homepage.css index a746f7f7..1ae38ae7 100644 --- a/app/src/main/assets/Homepage/style/cs-homepage.css +++ b/app/src/main/assets/Homepage/style/cs-homepage.css @@ -612,11 +612,11 @@ .hi_reference_header{ margin-left: 50px; padding-left: 10px; - border-left: 5px solid #fcfcfc !important; + border-left: 5px solid #f0f0f0 !important; font-weight: bold; font-size: 16px; margin-top: 10px; - color: #8cb3d9; + color: #6699cc; padding-top:3px; padding-bottom: 3px; } diff --git a/app/src/main/java/com/hiddenservices/genesissearchengine.production/dataManager/crawlerDataModel.java b/app/src/main/java/com/hiddenservices/genesissearchengine.production/dataManager/crawlerDataModel.java index bf00222d..f1febd2c 100644 --- a/app/src/main/java/com/hiddenservices/genesissearchengine.production/dataManager/crawlerDataModel.java +++ b/app/src/main/java/com/hiddenservices/genesissearchengine.production/dataManager/crawlerDataModel.java @@ -1,14 +1,11 @@ package com.hiddenservices.genesissearchengine.production.dataManager; import android.annotation.SuppressLint; -import android.text.Html; - +import android.text.TextUtils; import androidx.appcompat.app.AppCompatActivity; +import com.android.volley.DefaultRetryPolicy; import com.android.volley.Request; import com.android.volley.RequestQueue; -import com.android.volley.Response; -import com.android.volley.VolleyError; -import com.android.volley.toolbox.HttpStack; import com.android.volley.toolbox.HurlStack; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; @@ -17,31 +14,14 @@ import com.hiddenservices.genesissearchengine.production.constants.strings; import com.hiddenservices.genesissearchengine.production.dataManager.models.crawlerRowModel; import com.hiddenservices.genesissearchengine.production.helperManager.helperMethod; -import org.json.JSONObject; -import org.jsoup.Jsoup; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; -import org.jsoup.select.Elements; +import org.apache.commons.text.StringEscapeUtils; import org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.DataOutputStream; import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.InetSocketAddress; -import java.net.MalformedURLException; import java.net.Proxy; -import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -49,15 +29,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import ch.boye.httpclientandroidlib.NameValuePair; -import ch.boye.httpclientandroidlib.client.methods.CloseableHttpResponse; -import ch.boye.httpclientandroidlib.client.methods.HttpUriRequest; -import ch.boye.httpclientandroidlib.client.methods.RequestBuilder; -import ch.boye.httpclientandroidlib.impl.client.CloseableHttpClient; -import ch.boye.httpclientandroidlib.impl.client.HttpClients; -import ch.boye.httpclientandroidlib.message.BasicNameValuePair; -import ch.boye.httpclientandroidlib.util.EntityUtils; - @SuppressLint("CommitPrefEdits") class crawlerDataModel { @@ -111,20 +82,28 @@ class crawlerDataModel String mURL = strings.GENERIC_EMPTY_STR; private void onSendRequest(){ - RequestQueue mRequestQueue = Volley.newRequestQueue(mContext, new ProxiedHurlStack()); + RequestQueue mRequestQueue = Volley.newRequestQueue(mContext); + String url = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/user_index/"; StringRequest mRequestData = new StringRequest(Request.Method.POST, url, response -> { Log.d("",response); }, error -> { - Log.d("",error.toString()); + Log.d("",error.toString()); }) { protected Map getParams() { + mHtml = StringEscapeUtils.escapeXml11(mHtml); + mHtml = mHtml.replace("\n"," "); + Map MyData = new HashMap<>(); MyData.put("m_html", mHtml); MyData.put("m_url", mURL); return MyData; } }; + mRequestData.setRetryPolicy(new DefaultRetryPolicy( + 30000, + DefaultRetryPolicy.DEFAULT_MAX_RETRIES, + DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); mRequestQueue.add(mRequestData); }