Skip to content

Commit

Permalink
Update v4.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeRooo committed Apr 23, 2020
1 parent fcbe08c commit 8968534
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 28 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ _This app is based on Toffeed by JakeLane (https://github.com/JakeLane/Toffeed).
- Fixed language selector.
- Disabled swipe to refresh feature when keyboard is shown (#217).

**Version 4.0.3:**
- Fixed some black theme glitches.
- Fixed crashes on Android 10+.
- Notification fixes.
- Temporarily disabled copy & paste feature as it\'s causing crashes.

**Notes:**
_- Maybe some gifs cant be loaded because i need to add the url to the code. Report it as issue with the Facebook´s page link or website._

Expand Down
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "me.zeerooo.materialfb"
minSdkVersion 17
targetSdkVersion 29
versionCode 74
versionName "4.0.2"
versionCode 75
versionName "4.0.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down Expand Up @@ -43,15 +43,15 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation 'androidx.test:runner:1.3.0-alpha05'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha05'
androidTestImplementation 'androidx.test:runner:1.3.0-beta01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-beta01'
implementation 'androidx.appcompat:appcompat:1.2.0-beta01'
implementation "androidx.preference:preference:1.1.0"
implementation "androidx.preference:preference:1.1.1"
implementation 'com.google.android.material:material:1.2.0-alpha06'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "android.arch.work:work-runtime:1.0.1"
implementation 'ch.acra:acra-mail:5.5.0'
implementation 'ch.acra:acra:4.11'
testImplementation 'junit:junit:4.13'
}
6 changes: 2 additions & 4 deletions app/src/main/java/me/zeeroooo/materialfb/MFB.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
import android.content.Context;

import org.acra.ACRA;
import org.acra.annotation.AcraCore;
import org.acra.annotation.AcraMailSender;
import org.acra.annotation.ReportsCrashes;

/**
* Created by ZeeRooo on 15/04/18
*/

@AcraCore(buildConfigClass = BuildConfig.class)
@AcraMailSender(mailTo = "[email protected]")
@ReportsCrashes(mailTo = "[email protected]")
public class MFB extends Application {
public static int colorPrimary, colorPrimaryDark, colorAccent, textColor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.ColorUtils;
import androidx.preference.PreferenceManager;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Color;
Expand Down Expand Up @@ -65,6 +66,8 @@
import androidx.core.view.ViewCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;

import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.button.MaterialButton;
Expand All @@ -86,6 +89,7 @@
import me.zeeroooo.materialfb.misc.DatabaseHelper;
import me.zeeroooo.materialfb.misc.ModelBookmarks;
import me.zeeroooo.materialfb.misc.UserInfo;
import me.zeeroooo.materialfb.notifications.NotificationsService;
import me.zeeroooo.materialfb.ui.CookingAToast;
import me.zeeroooo.materialfb.ui.MFBFloatingActionButton;
import me.zeeroooo.materialfb.ui.MFBResources;
Expand Down Expand Up @@ -126,7 +130,7 @@ public class MainActivity extends MFBActivity implements NavigationView.OnNaviga
@Override
protected void create(Bundle savedInstanceState) {
super.create(savedInstanceState);

WorkManager.getInstance().enqueue(new OneTimeWorkRequest.Builder(NotificationsService.class).build());
((MFBResources) getResources()).setColors(sharedPreferences);

setContentView(R.layout.activity_main);
Expand Down Expand Up @@ -677,12 +681,8 @@ private void URLs() {
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
final DownloadManager.Request request = new DownloadManager.Request(Uri.parse(Url));
final File downloads_dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
if (!downloads_dir.exists())
if (!downloads_dir.mkdirs())
return;

final File destinationFile = new File(downloads_dir, Uri.parse(Url).getLastPathSegment());
final File destinationFile = new File(Environment.DIRECTORY_DOWNLOADS, Uri.parse(Url).getLastPathSegment());
request.setDestinationUri(Uri.fromFile(destinationFile));
request.setVisibleInDownloadsUi(true);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
import com.bumptech.glide.request.target.Target;
import com.bumptech.glide.request.transition.Transition;

import java.io.File;

import me.zeeroooo.materialfb.R;
import me.zeeroooo.materialfb.ui.CookingAToast;

Expand Down Expand Up @@ -318,7 +320,7 @@ else if (download) {
final DownloadManager mDownloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);

final DownloadManager.Request request = new DownloadManager.Request(Uri.parse(imageUrl));
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_PICTURES + "/MaterialFBook", System.currentTimeMillis() + ".jpg");
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_PICTURES, System.currentTimeMillis() + ".jpg");
request.setVisibleInDownloadsUi(true);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis

final DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));

