This file contains 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
<service android:name=".services.LocationService" > | |
<intent-filter> | |
<action android:name="org.owasp.goatdroid.fourgoats.services.LocationService" /> | |
</intent-filter> | |
</service> | |
<receiver | |
android:name=".broadcastreceivers.SendSMSNowReceiver" | |
android:label="Send SMS" > | |
<intent-filter> |
This file contains 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
<activity | |
android:name=".activities.ViewCheckin" | |
android:exported="true" | |
android:label="@string/view_checkin" > | |
</activity> | |
<activity | |
android:name=".activities.ViewProfile" | |
android:exported="true" | |
android:label="@string/profile" > |
This file contains 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
public static HttpClient getNewHttpClient() { | |
try { | |
KeyStore trustStore = KeyStore.getInstance(KeyStore | |
.getDefaultType()); | |
trustStore.load(null, null); | |
SSLSocketFactory sf = new CustomSSLSocketFactory(trustStore); | |
sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); | |
HttpParams params = new BasicHttpParams(); |
This file contains 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
public CustomSSLSocketFactory(KeyStore truststore) | |
throws NoSuchAlgorithmException, KeyManagementException, | |
KeyStoreException, UnrecoverableKeyException { | |
super(truststore); | |
TrustManager tm = new X509TrustManager() { | |
public java.security.cert.X509Certificate[] getAcceptedIssuers() { | |
return null; | |
} |
This file contains 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
private void executeRequest(HttpUriRequest request, String url, | |
Context context) { | |
HttpClient client = CustomSSLSocketFactory.getNewHttpClient(); | |
HashMap<String, String> proxyInfo = Utils.getProxyMap(context); | |
String proxyHost = proxyInfo.get("proxyHost"); | |
String proxyPort = proxyInfo.get("proxyPort"); | |
if (!(proxyHost.equals("") || proxyPort.equals(""))) { | |
HttpHost proxy = new HttpHost(proxyHost, |
This file contains 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
public HashMap<String, String> validateCredentials(String userName, | |
String password) throws Exception { | |
RestClient client = new RestClient("https://" + destinationInfo | |
+ "/fourgoats/api/v1/login/authenticate"); | |
client.AddParam("userName", userName); | |
client.AddParam("password", password); | |
client.Execute(RequestMethod.POST, context); | |
return LoginResponse.parseLoginResponse(client.getResponse()); |
This file contains 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
private class ValidateCredsAsyncTask extends | |
AsyncTask<Void, Void, HashMap<String, String>> { | |
Login mActivity; | |
public ValidateCredsAsyncTask(Login activity) { | |
mActivity = activity; | |
} | |
@Override |
This file contains 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 onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Context fourgoatsAppContext = null; | |
try { | |
fourgoatsAppContext = createPackageContext("org.owasp.goatdroid.fourgoats", Context.CONTEXT_IGNORE_SECURITY); | |
} catch (NameNotFoundException e) { | |
} |
NewerOlder