开发者

Add arbitrary word to URL?

So I'm trying to take the source of the gv4me app, and modify it. I have this filter I have to get around, and the way to get past it is to put a certain keyword(lets say it's "foobar") in whatever URL you're trying to access. So I've got the source compiled and such, but I can't figure out how to add this word in properly. So far, adding it to the post doesn't work. These are the URLs that gv4me uses:

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";

I need to modify each of these URLs so they have "foobar" in them, but still link to the same page. Is this possible?

EDIT: Also, if you search for HandlerUI on google, you'll find a plethora of applications(closed and open source) modified to include a user interface for automatically modifying all connection attempts of said applications. However, the creator is fairly difficult to locate, so I was wondering if anyone knew how to do this?

EDIT2: It seems that adding a query string variable doesn't seem to work. What I think would most likely work, is to somehow replace www.google.com with foobar.freednsredirectservice.com. Does anyone know of anything similar to this? Something that would allow foobar.freednsredirectservice.com/voice to still wo开发者_高级运维rk?


Try adding a query string parameter. This may not, but usually will work.

For example:

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


Your question is unclear as to where the foobar should go, but let's assume it's after the host name, ie

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

Use this:

    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

If the foobar replaces the hostname, ie

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

Use this:

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


I would say no because then it would be a link is an adress and a different adress leads to a different place. What you could do is something like this:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