Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Commit

Permalink
fix: 修复网页无法跳转
Browse files Browse the repository at this point in the history
  • Loading branch information
HuanCheng65 committed Jul 16, 2020
1 parent d8323ba commit 3f3b3f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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.** { *; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,33 @@
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"));
} else if (newUri.getScheme().equals("tbpb")) {
Map<String, String> 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<String, String> map = new HashMap<>();
map.put("tid", newUri.getQueryParameter("tid"));
navigationHelper.navigationByData(NavigationHelper.ACTION_THREAD, map);
}
}
}
this.finish();
finish();
}
}

0 comments on commit 3f3b3f3

Please sign in to comment.