From e110482b8010eb581ecc39182c950ce8f7b09767 Mon Sep 17 00:00:00 2001 From: Franck W Date: Mon, 29 Jun 2020 20:52:47 +0200 Subject: [PATCH 1/5] =?UTF-8?q?M=C3=A0j=20des=20build.gradle.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/jarRepositories.xml | 30 ++++++++++++++++++++++++ app/build.gradle | 22 ++++++++--------- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 4 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 .idea/jarRepositories.xml diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..26b9015 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 76929c7..6bacf96 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,8 +22,8 @@ android { kotlinOptions { jvmTarget = '1.8' } - dataBinding { - enabled = true + buildFeatures { + dataBinding = true } buildTypes { release { @@ -48,23 +48,23 @@ dependencies { implementation 'androidx.appcompat:appcompat-resources:1.1.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' - implementation 'androidx.core:core:1.2.0' - implementation 'androidx.core:core-ktx:1.2.0' - implementation 'androidx.drawerlayout:drawerlayout:1.1.0-beta01' - implementation 'androidx.emoji:emoji-appcompat:1.0.0' - implementation 'androidx.fragment:fragment:1.2.4' - implementation 'androidx.fragment:fragment-ktx:1.2.4' + implementation 'androidx.core:core:1.3.0' + implementation 'androidx.core:core-ktx:1.3.0' + implementation 'androidx.drawerlayout:drawerlayout:1.1.0' + implementation 'androidx.emoji:emoji-appcompat:1.1.0' + implementation 'androidx.fragment:fragment:1.2.5' + implementation 'androidx.fragment:fragment-ktx:1.2.5' implementation 'androidx.gridlayout:gridlayout:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'com.github.bumptech.glide:annotations:4.11.0' implementation 'com.github.bumptech.glide:glide:4.11.0' implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0' implementation 'com.google.android.material:material:1.1.0' - implementation 'com.squareup.okhttp3:okhttp:4.5.0' + implementation 'com.squareup.okhttp3:okhttp:4.7.2' implementation 'com.takisoft.preferencex:preferencex:1.0.0' implementation 'com.takisoft.preferencex:preferencex-colorpicker:1.0.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7' kapt 'com.github.bumptech.glide:compiler:4.11.0' } diff --git a/build.gradle b/build.gradle index 5a42266..2f307b9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ buildscript { - ext.kotlin_version = '1.3.71' + ext.kotlin_version = '1.3.72' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.6.2' + classpath 'com.android.tools.build:gradle:4.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6d444c7..82c14a5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Apr 10 12:27:09 CEST 2020 +#Mon Jun 29 20:31:32 CEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip From 62a76a7f98989055c839b211f4ed9451f312388d Mon Sep 17 00:00:00 2001 From: Franck W Date: Mon, 29 Jun 2020 20:59:52 +0200 Subject: [PATCH 2/5] Suppression de la popup de cookies dans les webviews. --- .../com/franckrj/respawnirc/ConnectActivity.java | 4 ++-- .../franckrj/respawnirc/utils/AccountManager.java | 3 +-- .../java/com/franckrj/respawnirc/utils/Utils.java | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/franckrj/respawnirc/ConnectActivity.java b/app/src/main/java/com/franckrj/respawnirc/ConnectActivity.java index 98e5ab3..001cd1f 100644 --- a/app/src/main/java/com/franckrj/respawnirc/ConnectActivity.java +++ b/app/src/main/java/com/franckrj/respawnirc/ConnectActivity.java @@ -23,6 +23,7 @@ import com.franckrj.respawnirc.utils.AccountManager; import com.franckrj.respawnirc.utils.PrefsManager; import com.franckrj.respawnirc.utils.Undeprecator; +import com.franckrj.respawnirc.utils.Utils; public class ConnectActivity extends AbsHomeIsBackActivity { private static final long MAX_TIME_USER_HAVE_TO_LEAVE_IN_MS = 3_500; @@ -88,8 +89,7 @@ public void onCreate(Bundle savedInstanceState) { helpDialogFragment = new HelpConnectDialogFragment(); saveCookieButton.setOnClickListener(saveCookieClickedListener); - CookieManager.getInstance().removeAllCookies(null); - CookieManager.getInstance().setCookie("http://www.jeuxvideo.com", "euconsent=set"); + Utils.setupCookiesForJvc(CookieManager.getInstance()); jvcWebView.setWebViewClient(new WebViewClient()); jvcWebView.setWebChromeClient(new WebChromeClient()); diff --git a/app/src/main/java/com/franckrj/respawnirc/utils/AccountManager.java b/app/src/main/java/com/franckrj/respawnirc/utils/AccountManager.java index c25f318..7937bc9 100644 --- a/app/src/main/java/com/franckrj/respawnirc/utils/AccountManager.java +++ b/app/src/main/java/com/franckrj/respawnirc/utils/AccountManager.java @@ -86,8 +86,7 @@ public static String getAllAccountsPseudoRegex() { public static void setCurrentAccount(AccountInfos newCurrentAccount) { currentAccount = new AccountInfos(newCurrentAccount.pseudo, newCurrentAccount.cookie, newCurrentAccount.isModo); - CookieManager.getInstance().removeAllCookies(null); - CookieManager.getInstance().setCookie("http://www.jeuxvideo.com", "euconsent=set"); + Utils.setupCookiesForJvc(CookieManager.getInstance()); PrefsManager.putString(PrefsManager.StringPref.Names.PSEUDO_OF_USER, currentAccount.pseudo); PrefsManager.putString(PrefsManager.StringPref.Names.COOKIES_LIST, currentAccount.cookie); PrefsManager.putBool(PrefsManager.BoolPref.Names.USER_IS_MODO, currentAccount.isModo); diff --git a/app/src/main/java/com/franckrj/respawnirc/utils/Utils.java b/app/src/main/java/com/franckrj/respawnirc/utils/Utils.java index 7339a48..619700e 100644 --- a/app/src/main/java/com/franckrj/respawnirc/utils/Utils.java +++ b/app/src/main/java/com/franckrj/respawnirc/utils/Utils.java @@ -15,6 +15,7 @@ import android.text.Spannable; import android.view.View; import android.view.inputmethod.InputMethodManager; +import android.webkit.CookieManager; import android.widget.EditText; import com.franckrj.respawnirc.MainActivity; @@ -44,7 +45,6 @@ public static long roundToLong(double valToRound) { return (long) (valToRound + 0.5); } - @SuppressWarnings("BooleanMethodIsAlwaysInverted") public static boolean stringsAreEquals(String str1, String str2) { return (Objects.equals(str1, str2)); } @@ -130,6 +130,16 @@ public static String imageLinkToFileName(String link) { } } + public static void setupCookiesForJvc(CookieManager cookieManager) { + cookieManager.removeAllCookies(null); + cookieManager.setCookie(".www.jeuxvideo.com", "_cmpQcif3pcsupported=1"); + cookieManager.setCookie(".jeuxvideo.com", "_gcl_au=1.1.1298996599.1593456467"); + cookieManager.setCookie(".www.jeuxvideo.com", "euconsent=BO1ximpO1ximpAKAiCENDQAAAAAweAAA"); + cookieManager.setCookie(".www.jeuxvideo.com", "googlepersonalization=O1ximpO1ximpAA"); + cookieManager.setCookie(".www.jeuxvideo.com", "noniabvendorconsent=O1ximpO1ximpAKAiAA8AAA"); + cookieManager.setCookie(".www.jeuxvideo.com", "visitor_country=FR"); + } + public static void openCorrespondingBrowser(PrefsManager.LinkType linkTypeToOpenInternalBrowser, String link, Activity parentActivity) { boolean itsAJVCLink = link.matches("(?i)^http(s)?://((www|m)\\.)?jeuxvideo\\.com$") || link.matches("(?i)^http(s)?://((www|m)\\.)?jeuxvideo\\.com/.*"); @@ -212,7 +222,7 @@ public static CharSequence applyEmojiCompatIfPossible(CharSequence baseMessage) @TargetApi(25) public static void updateShortcuts(Activity parentActivity, ShortcutManager shortcutManager, int sizeOfForumFavArray) { ArrayList listOfShortcuts = new ArrayList<>(); - int sizeOfShortcutArray = (sizeOfForumFavArray > 4 ? 4 : sizeOfForumFavArray); + int sizeOfShortcutArray = Math.min(sizeOfForumFavArray, 4); for (int i = 0; i < sizeOfShortcutArray; ++i) { String currentShortcutLink = PrefsManager.getStringWithSufix(PrefsManager.StringPref.Names.FORUM_FAV_LINK, String.valueOf(i)); From c0ac2b9a95bba5bba3da4ac96a1d75e9629048f9 Mon Sep 17 00:00:00 2001 From: Franck W Date: Mon, 29 Jun 2020 21:21:42 +0200 Subject: [PATCH 3/5] Passage au HTTPS pour JVC. --- .../franckrj/respawnirc/ConnectActivity.java | 2 +- .../respawnirc/WebBrowserActivity.java | 6 +- .../base/AbsNavigationViewActivity.java | 6 +- .../dialogs/MessageMenuDialogFragment.java | 8 +-- .../dialogs/RefreshFavDialogFragment.java | 2 +- .../jvcforum/SearchTopicInForumActivity.java | 4 +- .../jvcforum/SendTopicToForumActivity.java | 6 +- .../jvcforum/ShowForumInfosActivity.java | 4 +- .../SelectForumInListActivity.java | 6 +- .../jvctopic/JVCActionsInTopic.java | 10 +-- .../jvctopic/JVCMessageToTopicSender.java | 4 +- .../jvctopic/KickPseudoActivity.java | 2 +- .../jvctopic/LockTopicActivity.java | 2 +- .../jvctopic/ShowSurveyActivity.java | 4 +- .../utils/AddOrRemoveThingToFavs.java | 2 +- .../utils/AddOrRemoveTopicToSubs.java | 4 +- .../franckrj/respawnirc/utils/JVCParser.java | 68 +++++++++---------- .../com/franckrj/respawnirc/utils/Utils.java | 14 ++-- 18 files changed, 78 insertions(+), 76 deletions(-) diff --git a/app/src/main/java/com/franckrj/respawnirc/ConnectActivity.java b/app/src/main/java/com/franckrj/respawnirc/ConnectActivity.java index 001cd1f..ad2fccc 100644 --- a/app/src/main/java/com/franckrj/respawnirc/ConnectActivity.java +++ b/app/src/main/java/com/franckrj/respawnirc/ConnectActivity.java @@ -37,7 +37,7 @@ public class ConnectActivity extends AbsHomeIsBackActivity { @Override public void onClick(View v) { if (!pseudoText.getText().toString().isEmpty()) { - String allCookiesInstring = CookieManager.getInstance().getCookie("http://www.jeuxvideo.com/"); + String allCookiesInstring = CookieManager.getInstance().getCookie("https://www.jeuxvideo.com/"); String[] allCookiesInStringArray = TextUtils.split(allCookiesInstring, ";"); String connectCookieValue = null; diff --git a/app/src/main/java/com/franckrj/respawnirc/WebBrowserActivity.java b/app/src/main/java/com/franckrj/respawnirc/WebBrowserActivity.java index 49f22e3..22da4be 100644 --- a/app/src/main/java/com/franckrj/respawnirc/WebBrowserActivity.java +++ b/app/src/main/java/com/franckrj/respawnirc/WebBrowserActivity.java @@ -49,10 +49,10 @@ public void onCreate(Bundle savedInstanceState) { if (cookies.contains(";")) { String firstCookie = cookies.substring(0, cookies.indexOf(";")); String secondCookie = cookies.substring(cookies.indexOf(";") + 1); - CookieManager.getInstance().setCookie("http://www.jeuxvideo.com/", firstCookie); - CookieManager.getInstance().setCookie("http://www.jeuxvideo.com/", secondCookie); + CookieManager.getInstance().setCookie("https://www.jeuxvideo.com/", firstCookie); + CookieManager.getInstance().setCookie("https://www.jeuxvideo.com/", secondCookie); } else { - CookieManager.getInstance().setCookie("http://www.jeuxvideo.com/", cookies); + CookieManager.getInstance().setCookie("https://www.jeuxvideo.com/", cookies); } browserWebView = findViewById(R.id.webview_webbrowser); diff --git a/app/src/main/java/com/franckrj/respawnirc/base/AbsNavigationViewActivity.java b/app/src/main/java/com/franckrj/respawnirc/base/AbsNavigationViewActivity.java index bf41d52..acf1274 100644 --- a/app/src/main/java/com/franckrj/respawnirc/base/AbsNavigationViewActivity.java +++ b/app/src/main/java/com/franckrj/respawnirc/base/AbsNavigationViewActivity.java @@ -541,13 +541,13 @@ public void onDrawerClosed(View drawerView) { startActivity(new Intent(AbsNavigationViewActivity.this, ConnectAsModoActivity.class)); break; case ITEM_ID_SHOWMP: - Utils.openLinkInInternalBrowser("http://www.jeuxvideo.com/messages-prives/boite-reception.php", AbsNavigationViewActivity.this); + Utils.openLinkInInternalBrowser("https://www.jeuxvideo.com/messages-prives/boite-reception.php", AbsNavigationViewActivity.this); break; case ITEM_ID_SHOWNOTIF: - Utils.openLinkInInternalBrowser("http://www.jeuxvideo.com/profil/" + currentAccount.pseudo.toLowerCase() + "?mode=abonnements", AbsNavigationViewActivity.this); + Utils.openLinkInInternalBrowser("https://www.jeuxvideo.com/profil/" + currentAccount.pseudo.toLowerCase() + "?mode=abonnements", AbsNavigationViewActivity.this); break; case ITEM_ID_SHOWGTA: - Utils.openLinkInInternalBrowser("http://www.jeuxvideo.com/gta/hp_alerte.php", AbsNavigationViewActivity.this); + Utils.openLinkInInternalBrowser("https://www.jeuxvideo.com/gta/hp_alerte.php", AbsNavigationViewActivity.this); break; case ITEM_ID_PREF: startActivity(new Intent(AbsNavigationViewActivity.this, SettingsActivity.class)); diff --git a/app/src/main/java/com/franckrj/respawnirc/dialogs/MessageMenuDialogFragment.java b/app/src/main/java/com/franckrj/respawnirc/dialogs/MessageMenuDialogFragment.java index d069811..9a8e9b6 100644 --- a/app/src/main/java/com/franckrj/respawnirc/dialogs/MessageMenuDialogFragment.java +++ b/app/src/main/java/com/franckrj/respawnirc/dialogs/MessageMenuDialogFragment.java @@ -62,12 +62,12 @@ public void onClick(DialogInterface dialog, int which) { if (getActivity() != null) { switch (which) { case POS_OPEN_CDV: { - String link = "http://www.jeuxvideo.com/profil/" + pseudoOfMessage.toLowerCase() + "?mode=infos"; + String link = "https://www.jeuxvideo.com/profil/" + pseudoOfMessage.toLowerCase() + "?mode=infos"; Utils.openCorrespondingBrowser(linkTypeForInternalBrowser, link, getActivity()); break; } case POS_SEND_MP: { - Utils.openLinkInInternalBrowser("http://www.jeuxvideo.com/messages-prives/nouveau.php?all_dest=" + pseudoOfMessage, getActivity()); + Utils.openLinkInInternalBrowser("https://www.jeuxvideo.com/messages-prives/nouveau.php?all_dest=" + pseudoOfMessage, getActivity()); break; } case POS_IGNORE: { @@ -93,12 +93,12 @@ public void onClick(DialogInterface dialog, int which) { break; } case POS_COPY_PERMALINK: { - Utils.putStringInClipboard("http://www.jeuxvideo.com/" + pseudoOfMessage.toLowerCase() + "/forums/message/" + idOfMessage, getActivity()); + Utils.putStringInClipboard("https://www.jeuxvideo.com/" + pseudoOfMessage.toLowerCase() + "/forums/message/" + idOfMessage, getActivity()); Toast.makeText(getActivity(), R.string.copyDone, Toast.LENGTH_SHORT).show(); break; } case POS_DDB: { - Utils.openLinkInInternalBrowser("http://www.jeuxvideo.com/" + pseudoOfMessage.toLowerCase() + "/forums/message/" + idOfMessage, getActivity()); + Utils.openLinkInInternalBrowser("https://www.jeuxvideo.com/" + pseudoOfMessage.toLowerCase() + "/forums/message/" + idOfMessage, getActivity()); break; } case POS_SELECT_TEXT: { diff --git a/app/src/main/java/com/franckrj/respawnirc/dialogs/RefreshFavDialogFragment.java b/app/src/main/java/com/franckrj/respawnirc/dialogs/RefreshFavDialogFragment.java index c244569..a311065 100644 --- a/app/src/main/java/com/franckrj/respawnirc/dialogs/RefreshFavDialogFragment.java +++ b/app/src/main/java/com/franckrj/respawnirc/dialogs/RefreshFavDialogFragment.java @@ -119,7 +119,7 @@ protected ArrayList doInBackground(String... params) { if (params.length > 1) { WebManager.WebInfos currentWebInfos = initWebInfos(params[1], false); String pageContent; - pageContent = WebManager.sendRequest("http://www.jeuxvideo.com/profil/" + params[0].toLowerCase(), "GET", "mode=favoris", currentWebInfos); + pageContent = WebManager.sendRequest("https://www.jeuxvideo.com/profil/" + params[0].toLowerCase(), "GET", "mode=favoris", currentWebInfos); if (pageContent != null) { if (typeOfFav == FAV_FORUM) { diff --git a/app/src/main/java/com/franckrj/respawnirc/jvcforum/SearchTopicInForumActivity.java b/app/src/main/java/com/franckrj/respawnirc/jvcforum/SearchTopicInForumActivity.java index 7c333aa..ca243e2 100644 --- a/app/src/main/java/com/franckrj/respawnirc/jvcforum/SearchTopicInForumActivity.java +++ b/app/src/main/java/com/franckrj/respawnirc/jvcforum/SearchTopicInForumActivity.java @@ -143,7 +143,7 @@ public void onCreate(Bundle savedInstanceState) { if (!suffixForSearch.isEmpty()) { lastSearchedText = textToSearch; idOfTypeOfSearch = getSearchTypeIdForSearchTypeInText(typeOfSearch); - baseSearchLink = "http://www.jeuxvideo.com/recherche/forums/" + suffixForSearch; + baseSearchLink = "https://www.jeuxvideo.com/recherche/forums/" + suffixForSearch; launchSearchOnResumeAndResetPageNumber = true; } } else { @@ -151,7 +151,7 @@ public void onCreate(Bundle savedInstanceState) { if (newLinkForSearch != null) { if (newLinkForSearch.lastIndexOf("/") != -1) { - baseSearchLink = "http://www.jeuxvideo.com/recherche/forums/" + newLinkForSearch.substring(newLinkForSearch.lastIndexOf("/") + 1); + baseSearchLink = "https://www.jeuxvideo.com/recherche/forums/" + newLinkForSearch.substring(newLinkForSearch.lastIndexOf("/") + 1); } } shouldOpenKeyboard = true; diff --git a/app/src/main/java/com/franckrj/respawnirc/jvcforum/SendTopicToForumActivity.java b/app/src/main/java/com/franckrj/respawnirc/jvcforum/SendTopicToForumActivity.java index 3cb36af..a13e4ea 100644 --- a/app/src/main/java/com/franckrj/respawnirc/jvcforum/SendTopicToForumActivity.java +++ b/app/src/main/java/com/franckrj/respawnirc/jvcforum/SendTopicToForumActivity.java @@ -84,9 +84,9 @@ public class SendTopicToForumActivity extends AbsHomeIsBackActivity implements I reqResult = reqResult.substring(("respawnirc:move:").length()); if (reqResult.startsWith("/forums/")) { - reqResult = "http://www.jeuxvideo.com" + reqResult; - } else if (!reqResult.startsWith("http:")) { - reqResult = "http:" + reqResult; + reqResult = "https://www.jeuxvideo.com" + reqResult; + } else if (!reqResult.startsWith("https:")) { + reqResult = "https:" + reqResult; } data.putExtra(RESULT_EXTRA_TOPIC_LINK_TO_MOVE, reqResult); diff --git a/app/src/main/java/com/franckrj/respawnirc/jvcforum/ShowForumInfosActivity.java b/app/src/main/java/com/franckrj/respawnirc/jvcforum/ShowForumInfosActivity.java index ccfc15c..94abe08 100644 --- a/app/src/main/java/com/franckrj/respawnirc/jvcforum/ShowForumInfosActivity.java +++ b/app/src/main/java/com/franckrj/respawnirc/jvcforum/ShowForumInfosActivity.java @@ -74,7 +74,7 @@ public class ShowForumInfosActivity extends AbsHomeIsBackActivity { private final View.OnClickListener contactModeratorsButtonClickedListener = view -> { if (infosForForum != null && !infosForForum.listOfModeratorsString.isEmpty()) { - Utils.openLinkInInternalBrowser("http://www.jeuxvideo.com/messages-prives/nouveau.php?all_dest=" + infosForForum.listOfModeratorsString.replace(", ", ";"), ShowForumInfosActivity.this); + Utils.openLinkInInternalBrowser("https://www.jeuxvideo.com/messages-prives/nouveau.php?all_dest=" + infosForForum.listOfModeratorsString.replace(", ", ";"), ShowForumInfosActivity.this); } else { Toast.makeText(ShowForumInfosActivity.this, R.string.errorDuringContactModerators, Toast.LENGTH_SHORT).show(); } @@ -86,7 +86,7 @@ public class ShowForumInfosActivity extends AbsHomeIsBackActivity { String forumLink = getIntent().getStringExtra(EXTRA_FORUM_LINK); linkTypeForInternalBrowser.setTypeFromString(PrefsManager.getString(PrefsManager.StringPref.Names.LINK_TYPE_FOR_INTERNAL_BROWSER)); - Utils.openCorrespondingBrowser(linkTypeForInternalBrowser, "http://www.jeuxvideo.com/forums/" + JVCParser.getForumNameOfThisForum(forumLink) + "/regles-forum/" + JVCParser.getForumIdOfThisForum(forumLink), ShowForumInfosActivity.this); + Utils.openCorrespondingBrowser(linkTypeForInternalBrowser, "https://www.jeuxvideo.com/forums/" + JVCParser.getForumNameOfThisForum(forumLink) + "/regles-forum/" + JVCParser.getForumIdOfThisForum(forumLink), ShowForumInfosActivity.this); } else { Toast.makeText(ShowForumInfosActivity.this, R.string.errorDuringShowRules, Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/java/com/franckrj/respawnirc/jvcforumlist/SelectForumInListActivity.java b/app/src/main/java/com/franckrj/respawnirc/jvcforumlist/SelectForumInListActivity.java index abf6a8e..d2c0e56 100644 --- a/app/src/main/java/com/franckrj/respawnirc/jvcforumlist/SelectForumInListActivity.java +++ b/app/src/main/java/com/franckrj/respawnirc/jvcforumlist/SelectForumInListActivity.java @@ -97,7 +97,7 @@ public class SelectForumInListActivity extends AbsNavigationViewActivity impleme if (reqResult.startsWith("respawnirc:redirect:")) { String newLink = reqResult.substring(("respawnirc:redirect:").length()); if (!newLink.isEmpty()) { - readNewTopicOrForum("http://www.jeuxvideo.com" + newLink, false); + readNewTopicOrForum("https://www.jeuxvideo.com" + newLink, false); return; } } else { @@ -384,9 +384,9 @@ protected String doInBackground(String... params) { String pageResult; WebManager.WebInfos currentWebInfos = initWebInfos(params[1], false); - pageResult = WebManager.sendRequest("http://www.jeuxvideo.com/forums/recherche.php", "GET", "q=" + Utils.encodeStringToUrlString(params[0]), currentWebInfos); + pageResult = WebManager.sendRequest("https://www.jeuxvideo.com/forums/recherche.php", "GET", "q=" + Utils.encodeStringToUrlString(params[0]), currentWebInfos); - if (!currentWebInfos.currentUrl.isEmpty() && !currentWebInfos.currentUrl.startsWith("http://www.jeuxvideo.com/forums/recherche.php")) { + if (!currentWebInfos.currentUrl.isEmpty() && !currentWebInfos.currentUrl.startsWith("https://www.jeuxvideo.com/forums/recherche.php")) { return "respawnirc:redirect:" + currentWebInfos.currentUrl; } else { return pageResult; diff --git a/app/src/main/java/com/franckrj/respawnirc/jvctopic/JVCActionsInTopic.java b/app/src/main/java/com/franckrj/respawnirc/jvctopic/JVCActionsInTopic.java index b11f9b5..de0b9ce 100644 --- a/app/src/main/java/com/franckrj/respawnirc/jvctopic/JVCActionsInTopic.java +++ b/app/src/main/java/com/franckrj/respawnirc/jvctopic/JVCActionsInTopic.java @@ -283,7 +283,7 @@ protected String doInBackground(String... params) { WebManager.WebInfos currentWebInfos = initWebInfos(params[2], false); String pageContent; - pageContent = WebManager.sendRequestWithMultipleTrys("http://www.jeuxvideo.com/forums/ajax_citation.php", "POST", "id_message=" + params[0] + "&" + params[1], currentWebInfos, 2); + pageContent = WebManager.sendRequestWithMultipleTrys("https://www.jeuxvideo.com/forums/ajax_citation.php", "POST", "id_message=" + params[0] + "&" + params[1], currentWebInfos, 2); if (pageContent != null) { return JVCParser.getMessageQuoted(pageContent); @@ -305,7 +305,7 @@ protected String doInBackground(String... params) { if (params.length > 2) { String typeOfAction = (itsADelete ? "delete" : "restore"); WebManager.WebInfos currentWebInfos = initWebInfos(params[2], false); - return WebManager.sendRequest("http://www.jeuxvideo.com/forums/modal_del_message.php", "POST", "tab_message[]=" + params[0] + "&type=" + typeOfAction + "&" + params[1], currentWebInfos); + return WebManager.sendRequest("https://www.jeuxvideo.com/forums/modal_del_message.php", "POST", "tab_message[]=" + params[0] + "&type=" + typeOfAction + "&" + params[1], currentWebInfos); } return null; } @@ -316,7 +316,7 @@ private static class UnlockJVCTopic extends AbsWebRequestAsyncTask 3) { WebManager.WebInfos currentWebInfos = initWebInfos(params[3], false); - return WebManager.sendRequest("http://www.jeuxvideo.com/forums/modal_moderation_topic.php", "GET", "id_forum=" + params[0] + "&tab_topic[]=" + params[1] + "&type=unlock&action=get&" + params[2], currentWebInfos); + return WebManager.sendRequest("https://www.jeuxvideo.com/forums/modal_moderation_topic.php", "GET", "id_forum=" + params[0] + "&tab_topic[]=" + params[1] + "&type=unlock&action=get&" + params[2], currentWebInfos); } return "erreurlol"; } @@ -334,7 +334,7 @@ protected String doInBackground(String... params) { if (params.length > 3) { String typeOfAction = (itsAPin ? "epingle" : "desepingle"); WebManager.WebInfos currentWebInfos = initWebInfos(params[3], false); - return WebManager.sendRequest("http://www.jeuxvideo.com/forums/modal_moderation_topic.php", "POST", "id_forum=" + params[0] + "&tab_topic[]=" + params[1] + "&type=" + typeOfAction + "&" + params[2], currentWebInfos); + return WebManager.sendRequest("https://www.jeuxvideo.com/forums/modal_moderation_topic.php", "POST", "id_forum=" + params[0] + "&tab_topic[]=" + params[1] + "&type=" + typeOfAction + "&" + params[2], currentWebInfos); } return "erreurlol"; } @@ -351,7 +351,7 @@ public DekickJVCPseudo(String newPseudoToDekick) { protected String doInBackground(String... params) { if (params.length > 3) { WebManager.WebInfos currentWebInfos = initWebInfos(params[3], false); - return WebManager.sendRequest("http://www.jeuxvideo.com/forums/ajax_unkick.php", "POST", "id_forum=" + params[0] + "&id_alias_a_unkick=" + params[1] + "&" + params[2], currentWebInfos); + return WebManager.sendRequest("https://www.jeuxvideo.com/forums/ajax_unkick.php", "POST", "id_forum=" + params[0] + "&id_alias_a_unkick=" + params[1] + "&" + params[2], currentWebInfos); } return "erreurlol"; } diff --git a/app/src/main/java/com/franckrj/respawnirc/jvctopic/JVCMessageToTopicSender.java b/app/src/main/java/com/franckrj/respawnirc/jvctopic/JVCMessageToTopicSender.java index 572c98c..a5961bd 100644 --- a/app/src/main/java/com/franckrj/respawnirc/jvctopic/JVCMessageToTopicSender.java +++ b/app/src/main/java/com/franckrj/respawnirc/jvctopic/JVCMessageToTopicSender.java @@ -130,7 +130,7 @@ public void saveToBundle(Bundle savedInstanceState) { } public void sendEditMessage(String messageEditedToSend, String cookieListInAString) { - sendThisMessage(messageEditedToSend, "http://www.jeuxvideo.com/forums/ajax_edit_message.php", lastInfosForEdit, cookieListInAString); + sendThisMessage(messageEditedToSend, "https://www.jeuxvideo.com/forums/ajax_edit_message.php", lastInfosForEdit, cookieListInAString); } public void stopAllCurrentTask() { @@ -194,7 +194,7 @@ private static class GetEditJVCMessageInfos extends AbsWebRequestAsyncTask 2) { WebManager.WebInfos currentWebInfos = initWebInfos(params[2], false); - return WebManager.sendRequest("http://www.jeuxvideo.com/forums/ajax_edit_message.php", "GET", "id_message=" + params[0] + "&" + params[1] + "&action=get", currentWebInfos); + return WebManager.sendRequest("https://www.jeuxvideo.com/forums/ajax_edit_message.php", "GET", "id_message=" + params[0] + "&" + params[1] + "&action=get", currentWebInfos); } else { return null; } diff --git a/app/src/main/java/com/franckrj/respawnirc/jvctopic/KickPseudoActivity.java b/app/src/main/java/com/franckrj/respawnirc/jvctopic/KickPseudoActivity.java index 3a6e241..79a4d80 100644 --- a/app/src/main/java/com/franckrj/respawnirc/jvctopic/KickPseudoActivity.java +++ b/app/src/main/java/com/franckrj/respawnirc/jvctopic/KickPseudoActivity.java @@ -155,7 +155,7 @@ private static class ApplyKickToPseudo extends AbsWebRequestAsyncTask 2) { WebManager.WebInfos currentWebInfos = initWebInfos(params[2], false); - return WebManager.sendRequest("http://www.jeuxvideo.com/forums/ajax_topic_sondage_view_response.php", "GET", "id_topic=" + params[0] + "&action=view_vote&" + params[1], currentWebInfos); + return WebManager.sendRequest("https://www.jeuxvideo.com/forums/ajax_topic_sondage_view_response.php", "GET", "id_topic=" + params[0] + "&action=view_vote&" + params[1], currentWebInfos); } return null; } @@ -354,7 +354,7 @@ private static class SendVoteToSurvey extends AbsWebRequestAsyncTask 3) { WebManager.WebInfos currentWebInfos = initWebInfos(params[3], false); - return WebManager.sendRequest("http://www.jeuxvideo.com/forums/ajax_topic_sondage_vote.php", "GET", "id_topic=" + params[0] + "&" + params[1] + "&" + params[2], currentWebInfos); + return WebManager.sendRequest("https://www.jeuxvideo.com/forums/ajax_topic_sondage_vote.php", "GET", "id_topic=" + params[0] + "&" + params[1] + "&" + params[2], currentWebInfos); } return null; } diff --git a/app/src/main/java/com/franckrj/respawnirc/utils/AddOrRemoveThingToFavs.java b/app/src/main/java/com/franckrj/respawnirc/utils/AddOrRemoveThingToFavs.java index af11139..f8bb8f6 100644 --- a/app/src/main/java/com/franckrj/respawnirc/utils/AddOrRemoveThingToFavs.java +++ b/app/src/main/java/com/franckrj/respawnirc/utils/AddOrRemoveThingToFavs.java @@ -66,7 +66,7 @@ protected String doInBackground(String... params) { actionToDo = "delete"; } - pageContent = WebManager.sendRequest("http://www.jeuxvideo.com/forums/ajax_forum_prefere.php", "POST", "id_forum=" + forumId + "&id_topic=" + topicId + "&action=" + actionToDo + "&type=" + typeOfAction + "&" + ajaxInfos, currentWebInfos); + pageContent = WebManager.sendRequest("https://www.jeuxvideo.com/forums/ajax_forum_prefere.php", "POST", "id_forum=" + forumId + "&id_topic=" + topicId + "&action=" + actionToDo + "&type=" + typeOfAction + "&" + ajaxInfos, currentWebInfos); if (!Utils.stringIsEmptyOrNull(pageContent)) { return JVCParser.getErrorMessageInJsonMode(pageContent); diff --git a/app/src/main/java/com/franckrj/respawnirc/utils/AddOrRemoveTopicToSubs.java b/app/src/main/java/com/franckrj/respawnirc/utils/AddOrRemoveTopicToSubs.java index 73163f5..641c23b 100644 --- a/app/src/main/java/com/franckrj/respawnirc/utils/AddOrRemoveTopicToSubs.java +++ b/app/src/main/java/com/franckrj/respawnirc/utils/AddOrRemoveTopicToSubs.java @@ -41,10 +41,10 @@ protected String doInBackground(String... params) { WebManager.WebInfos currentWebInfos = initWebInfos(params[3], false); if (addToSubs) { - linkToUse = "http://www.jeuxvideo.com/abonnements/ajax/ajax_abo_insert.php"; + linkToUse = "https://www.jeuxvideo.com/abonnements/ajax/ajax_abo_insert.php"; paramsForReq = "type=topic&ids_liste=" + params[0] + "&" + params[2]; } else { - linkToUse = "http://www.jeuxvideo.com/abonnements/ajax/ajax_abo_delete.php"; + linkToUse = "https://www.jeuxvideo.com/abonnements/ajax/ajax_abo_delete.php"; paramsForReq = "id=" + params[1] + "&" + params[2]; } diff --git a/app/src/main/java/com/franckrj/respawnirc/utils/JVCParser.java b/app/src/main/java/com/franckrj/respawnirc/utils/JVCParser.java index d5a4f8b..f290480 100644 --- a/app/src/main/java/com/franckrj/respawnirc/utils/JVCParser.java +++ b/app/src/main/java/com/franckrj/respawnirc/utils/JVCParser.java @@ -26,7 +26,7 @@ public final class JVCParser { private static final Pattern entireMessageInPermalinkPattern = Pattern.compile("(
", Pattern.DOTALL); private static final Pattern topicLinkInPermalinkPattern = Pattern.compile(")", Pattern.DOTALL); - private static final Pattern pageTopicLinkNumberPattern = Pattern.compile("^(http://www\\.jeuxvideo\\.com/forums/(?:1|42)-([0-9]*)-([0-9]*)-)([0-9]*)(-[0-9]*-[0-9]*-[0-9]*-[^./]*\\.htm)[#?]?"); - private static final Pattern pageForumLinkNumberPattern = Pattern.compile("^(http://www\\.jeuxvideo\\.com/forums/0-([0-9]*)-[0-9]*-[0-9]*-[0-9]*-)([0-9]*)(-[0-9]*-([^./]*)\\.htm)[#?]?"); - private static final Pattern pageSearchTopicLinkNumberPattern = Pattern.compile("^(http://www\\.jeuxvideo\\.com/recherche/forums/(0-[0-9]*-[0-9]*-[0-9]*-[0-9]*-))([0-9]*)(-[0-9]*-[^./]*\\.htm)([#?]?.*)"); + private static final Pattern pageTopicLinkNumberPattern = Pattern.compile("^(https?://www\\.jeuxvideo\\.com/forums/(?:1|42)-([0-9]*)-([0-9]*)-)([0-9]*)(-[0-9]*-[0-9]*-[0-9]*-[^./]*\\.htm)[#?]?"); + private static final Pattern pageForumLinkNumberPattern = Pattern.compile("^(https?://www\\.jeuxvideo\\.com/forums/0-([0-9]*)-[0-9]*-[0-9]*-[0-9]*-)([0-9]*)(-[0-9]*-([^./]*)\\.htm)[#?]?"); + private static final Pattern pageSearchTopicLinkNumberPattern = Pattern.compile("^(https?://www\\.jeuxvideo\\.com/recherche/forums/(0-[0-9]*-[0-9]*-[0-9]*-[0-9]*-))([0-9]*)(-[0-9]*-[^./]*\\.htm)([#?]?.*)"); private static final Pattern messageAnchorInTopicLinkPattern = Pattern.compile("#post_([0-9]*)"); private static final Pattern jvCarePattern = Pattern.compile("([^<]*)"); private static final Pattern lastEditMessagePattern = Pattern.compile("
[^M]*(Message édité le ([^ ]* [^ ]* [^ ]* [^ ]* [0-9:]*) par.*?)
", Pattern.DOTALL); @@ -125,23 +125,23 @@ public static String getForumForTopicLink(String topicLink) { Matcher pageTopicLinkNumberMatcher = pageTopicLinkNumberPattern.matcher(topicLink); if (pageTopicLinkNumberMatcher.find()) { - return "http://www.jeuxvideo.com/forums/0-" + pageTopicLinkNumberMatcher.group(2) + "-0-1-0-1-0-respawn-irc.htm"; + return "https://www.jeuxvideo.com/forums/0-" + pageTopicLinkNumberMatcher.group(2) + "-0-1-0-1-0-respawn-irc.htm"; } else { return ""; } } public static String formatThisUrlToClassicJvcUrl(String urlToChange) { - if (urlToChange.startsWith("https://")) { - urlToChange = "http://" + urlToChange.substring(("https://").length()); - } else if (!urlToChange.startsWith("http://")) { - urlToChange = "http://" + urlToChange; + if (urlToChange.startsWith("http://")) { + urlToChange = "https://" + urlToChange.substring(("http://").length()); + } else if (!urlToChange.startsWith("https://")) { + urlToChange = "https://" + urlToChange; } - if (urlToChange.startsWith("http://m.jeuxvideo.com/")) { - urlToChange = "http://www.jeuxvideo.com/" + urlToChange.substring(("http://m.jeuxvideo.com/").length()); - } else if (urlToChange.startsWith("http://jeuxvideo.com/")) { - urlToChange = "http://www.jeuxvideo.com/" + urlToChange.substring(("http://jeuxvideo.com/").length()); + if (urlToChange.startsWith("https://m.jeuxvideo.com/")) { + urlToChange = "https://www.jeuxvideo.com/" + urlToChange.substring(("https://m.jeuxvideo.com/").length()); + } else if (urlToChange.startsWith("https://jeuxvideo.com/")) { + urlToChange = "https://www.jeuxvideo.com/" + urlToChange.substring(("https://jeuxvideo.com/").length()); } return urlToChange; @@ -227,21 +227,21 @@ public static boolean checkIfForumAreSame(String firstForumLink, String secondFo } public static boolean checkIfItsForumFormatedLink(String linkToCheck) { - return linkToCheck.startsWith("http://www.jeuxvideo.com/forums/0-"); + return linkToCheck.startsWith("https://www.jeuxvideo.com/forums/0-"); } public static boolean checkIfItsTopicFormatedLink(String linkToCheck) { - return linkToCheck.startsWith("http://www.jeuxvideo.com/forums/1-") || - linkToCheck.startsWith("http://www.jeuxvideo.com/forums/42-"); + return linkToCheck.startsWith("https://www.jeuxvideo.com/forums/1-") || + linkToCheck.startsWith("https://www.jeuxvideo.com/forums/42-"); } public static boolean checkIfItsSearchFormatedLink(String linkToCheck) { - return linkToCheck.startsWith("http://www.jeuxvideo.com/recherche/forums/0-"); + return linkToCheck.startsWith("https://www.jeuxvideo.com/recherche/forums/0-"); } public static boolean checkIfItsMessageFormatedLink(String linkToCheck) { - if (linkToCheck.startsWith("http://www.jeuxvideo.com/")) { - String partOfLinkToCheck = linkToCheck.substring(("http://www.jeuxvideo.com/").length()); + if (linkToCheck.startsWith("https://www.jeuxvideo.com/")) { + String partOfLinkToCheck = linkToCheck.substring(("https://www.jeuxvideo.com/").length()); if (partOfLinkToCheck.contains("/")) { partOfLinkToCheck = partOfLinkToCheck.substring(partOfLinkToCheck.indexOf('/')); @@ -512,7 +512,7 @@ public static ArrayList getListOfForumsInSearchPage(String pageSour newNameAndLink.name = forumInSearchPageMatcher.group(2).replace("", "").replace("", ""); if (!forumInSearchPageMatcher.group(1).isEmpty()) { - newNameAndLink.link = "http://www.jeuxvideo.com" + forumInSearchPageMatcher.group(1); + newNameAndLink.link = "https://www.jeuxvideo.com" + forumInSearchPageMatcher.group(1); } listOfForums.add(newNameAndLink); @@ -535,7 +535,7 @@ public static ArrayList getListOfSubforumsInForumPage(String pageSo newNameAndLink.name = subforumInListMatcher.group(2).trim(); if (!subforumInListMatcher.group(1).isEmpty()) { - newNameAndLink.link = "http://www.jeuxvideo.com" + subforumInListMatcher.group(1); + newNameAndLink.link = "https://www.jeuxvideo.com" + subforumInListMatcher.group(1); } listOfSubforums.add(newNameAndLink); @@ -559,7 +559,7 @@ public static ArrayList getListOfNoMissTopicsInForumPage(String pag newNameAndLink.name = noMissTopicInListMatcher.group(2).trim(); if (!noMissTopicInListMatcher.group(1).isEmpty()) { - newNameAndLink.link = "http://www.jeuxvideo.com" + noMissTopicInListMatcher.group(1); + newNameAndLink.link = "https://www.jeuxvideo.com" + noMissTopicInListMatcher.group(1); } listOfNoMissTopics.add(newNameAndLink); @@ -601,9 +601,9 @@ public static ArrayList getListOfFavInBloc(String pageSource) { newFav.name = specialCharToNormalChar(favMatcher.group(2)); if (tmpLink.startsWith("/forums/")) { - newFav.link = "http://www.jeuxvideo.com" + tmpLink; - } else if (!tmpLink.startsWith("http:")) { - newFav.link = "http:" + tmpLink; + newFav.link = "https://www.jeuxvideo.com" + tmpLink; + } else if (!tmpLink.startsWith("https:")) { + newFav.link = "https:" + tmpLink; } else { newFav.link = tmpLink; } @@ -665,7 +665,7 @@ public static NameAndLink getMainForumNameAndLinkInForumPage(String pageSource) mainForum.name = specialCharToNormalChar(mainForum.name.trim()); if (!mainForum.link.isEmpty()) { - mainForum.link = "http://www.jeuxvideo.com" + mainForum.link; + mainForum.link = "https://www.jeuxvideo.com" + mainForum.link; } } @@ -1010,7 +1010,7 @@ public static String getLastPageOfTopic(String pageSource) { while (pageLinkMatcher.find()) { if (Integer.parseInt(pageLinkMatcher.group(2)) > currentPageNumber) { currentPageNumber = Integer.parseInt(pageLinkMatcher.group(2)); - lastPage = "http://www.jeuxvideo.com" + pageLinkMatcher.group(1); + lastPage = "https://www.jeuxvideo.com" + pageLinkMatcher.group(1); } } @@ -1028,7 +1028,7 @@ public static String getNextPageOfTopic(String pageSource) { while (pageLinkMatcher.find()) { if (Integer.parseInt(pageLinkMatcher.group(2)) == (currentPageNumber + 1)) { - return "http://www.jeuxvideo.com" + pageLinkMatcher.group(1); + return "https://www.jeuxvideo.com" + pageLinkMatcher.group(1); } } @@ -1115,7 +1115,7 @@ public static String parseMessageToPrettyMessage(String messageInString, Setting ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, smileyPattern, 2, "", null, null); ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, embedVideoPattern, 1, "

", "

", makeLinkDependingOnSettingsAndForceMake, null); - ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcVideoPattern, 1, "

", "

", new AddPrefixString("http://www.jeuxvideo.com/videos/iframe/"), makeLinkDependingOnSettingsAndForceMake); + ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcVideoPattern, 1, "

", "

", new AddPrefixString("https://www.jeuxvideo.com/videos/iframe/"), makeLinkDependingOnSettingsAndForceMake); ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, shortJvcLinkPattern, 1, "", "", makeLinkDependingOnSettingsAndForceMake, null); ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, longJvcLinkPattern, 1, "", "", makeLinkDependingOnSettingsAndForceMake, null); ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, shortLinkPattern, 1, "", "", makeLinkDependingOnSettingsAndForceMake, null); @@ -1171,7 +1171,7 @@ public static String parseMessageToSimpleMessage(String messageInString) { ToolForParsing.replaceStringByAnother(messageInBuilder, "\n", ""); ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, smileyPattern, 3, "", "", null, null); ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, embedVideoPattern, 1, "

", "

", null, null); - ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcVideoPattern, 1, "

http://www.jeuxvideo.com/videos/iframe/", "

", null, null); + ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcVideoPattern, 1, "

https://www.jeuxvideo.com/videos/iframe/", "

", null, null); ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, shortJvcLinkPattern, 1, "", "", null, null); ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, longJvcLinkPattern, 1, "", "", null, null); ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, shortLinkPattern, 1, "", "", null, null); @@ -1258,7 +1258,7 @@ public static MessageInfos createMessageInfoFromEntireMessage(String thisEntireM } if (avatarMatcher.find()) { - newMessageInfo.avatarLink = "http://" + avatarMatcher.group(2); + newMessageInfo.avatarLink = "https://" + avatarMatcher.group(2); } if (messageIdMatcher.find()) { @@ -1311,7 +1311,7 @@ public static TopicInfos createTopicInfoFromEntireTopic(String thisEntireTopic) if (topicNameAndLinkMatcher.find()) { String topicNameAndLinkString = topicNameAndLinkMatcher.group(1); - newTopicInfo.link = "http://www.jeuxvideo.com" + topicNameAndLinkString.substring(0, topicNameAndLinkString.indexOf("\"")); + newTopicInfo.link = "https://www.jeuxvideo.com" + topicNameAndLinkString.substring(0, topicNameAndLinkString.indexOf("\"")); newTopicInfo.htmlName = topicNameAndLinkString.substring(topicNameAndLinkString.indexOf("title=\"") + 7); } @@ -1341,7 +1341,7 @@ public static TopicInfos createTopicInfoFromEntireTopicMessageSearch(String this } if (topicNameAndLinkMatcher.find()) { - newTopicInfo.link = "http://www.jeuxvideo.com" + topicNameAndLinkMatcher.group(1); + newTopicInfo.link = "https://www.jeuxvideo.com" + topicNameAndLinkMatcher.group(1); newTopicInfo.htmlName = topicNameAndLinkMatcher.group(2).replace("\r", "").replace("\n", "").replace("em>", "u>").trim(); } @@ -1383,7 +1383,7 @@ public static String getTopicLinkFromPermalinkPage(String sourcePage) { Matcher topicLinkMatcher = topicLinkInPermalinkPattern.matcher(sourcePage); if (topicLinkMatcher.find()) { - return "http://www.jeuxvideo.com" + topicLinkMatcher.group(1); + return "https://www.jeuxvideo.com" + topicLinkMatcher.group(1); } return ""; diff --git a/app/src/main/java/com/franckrj/respawnirc/utils/Utils.java b/app/src/main/java/com/franckrj/respawnirc/utils/Utils.java index 619700e..408cdc2 100644 --- a/app/src/main/java/com/franckrj/respawnirc/utils/Utils.java +++ b/app/src/main/java/com/franckrj/respawnirc/utils/Utils.java @@ -123,6 +123,8 @@ public static String imageLinkToFileName(String link) { return "nlsk_xs/" + link.substring(("http://image.noelshack.com/fichiers-xs/").length()).replace("/", "_"); } else if (link.startsWith("http://image.noelshack.com/fichiers/")) { return "nlsk_big/" + link.substring(("http://image.noelshack.com/fichiers/").length()).replace("/", "_"); + } else if (link.startsWith("https://image.jeuxvideo.com/avatar")) { + return "vtr_sm/" + link.substring(("https://image.jeuxvideo.com/avatar").length()).replace("/", "_"); } else if (link.startsWith("http://image.jeuxvideo.com/avatar")) { return "vtr_sm/" + link.substring(("http://image.jeuxvideo.com/avatar").length()).replace("/", "_"); } else { @@ -132,12 +134,12 @@ public static String imageLinkToFileName(String link) { public static void setupCookiesForJvc(CookieManager cookieManager) { cookieManager.removeAllCookies(null); - cookieManager.setCookie(".www.jeuxvideo.com", "_cmpQcif3pcsupported=1"); - cookieManager.setCookie(".jeuxvideo.com", "_gcl_au=1.1.1298996599.1593456467"); - cookieManager.setCookie(".www.jeuxvideo.com", "euconsent=BO1ximpO1ximpAKAiCENDQAAAAAweAAA"); - cookieManager.setCookie(".www.jeuxvideo.com", "googlepersonalization=O1ximpO1ximpAA"); - cookieManager.setCookie(".www.jeuxvideo.com", "noniabvendorconsent=O1ximpO1ximpAKAiAA8AAA"); - cookieManager.setCookie(".www.jeuxvideo.com", "visitor_country=FR"); + cookieManager.setCookie("https://www.jeuxvideo.com", "_cmpQcif3pcsupported=1"); + cookieManager.setCookie("https://jeuxvideo.com", "_gcl_au=1.1.1298996599.1593456467"); + cookieManager.setCookie("https://www.jeuxvideo.com", "euconsent=BO1ximpO1ximpAKAiCENDQAAAAAweAAA"); + cookieManager.setCookie("https://www.jeuxvideo.com", "googlepersonalization=O1ximpO1ximpAA"); + cookieManager.setCookie("https://www.jeuxvideo.com", "noniabvendorconsent=O1ximpO1ximpAKAiAA8AAA"); + cookieManager.setCookie("https://www.jeuxvideo.com", "visitor_country=FR"); } public static void openCorrespondingBrowser(PrefsManager.LinkType linkTypeToOpenInternalBrowser, String link, Activity parentActivity) { From feaa20200ca02df6de285ef37111dd7ec8a269e2 Mon Sep 17 00:00:00 2001 From: Franck W Date: Mon, 29 Jun 2020 21:22:33 +0200 Subject: [PATCH 4/5] =?UTF-8?q?M=C3=A0j=20de=20l'user-agent.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/franckrj/respawnirc/utils/WebManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/franckrj/respawnirc/utils/WebManager.java b/app/src/main/java/com/franckrj/respawnirc/utils/WebManager.java index 24f18fd..3dca536 100644 --- a/app/src/main/java/com/franckrj/respawnirc/utils/WebManager.java +++ b/app/src/main/java/com/franckrj/respawnirc/utils/WebManager.java @@ -9,7 +9,7 @@ import java.util.concurrent.Callable; public class WebManager { - public static final String userAgentString = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0"; + public static final String userAgentString = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"; public static String sendRequestWithMultipleTrys(String linkToPage, String requestMethod, String requestParameters, WebInfos currentInfos, int maxNumberOfTrys) { int numberOfTrys = 0; From 31f75f0c37964ce900058b3c60c581987922d984 Mon Sep 17 00:00:00 2001 From: Franck W Date: Mon, 29 Jun 2020 21:28:01 +0200 Subject: [PATCH 5/5] =?UTF-8?q?Passage=20=C3=A0=20la=20version=202.1.2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6bacf96..3cb0ab5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.franckrj.respawnirc" minSdkVersion 21 targetSdkVersion 29 - versionCode 2_001_2_001 - versionName "2.1.1" + versionCode 2_001_2_002 + versionName "2.1.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" resConfigs "fr" }