request.setDestinationInExternalPublicDir(Environment.DIRECTORY_MOVIES + "/MaterialFBook", System.currentTimeMillis() + url.substring(url.indexOf("_n") + 2).split("\\?_")[0]);
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_MOVIES, System.currentTimeMillis() + url.substring(url.indexOf("_n") + 2).split("\\?_")[0]);
request.setVisibleInDownloadsUi(true);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.database.Cursor;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -20,6 +19,7 @@

import androidx.appcompat.app.AlertDialog;
import androidx.preference.Preference;
import androidx.preference.PreferenceManager;
import androidx.work.Constraints;
import androidx.work.NetworkType;
import androidx.work.PeriodicWorkRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.preference.PreferenceManager;
import android.webkit.CookieManager;

import androidx.annotation.NonNull;
import androidx.core.app.NotificationCompat;
import androidx.core.app.TaskStackBuilder;
import androidx.preference.PreferenceManager;
import androidx.work.Worker;
import androidx.work.WorkerParameters;

Expand Down Expand Up @@ -135,7 +135,7 @@ private void SyncMessages() throws Exception {
for (byte a = 0; a < results.size(); a++) {
previousMsgLength = stringBuilder.length();

stringBuilder.append(results.get(a).selectFirst("tbody > tr > td > div > h3.cd.ba.ce > span").text());
stringBuilder.append(results.get(a).selectFirst("tr > td > header h3 > span").text());

if (!blist.isEmpty())
for (int position = 0; position < blist.size(); position++) {
Expand All @@ -144,8 +144,8 @@ private void SyncMessages() throws Exception {
}

if (!msg_notAWhiteList) {
name = results.get(a).selectFirst("tbody > tr > td > div > h3.bz.ca.cb > a").text();
pictureMsg = "https://graph.facebook.com/" + results.get(a).select("tbody > tr > td > div > h3.bz.ca.cb > a").attr("href").split("%3A")[1].split("&")[0] + "/picture?type=large";
name = results.get(a).selectFirst("tr > td > header h3 > a").text();
pictureMsg = "https://graph.facebook.com/" + results.get(a).select("tr > td > header h3 > a").attr("href").split("cid.c.")[1].split("&")[0].replace(Helpers.getCookie(), "").replace("%3A", "") + "/picture?type=large";

if (!mPreferences.getString("last_message", "").contains(stringBuilder.substring(previousMsgLength)))
notifier(stringBuilder.substring(previousMsgLength), name, baseURL + "messages", pictureMsg, (int) System.currentTimeMillis(), true);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/me/zeeroooo/materialfb/webview/Helpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ public static String cssThemeEngine(byte themeMode) {
stringBuilder.append("._4e81, ._4kk6, .blueName, ._2a_i._2a_i a, ._5pxa ._5pxc a, .fcb, ._67i4 ._5jjz ._5c9u, ._vqv .read, ._vqv, ._3bg5 ._52x2, ._6x2x, ._6xqt, .touch ._5lm6, ._1e8b, ._52jb, #u_0_d, #u_0_4l, #u_0_36 { color: #").append(Integer.toHexString(sensitiveColor).substring(2)).append(" !important; }.touch ._x0b { border-bottom: 2px solid #").append(Integer.toHexString(MFB.colorPrimaryDark).substring(2)).append("; color: #").append(Integer.toHexString(MFB.colorPrimaryDark).substring(2)).append("; }.touch ._4_d0 ._4_d1 ._55cx, ._u42 ._55fj, ._6j_d { background: #").append(Integer.toHexString(MFB.colorPrimary).substring(2)).append(" !important;text-shadow: 0 0px; }._7gxn ._59tg, ._8hp4, ._26vk._56bu, .touch ._26vk._56bv, ._36bl ._2x1r, ._36bl ._2thz { background-color: #").append(Integer.toHexString(MFB.colorPrimary).substring(2)).append(" !important; } ._52z5._7gxn { height: 89px; border-bottom: 0px; border-top: 0px; background: #").append(Integer.toHexString(MFB.colorPrimary).substring(2)).append("; }._129- { border-top: 0px; }._7izv ._7i-0 { border-bottom: 1px solid #").append(Integer.toHexString(MFB.colorAccent).substring(2)).append("; }._15kl._15kl ._77li, ._15kj._15kj a, .touch a.sub, ._2eo-._4b44, .touch ._78xz, .touch ._5qc4._5qc4 a, .touch ._5qc4._5qc4._5qc4 a, ._4gux, ._6dsj ._3gin, ._7izv ._7iz_, ._52j9, ._4_d0 ._4_d1, .fcl, .fcg, ._x0a, ._86nv, ._20u1, .touch .mfsm, ._52ja, ._7-1j, ._5tg_, ._5qc3._5qc3 a, ._7msl { color: #").append(Integer.toHexString(MFB.colorAccent).substring(2)).append(" !important; }.aclb, ._67iu, ._2ykg .unreadMessage, ._2b06 { background-color: #").append(Integer.toHexString(MFB.colorPrimary).substring(2)).append("40 !important; }._86nt._8n4c, ._7cui { background-color: #").append(Integer.toHexString(MFB.colorPrimaryDark).substring(2)).append("40; color: #").append(Integer.toHexString(MFB.colorPrimaryDark).substring(2)).append("}._34em ._34ee { background-color: #").append(Integer.toHexString(MFB.colorPrimary).substring(2)).append(" !important; color: #fff; }._34ee { background-color: transparent !important; border: 1px solid #").append(Integer.toHexString(MFB.colorPrimary).substring(2)).append("; } .touch .btn.iconOnly, .touch .btnC, .touch .btnI.bgb { background: #").append(Integer.toHexString(MFB.colorPrimaryDark).substring(2)).append("; border: 0px; }.acw { border: 0; }.touch ._5c9u, .touch ._5ca9, .touch button._5c9u { text-shadow: 0 0px; }._u42 ._5i9c { border-radius: 50%; }._1e8h { border-top: 0px; }.ib .l { border-radius: 50%; }");

if (themeMode == 1 || themeMode == 2)
stringBuilder.append("._55wo, ._2am8, ._vi6 ._42rg, ._7gxp, ._67i4 ._67iv #messages_search_box .quicksearch, .touch ._1oby ._5c9u, ._10c_, ._77xj, ._6vzz, #timelineBody, ._3-8x, ._3f50>._5rgr, ._45kb>div, ._5-lw, ._13fn, ._hdn._hdn, #u_0_35, #u_0_4k, #u_1_1i, #u_1_0, #u_0_4m, #u_0_5i, #u_0_44, #u_0_37, .touch ._6-l .composerInput, ._13-f, form { background: #1e1e1e !important; }._2v9s, #root, ._59e9, ._vqv, .touch ._4_d0, ._3ioy._3ioy ._uww, ._403n, ._13e_, .groupChromeView.feedRevamp, ._4_xl, ._-j8, ._-j9, ._6o5v, #u_0_2, ._484w, ._-j7, .acw, ._21db { background: #121212 !important; }._6beq, ._5pz4, ._5lp4, ._5lp5, .touch ._1f9d, .touch ._3tap, ._36dc { background: #1e1e1e !important; border-bottom: 0px; border-top: 0px; }._44qk { border-bottom: 0px; }._34ee, textarea, input, ._u42 ._52x7, ._5rgt p, ._5t8z p, .ib .c, ._52jc, .touch ._5b6o ._5b6q, ._21dc, ._2b06 { color: #aaaaaa !important; }.touch ._52t1, ._uww, ._5-lx, .touch ._26vk._56bt[disabled] { border: 1px solid #1e1e1e !important; background: #121212; }._3bg5 ._52x6 { border-top-color: #2b324600 !important; background: #1e1e1e !important; }._3bg5 ._52x1, ._z-w { background: #121212 !important; border-bottom: 0px; border-top: 0px; }._4gus, ._67i4 ._67iu ._3z10, h1, h2, h3, h4, h5, h6, ._52jj { color: white; } .touch ._55so._59f6::before, .touch.wp.x1-5 ._55so._59f6::before, .touch.wp.x2 ._55so._59f6::before, .touch ._59f6 ._55st ._5c9u { background: #1e1e1e !important; text-shadow: 0 0px; } ._a58 _9_7 _2rgt _1j-f _2rgt { background-color: #121212 !important; }"); // ._7om2, lele
stringBuilder.append("._55wo, ._2am8, ._vi6 ._42rg, ._7gxp, ._67i4 ._67iv #messages_search_box .quicksearch, .touch ._1oby ._5c9u, ._10c_, ._77xj, ._6vzz, #timelineBody, ._3-8x, ._3f50>._5rgr, ._45kb>div, ._5-lw, ._13fn, ._hdn._hdn, #u_0_35, #u_0_4k, #u_1_1i, #u_1_0, #u_0_4m, #u_0_5i, #u_0_44, #u_0_37, .touch ._6-l .composerInput, ._13-f, form { background: #1e1e1e !important; }._2v9s, #root, ._59e9, ._vqv, .touch ._4_d0, ._3ioy._3ioy ._uww, ._403n, ._13e_, .groupChromeView.feedRevamp, ._4_xl, ._-j8, ._-j9, ._6o5v, #u_0_2, ._484w, ._-j7, .acw, ._21db { background: #121212 !important; }._6beq, ._5pz4, ._5lp4, ._5lp5, .touch ._1f9d, .touch ._3tap, ._36dc { background: #1e1e1e !important; border-bottom: 0px; border-top: 0px; }._44qk { border-bottom: 0px; }._34ee, textarea, input, ._u42 ._52x7, ._5rgt p, ._5t8z p, .ib .c, ._52jc, .touch ._5b6o ._5b6q, ._21dc, ._2b06, ._5g68, ._43lx._43lx a { color: #aaaaaa !important; }.touch ._52t1, ._uww, ._5-lx, .touch ._26vk._56bt[disabled] { border: 1px solid #1e1e1e !important; background: #121212; }._3bg5 ._52x6 { border-top-color: #2b324600 !important; background: #1e1e1e !important; }._3bg5 ._52x1, ._z-w { background: #121212 !important; border-bottom: 0px; border-top: 0px; }._4gus, ._67i4 ._67iu ._3z10, h1, h2, h3, h4, h5, h6, ._52jj, ._njv, ._5c4t ._1g06 { color: white; } .touch ._55so._59f6::before, .touch.wp.x1-5 ._55so._59f6::before, .touch.wp.x2 ._55so._59f6::before, .touch ._59f6 ._55st ._5c9u { background: #1e1e1e !important; text-shadow: 0 0px; } ._a58 _9_7 _2rgt _1j-f _2rgt { background-color: #121212 !important; }"); // ._7om2, lele

if (themeMode == 1 || themeMode == 3)
stringBuilder.append("._34em ._34ee, .touch ._8hq8, ._6j_d ._6j_c, ._59tg, ._u42 ._55fj { color: #").append(Integer.toHexString(MFB.colorAccent).substring(2)).append(" !important; }");

stringBuilder.append("._5rgr, ._5rgt p { -webkit-user-select: initial !important; }");
// stringBuilder.append("._5rgr, ._5rgt p { -webkit-user-select: initial !important; }");

return stringBuilder.toString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package me.zeeroooo.materialfb.webview;

import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.webkit.JavascriptInterface;

import androidx.preference.PreferenceManager;

import me.zeeroooo.materialfb.activities.MainActivity;

@SuppressWarnings("unused")
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/values/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
<resources>
<string name="changelog_list" translatable="false">
<![CDATA[
<b>**Version 4.0.3:**</b>
<br>
- Fixed some black theme glitches.
<br>
- Fixed crashes on Android 10+.
<br>
- Notification fixes.
<br>
- Temporarily disabled copy & paste feature as it\'s causing crashes.
<br>
<br>
<b>**Version 4.0.2:**</b>
<br>
- Fixed facebook menu bar hiding when option is disabled.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
classpath 'com.android.tools.build:gradle:3.6.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit 8968534

Please sign in to comment.