Created
June 28, 2012 20:03
-
-
Save phl0w/3013563 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public void onStop() { | |
| try { | |
| URL submit = new URL( | |
| "http://site.com/submit.php?user=(...)&timeran=(...)&otherparameters=..."); | |
| URLConnection con = submit.openConnection(); | |
| con.setRequestProperty( | |
| "User-Agent", | |
| "| i recommend you set a fake user agent which you read on the website side by $_SERVER['HTTP_USER_AGENT'] |"); | |
| con.setDoInput(true); | |
| con.setDoOutput(true); | |
| con.setUseCaches(false); | |
| final BufferedReader rd = new BufferedReader(new InputStreamReader( | |
| con.getInputStream())); | |
| String line; | |
| while ((line = rd.readLine()) != null) { | |
| if (line.toLowerCase().contains("success")) { | |
| log.info("Successfully updated signature."); | |
| } else if (line.toLowerCase().contains("fuck off")) { | |
| log.info("Something fucked up, couldn't update."); | |
| } | |
| } | |
| rd.close(); | |
| } catch (Exception e) { | |
| e.printStackTrace(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment