2011-06-04 30 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