From 3f3b3f3f7325392ef77e71f5a37032dc8b9ffadf Mon Sep 17 00:00:00 2001 From: HuanChengFly <609486518@qq.com> Date: Thu, 16 Jul 2020 15:58:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BD=91=E9=A1=B5?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 4 ++-- ...{JumpActivity.java => DispatchActivity.java} | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) rename app/src/main/java/com/huanchengfly/tieba/post/activities/{JumpActivity.java => DispatchActivity.java} (61%) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index e31633d7..5cb7b59f 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -171,8 +171,8 @@ -keep class cn.jzvd.*{*;} - -keep class com.gyf.immersionbar.* {*;} - -dontwarn com.gyf.immersionbar.** +-keep class com.gyf.immersionbar.* {*;} +-dontwarn com.gyf.immersionbar.** -keep class com.huanchengfly.tieba.post.models.** { *; } -keep class com.huanchengfly.tieba.api.models.** { *; } diff --git a/app/src/main/java/com/huanchengfly/tieba/post/activities/JumpActivity.java b/app/src/main/java/com/huanchengfly/tieba/post/activities/DispatchActivity.java similarity index 61% rename from app/src/main/java/com/huanchengfly/tieba/post/activities/JumpActivity.java rename to app/src/main/java/com/huanchengfly/tieba/post/activities/DispatchActivity.java index 98c690a9..da193148 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/activities/JumpActivity.java +++ b/app/src/main/java/com/huanchengfly/tieba/post/activities/DispatchActivity.java @@ -10,19 +10,16 @@ import com.huanchengfly.tieba.post.utils.NavigationHelper; import java.util.HashMap; import java.util.Map; -public class JumpActivity extends AppCompatActivity { - public static final String ACTION_JUMP = "com.huanchengfly.tieba.post.ACTION_JUMP"; - +public class DispatchActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Uri uri = getIntent().getData(); - String action = getIntent().getAction(); NavigationHelper navigationHelper = NavigationHelper.newInstance(this); if (uri != null) { String url = uri.toString(); Uri newUri = Uri.parse(url.replace("://tieba.baidu.com//", "://tieba.baidu.com/?")); - if (newUri.getScheme().equalsIgnoreCase("http") || newUri.getScheme().equalsIgnoreCase("https")) { + if ("http".equalsIgnoreCase(newUri.getScheme()) || "https".equalsIgnoreCase(newUri.getScheme())) { navigationHelper.navigationByData(NavigationHelper.ACTION_URL, newUri.toString()); } else if (newUri.getScheme().equals("tbfrs")) { navigationHelper.navigationByData(NavigationHelper.ACTION_FORUM, newUri.getQueryParameter("kw")); @@ -30,8 +27,16 @@ public class JumpActivity extends AppCompatActivity { Map map = new HashMap<>(); map.put("tid", newUri.getQueryParameter("tid")); navigationHelper.navigationByData(NavigationHelper.ACTION_THREAD, map); + } else if (newUri.getScheme().equals("com.baidu.tieba") && "unidispatch".equals(newUri.getHost())) { + if ("/frs".equals(newUri.getPath())) { + navigationHelper.navigationByData(NavigationHelper.ACTION_FORUM, newUri.getQueryParameter("kw")); + } else if ("/pb".equals(newUri.getPath())) { + Map map = new HashMap<>(); + map.put("tid", newUri.getQueryParameter("tid")); + navigationHelper.navigationByData(NavigationHelper.ACTION_THREAD, map); + } } } - this.finish(); + finish(); } } \ No newline at end of file