2011-06-04 81 views
0

所以,我试图采取gv4me应用程序的来源,并修改它。我必须解决这个过滤器问题,而通过它的方法是在您尝试访问的任何URL中放入某个关键字(可以说它是“foobar”)。所以我已经编译了源代码等,但我无法弄清楚如何正确添加这个单词。到目前为止,将其添加到帖子不起作用。这些都是gv4me用途网址:向URL添加任意词语?

private static final String rnrURL = "https://www.google.com/voice/m/i/voicemail?p=1000"; 
private static final String clientLoginURL = "https://www.google.com/accounts/ClientLogin"; 
private final String callURL = "https://www.google.com/voice/call/connect"; 
private static final String markReadURL = "https://www.google.com/voice/m/mark?p=1&label=unread&id="; 
private static final String getMsgsURL = "https://www.google.com/voice/inbox/recent/unread"; 
private static final String textURL = "https://www.google.com/voice/sms/send"; 
private static final String replyURL = "https://www.google.com/voice/m/sendsms"; 

我需要修改这些网址,所以他们有他们“foobar的”,但仍链接到同一页面。这可能吗?

编辑:此外,如果您在谷歌搜索HandlerUI,您会发现大量的应用程序(封闭和开放源代码)被修改为包含一个用户界面,用于自动修改所有应用程序的连接尝试。然而,创作者很难找到,所以我想知道是否有人知道如何做到这一点?

EDIT2:似乎添加一个查询字符串变量似乎没有工作。我认为最有可能的工作是以某种方式将www.google.com替换为foobar.freednsredirectservice.com。有没有人知道类似这样的事情?有什么可以让foobar.freednsredirectservice.com/voice仍然有效?

回答

0

尝试添加查询字符串参数。这可能不会,但通常会起作用。

例如:

http://www.example.com/ -> http://www.example.com/?foobar 
http://www.example.com/page?existing=value -> http://www.example.com/page?foobar&existing=value 
+0

这似乎并没有工作。你知道是否有可能以另一个域名作为www.google.com的替代品吗? – 2011-06-04 23:48:08

+0

@Rahat:您可以使用http://www.l.google.com/,但它似乎重定向到正常的http://www.google.com/。 – icktoofay 2011-06-04 23:49:02

0

你的问题不清楚的其中的foobar的应该去,但让我们假设它是主机名后,即

"https://www.google.com/voice/sms/send" --> "https://www.google.com/foobar/voice/sms/send" 

使用此:

String url = "https://www.google.com/voice/sms/send"; 
    url = url.replaceFirst("(?<=[^:/]/)", "foobar/"); 
    System.out.println(url); // https://www.google.com/foobar/voice/sms/send 

如果foobar repl王牌主机名,即

"https://www.google.com/voice/sms/send" --> "https://foobar/voice/sms/send" use this: 

使用此:

String url = "https://www.google.com/voice/sms/send"; 
    url = url.replaceAll("//.*?/", "//foobar/"); 
    System.out.println(url); // https://foobar/voice/sms/send 
+0

任何地方,只要它在网址 – 2011-06-04 23:39:04

+0

虽然,这种方法似乎改变的地方,实际的url指向 – 2011-06-04 23:45:28

0

我会说不,因为那将是一个链接是一个ADRESS和不同ADRESS导致不同的地方。你可以做的是这样的:

String[] url = new String[2]; 
url[0] = "http://www.yoururl.com/";// Accual url 
url[1] = url[0].replaceFirst("(?<=[^:/]/)", "foobar/");// For other purpose such as diplay 
+0

那么,我知道DynDNS提供免费的服务,你设置了一个动态的DNS像johndoedns.dyndns.org,你可以为此设置一定的IP。我尝试将Google Ping的IP加入,但它似乎没有按照我想要的方式工作(它只会重定向到google.com,并且不会保留johndoedns.dyndns.org)。 – 2011-06-04 23:52:42

+0

你需要更具体地说明你如何使用它。 – 2011-06-04 23:54:09