Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckRJ committed Jun 29, 2020
2 parents e560200 + 31f75f0 commit 5b23e9c
Show file tree
Hide file tree
Showing 24 changed files with 135 additions and 94 deletions.
30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -22,8 +22,8 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
dataBinding {
enabled = true
buildFeatures {
dataBinding = true
}
buildTypes {
release {
Expand All @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,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;

Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected ArrayList<JVCParser.NameAndLink> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ 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 {
String newLinkForSearch = getIntent().getStringExtra(EXTRA_FORUM_LINK);

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand All @@ -316,7 +316,7 @@ private static class UnlockJVCTopic extends AbsWebRequestAsyncTask<String, Void,
protected String doInBackground(String... params) {
if (params.length > 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";
}
Expand All @@ -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";
}
Expand All @@ -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";
}
Expand Down
Loading

0 comments on commit 5b23e9c

Please sign in to comment.