diff --git a/twidere/proguard-rules.pro b/twidere/proguard-rules.pro index c36ff99fd..fae9d4247 100644 --- a/twidere/proguard-rules.pro +++ b/twidere/proguard-rules.pro @@ -15,12 +15,18 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} --dontobfuscate + +#-dontobfuscate -dontwarn sun.net.spi.** -dontwarn java.nio.file.** -dontwarn org.codehaus.mojo.** -dontwarn com.makeramen.roundedimageview.** +-dontwarn com.squareup.haha.** +-dontwarn com.google.android.gms.** +-dontwarn com.google.android.youtube.** +-dontwarn jnamed** +-dontwarn com.bluelinelabs.logansquare.** -keepattributes *Annotation* -keepattributes EnclosingMethod @@ -36,21 +42,10 @@ @com.squareup.otto.Produce public *; } --keepclassmembers class android.support.v7.internal.app.WindowDecorActionBar { - private android.support.v7.internal.widget.ActionBarContextView mContextView; - private android.support.v7.internal.widget.DecorToolbar mDecorToolbar; -} --keepclassmembers class android.support.v7.internal.widget.ActionBarOverlayLayout { - private android.graphics.drawable.Drawable mWindowContentOverlay; -} - --keepclassmembers class org.mariotaku.twidere.activity.BrowserSignInActivity.InjectorJavaScriptInterface { +-keepclassmembers class org.mariotaku.twidere.activity.BrowserSignInActivity$InjectorJavaScriptInterface { public *; } -# Fuck shitsung --keep class !android.support.v7.view.menu.*MenuBuilder*, android.support.v7.** { *; } --keep interface android.support.v7.* { *; } - -# Fuck xiaomi --keep class !org.apache.commons.lang3.** { *; } \ No newline at end of file +# Fuck shitsung http://stackoverflow.com/a/34896262/859190 +# ... and fuck xiaomi http://crashes.to/s/675ac9aff5e +-keep class !android.support.v7.view.menu.MenuBuilder, !org.apache.commons.** { *; } diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/ThemeUtils.java b/twidere/src/main/java/org/mariotaku/twidere/util/ThemeUtils.java index 4904a2680..f3309a0ae 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/util/ThemeUtils.java +++ b/twidere/src/main/java/org/mariotaku/twidere/util/ThemeUtils.java @@ -55,7 +55,6 @@ import com.afollestad.appthemeengine.util.ATEUtil; import org.apache.commons.lang3.ArrayUtils; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere.R; -import org.mariotaku.twidere.activity.iface.IThemedActivity; import org.mariotaku.twidere.graphic.ActionIconDrawable; import org.mariotaku.twidere.graphic.iface.DoNotWrapDrawable; import org.mariotaku.twidere.preference.ThemeBackgroundPreference; @@ -304,14 +303,9 @@ public class ThemeUtils implements Constants { } public static Drawable getWindowBackgroundFromTheme(final Context context) { - final TypedArray a = context.obtainStyledAttributes(new int[]{R.attr.windowNormalBackground, - android.R.attr.windowBackground}); + final TypedArray a = context.obtainStyledAttributes(new int[]{android.R.attr.windowBackground}); try { - if (a.hasValue(0)) { - return a.getDrawable(0); - } else { - return a.getDrawable(1); - } + return a.getDrawable(0); } finally { a.recycle(); } @@ -399,24 +393,6 @@ public class ThemeUtils implements Constants { } } - public static void setupDrawerBackground(Context context, View view) { - if (!(context instanceof IThemedActivity)) return; - final String backgroundOption = ((IThemedActivity) context).getThemeBackgroundOption(); - final int alpha = ((IThemedActivity) context).getCurrentThemeBackgroundAlpha(); - final Drawable d; - if (isSolidBackground(backgroundOption)) { - d = new ColorDrawable(!isLightTheme(context) ? Color.BLACK : Color.WHITE); - } else { - d = getWindowBackgroundFromTheme(context); - } - if (d == null) throw new NullPointerException(); - d.mutate(); - if (isTransparentBackground(backgroundOption)) { - d.setAlpha(alpha); - } - ViewSupport.setBackground(view, d); - } - public static void wrapMenuIcon(@NonNull Menu menu, int itemColor, int subItemColor, int... excludeGroups) { for (int i = 0, j = menu.size(); i < j; i++) { final MenuItem item = menu.getItem(i); diff --git a/twidere/src/main/java/org/mariotaku/twidere/view/DrawerContentFrameLayout.java b/twidere/src/main/java/org/mariotaku/twidere/view/DrawerContentFrameLayout.java deleted file mode 100644 index 74f2674ff..000000000 --- a/twidere/src/main/java/org/mariotaku/twidere/view/DrawerContentFrameLayout.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Twidere - Twitter client for Android - * - * Copyright (C) 2012-2015 Mariotaku Lee - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.mariotaku.twidere.view; - -import android.content.Context; -import android.util.AttributeSet; -import android.widget.FrameLayout; - -import org.mariotaku.twidere.util.ThemeUtils; - -public class DrawerContentFrameLayout extends FrameLayout { - - public DrawerContentFrameLayout(final Context context) { - this(context, null); - } - - public DrawerContentFrameLayout(final Context context, final AttributeSet attrs) { - this(context, attrs, 0); - } - - public DrawerContentFrameLayout(final Context context, final AttributeSet attrs, final int defStyle) { - super(context, attrs, defStyle); - ThemeUtils.setupDrawerBackground(context, this); - } - -} diff --git a/twidere/src/main/res/layout/drawer_home_accounts.xml b/twidere/src/main/res/layout/drawer_home_accounts.xml deleted file mode 100644 index 0f9b807b4..000000000 --- a/twidere/src/main/res/layout/drawer_home_accounts.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/twidere/src/main/res/values/attrs.xml b/twidere/src/main/res/values/attrs.xml index 7ed6ac01a..be3202b74 100644 --- a/twidere/src/main/res/values/attrs.xml +++ b/twidere/src/main/res/values/attrs.xml @@ -13,7 +13,6 @@ -