Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckRJ committed Oct 6, 2022
2 parents 094f2fe + eb07f8d commit 300c1aa
Show file tree
Hide file tree
Showing 11 changed files with 188 additions and 189 deletions.
1 change: 0 additions & 1 deletion .idea/gradle.xml

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

48 changes: 23 additions & 25 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdkVersion 33
buildToolsVersion "33.0.0"
defaultConfig {
applicationId "com.franckrj.respawnirc"
minSdkVersion 21
targetSdkVersion 30
versionCode 2_001_2_007
versionName "2.1.7"
targetSdkVersion 33
versionCode 2_001_2_008
versionName "2.1.8"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "fr"
resConfigs 'fr'
}
compileOptions {
sourceCompatibility = '1.8'
Expand All @@ -35,36 +35,34 @@ android {
applicationIdSuffix ".dev"
}
}
namespace 'com.franckrj.respawnirc'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.activity:activity:1.2.3'
implementation 'androidx.activity:activity-ktx:1.2.3'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.appcompat:appcompat-resources:1.3.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.activity:activity-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.appcompat:appcompat-resources:1.5.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.core:core:1.5.0'
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
implementation 'androidx.emoji:emoji-appcompat:1.1.0'
implementation 'androidx.fragment:fragment:1.3.5'
implementation 'androidx.fragment:fragment-ktx:1.3.5'
implementation 'androidx.fragment:fragment-ktx:1.5.3'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.github.bumptech.glide:annotations:4.12.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.12.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'com.github.bumptech.glide:annotations:4.14.1'
implementation 'com.github.bumptech.glide:glide:4.14.1'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.14.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
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.4.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
kapt 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1'
kapt 'com.github.bumptech.glide:compiler:4.14.1'
}
8 changes: 4 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.franckrj.respawnirc">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand All @@ -17,12 +16,13 @@
android:icon="@mipmap/ic_rirc"
android:label="@string/app_name"
android:theme="@style/SplashTheme"
tools:targetApi="28">
tools:targetApi="33">

<activity
android:name=".MainActivity"
android:theme="@style/SplashTheme"
android:noHistory="true">
android:noHistory="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public Drawable getDrawable(String source) {
}

