Skip to content

Commit 328a198

Browse files
author
mrzhang
committed
fix bug in verifyUri
1 parent 9bed0a2 commit 328a198

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sharecomponent/src/main/java/com/mrzhang/share/compouirouter/ShareUIRouter.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ShareUIRouter implements IComponentRouter {
1919

2020
private static final String SHAREHOST = "share";
2121

22-
private static String[] hosts = new String[]{SHAREHOST};
22+
private static String[] HOSTS = new String[]{SHAREHOST};
2323

2424
private static ShareUIRouter instance = new ShareUIRouter();
2525

@@ -58,8 +58,12 @@ public boolean openUri(Context context, Uri uri, Bundle bundle) {
5858
public boolean verifyUri(Uri uri) {
5959
String scheme = uri.getScheme();
6060
String host = uri.getHost();
61-
if (SCHME.equals(scheme) && SHAREHOST.contains(host)) {
62-
return true;
61+
if (SCHME.equals(scheme)) {
62+
for (String str : HOSTS) {
63+
if (str.equals(host)) {
64+
return true;
65+
}
66+
}
6367
}
6468
return false;
6569
}

0 commit comments

Comments
 (0)