return drawable;
} else if (source.startsWith("http://image.noelshack.com/minis/") && downloaderForImage != null) {
} else if (source.startsWith("https://image.noelshack.com/minis/") && downloaderForImage != null) {
return downloaderForImage.getDrawableFromLink(source, true, false, false);
} else if (source.startsWith("http://image.noelshack.com/fichiers-xs/") && downloaderForImage != null) {
} else if (source.startsWith("https://image.noelshack.com/fichiers-xs/") && downloaderForImage != null) {
return downloaderForImage.getDrawableFromLink(source, true, true, true);
} else {
return deletedDrawable;
Expand Down
18 changes: 10 additions & 8 deletions app/src/main/java/com/franckrj/respawnirc/utils/JVCParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public final class JVCParser {
private static final Pattern ajaxSubHashPattern = Pattern.compile("<body *data-abo-session=\"([^\"]*)\">");
private static final Pattern messageQuotePattern = Pattern.compile("\"txt\":\"(.*)\"", Pattern.DOTALL);
private static final Pattern entireMessagePattern = Pattern.compile("(<div class=\"bloc-message-forum[^\"]*\".*?)(<span id=\"post_[^\"]*\" class=\"bloc-message-forum-anchor\">|<div class=\"bloc-outils-plus-modo bloc-outils-bottom[^\"]*\">|<div class=\"bloc-pagi-default[^\"]*\">)", Pattern.DOTALL);
private static final Pattern entireMessageInPermalinkPattern = Pattern.compile("(<div class=\"bloc-message-forum[^\"]*\".*?)<div class=\"bloc-return-topic\">", Pattern.DOTALL);
private static final Pattern topicLinkInPermalinkPattern = Pattern.compile("<div class=\"bloc-return-topic\">[^<]*<a href=\"([^\"]*)");
private static final Pattern entireMessageInPermalinkPattern = Pattern.compile("(<div class=\"bloc-message-forum[^\"]*\".*?)(<div class=\"bloc-return-topic[^\"]*\">)", Pattern.DOTALL);
private static final Pattern topicLinkInPermalinkPattern = Pattern.compile("(<div class=\"bloc-return-topic[^\"]*\">)[^<]*<a href=\"([^\"]*)");
private static final Pattern signaturePattern = Pattern.compile("<div class=\"signature-msg[^\"]*\">(.*)", Pattern.DOTALL);
private static final Pattern avatarPattern = Pattern.compile("<img src=\"[^\"]*\" data-src=\"(https?:)?//([^\"]*)\" class=\"user-avatar-msg js-lazy\"", Pattern.DOTALL);
private static final Pattern avatarPattern = Pattern.compile("<img src=\"[^\"]*\" data-src=\"(https?:)?//([^\"]*)\" class=\"user-avatar-msg js-lazy avatar\"", Pattern.DOTALL);
private static final Pattern entireTopicPattern = Pattern.compile("<li (class=\"[^\"]*\" data-id=\"[^\"]*\"|class=\"message[^\"]*\")>.*?<span class=\"topic-subject\">.*?</li>", Pattern.DOTALL);
private static final Pattern pseudoIsBlacklistedPattern = Pattern.compile("<div class=\"bloc-message-forum msg-pseudo-blacklist[^\"]*\" data-id=\"");
private static final Pattern messageIsDeletedPattern = Pattern.compile("<div class=\"bloc-message-forum msg-supprime[^\"]*\" data-id=\"");
private static final Pattern messageIsDeletedPattern = Pattern.compile("<div class=\"bloc-message-forum.*msg-supprime[^\"]*\" data-id=\"");
private static final Pattern userCanDeleteOrRestoreMessagePattern = Pattern.compile("<span class=\"picto-msg-(croix|restaurer)\" title=\"(Supprimer|Restaurer)\" data-type=\"(delete|restore)\">");
private static final Pattern userCanEditMessagePattern = Pattern.compile("<span class=\"picto-msg-crayon\" title=\"Editer\">");
private static final Pattern userCanKickOrDekickAuthorPattern = Pattern.compile("<span class=\"picto-msg-(kick|dekick)\" title=\"(Kicker|Dékicker)\" data-id-alias=\"[^\"]*\">");
Expand Down Expand Up @@ -140,6 +140,8 @@ public static String formatThisUrlToClassicJvcUrl(String urlToChange) {

if (urlToChange.startsWith("https://m.jeuxvideo.com/")) {
urlToChange = "https://www.jeuxvideo.com/" + urlToChange.substring(("https://m.jeuxvideo.com/").length());
} else if (urlToChange.startsWith("https://api.jeuxvideo.com/")) {
urlToChange = "https://www.jeuxvideo.com/" + urlToChange.substring(("https://api.jeuxvideo.com/").length());
} else if (urlToChange.startsWith("https://jeuxvideo.com/")) {
urlToChange = "https://www.jeuxvideo.com/" + urlToChange.substring(("https://jeuxvideo.com/").length());
}
Expand Down Expand Up @@ -174,7 +176,7 @@ public static String noelshackToDirectLink(String baseLink) {
}
}

return "http://image.noelshack.com/fichiers/" + baseLink;
return "https://image.noelshack.com/fichiers/" + baseLink;
}

public static boolean checkIfItsNoelshackLink(String linkToCheck) {
Expand Down Expand Up @@ -1383,7 +1385,7 @@ public static String getTopicLinkFromPermalinkPage(String sourcePage) {
Matcher topicLinkMatcher = topicLinkInPermalinkPattern.matcher(sourcePage);

if (topicLinkMatcher.find()) {
return "https://www.jeuxvideo.com" + topicLinkMatcher.group(1);
return "https://www.jeuxvideo.com" + topicLinkMatcher.group(2);
}

return "";
Expand Down Expand Up @@ -2081,9 +2083,9 @@ public String changeString(String baseString) {
String imageLink = noelshackToDirectLink(baseString);

if (useFichierXsForPng && imageLink.endsWith(".png")) {
imageLink = "http://image.noelshack.com/fichiers-xs/" + imageLink.substring(("http://image.noelshack.com/fichiers/").length());
imageLink = "https://image.noelshack.com/fichiers-xs/" + imageLink.substring(("https://image.noelshack.com/fichiers/").length());
} else {
imageLink = "http://image.noelshack.com/minis/" + imageLink.substring(("http://image.noelshack.com/fichiers/").length());
imageLink = "https://image.noelshack.com/minis/" + imageLink.substring(("https://image.noelshack.com/fichiers/").length());
imageLink = imageLink.substring(0, imageLink.lastIndexOf(".")) + ".png";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private InfoForConvert(String newBaseStickerId, String replacementString, boolea
stickerIdToReplace = newBaseStickerId;

if (itsAConvertToSmiley) {
replacement = "<img src=\"http://image.jeuxvideo.com/smileys_img/" + replacementString + "\" alt=\"\" data-code=\"\" title=\"\" />";
replacement = "<img src=\"https://image.jeuxvideo.com/smileys_img/" + replacementString + "\" alt=\"\" data-code=\"\" title=\"\" />";
} else {
replacement = "<img class=\"img-stickers\" src=\"" + replacementString + "\"/>";
}
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/com/franckrj/respawnirc/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ public static ArrayList<String> mapStringArrayList(List<String> baseList, String
}

public static String imageLinkToFileName(String link) {
if (link.startsWith("http://image.noelshack.com/minis/")) {
return "nlsk_mini/" + link.substring(("http://image.noelshack.com/minis/").length()).replace("/", "_");
} else if (link.startsWith("http://image.noelshack.com/fichiers-xs/")) {
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("/", "_");
if (link.startsWith("https://image.noelshack.com/minis/")) {
return "nlsk_mini/" + link.substring(("https://image.noelshack.com/minis/").length()).replace("/", "_");
} else if (link.startsWith("https://image.noelshack.com/fichiers-xs/")) {
return "nlsk_xs/" + link.substring(("https://image.noelshack.com/fichiers-xs/").length()).replace("/", "_");
} else if (link.startsWith("https://image.noelshack.com/fichiers/")) {
return "nlsk_big/" + link.substring(("https://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")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:91.0) Gecko/20100101 Firefox/91.0";
public static final String userAgentString = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0";

public static String sendRequestWithMultipleTrys(String linkToPage, String requestMethod, String requestParameters, WebInfos currentInfos, int maxNumberOfTrys) {
int numberOfTrys = 0;
Expand Down
Loading

0 comments on commit 300c1aa

Please sign in to comment.