1919package org .csploit .android ;
2020
2121import android .app .Application ;
22+ import android .content .Context ;
2223import android .content .SharedPreferences ;
24+ import android .support .multidex .MultiDex ;
2325
2426import org .acra .ACRA ;
25- import org .acra .ReportingInteractionMode ;
26- import org .acra .annotation .ReportsCrashes ;
27+ import org .acra .annotation .AcraCore ;
28+ import org .acra .annotation .AcraHttpSender ;
29+ import org .acra .annotation .AcraNotification ;
30+ import org .acra .config .CoreConfigurationBuilder ;
31+ import org .acra .config .HttpSenderConfigurationBuilder ;
32+ import org .acra .config .NotificationConfigurationBuilder ;
33+ import org .acra .data .StringFormat ;
2734import org .acra .sender .HttpSender ;
28- import org .csploit .android .core .Logger ;
2935import org .csploit .android .core .System ;
3036import org .csploit .android .plugins .ExploitFinder ;
3137import org .csploit .android .plugins .Inspector ;
4046
4147import java .net .NoRouteToHostException ;
4248
43- @ ReportsCrashes (
49+ @ AcraHttpSender (
4450 httpMethod = HttpSender .Method .PUT ,
45- reportType = HttpSender .Type .JSON ,
46- formUri = "http://csploit.iriscouch.com/acra-csploit/_design/acra-storage/_update/report" ,
47- formUriBasicAuthLogin = "android" ,
48- formUriBasicAuthPassword = "DEADBEEF" ,
49- mode = ReportingInteractionMode .DIALOG ,
50- resDialogText = R .string .crash_dialog_text ,
51- resDialogIcon = R .drawable .dsploit_icon ,
52- resDialogTitle = R .string .crash_dialog_title ,
53- resDialogCommentPrompt = R .string .crash_dialog_comment
51+ uri = "http://csploit.iriscouch.com/acra-csploit/_design/acra-storage/_update/report" ,
52+ basicAuthLogin = "android" ,
53+ basicAuthPassword = "DEADBEEF"
5454)
55+ @ AcraNotification (
56+ resChannelName = R .string .csploitChannelId ,
57+ resText = R .string .crash_dialog_text ,
58+ resIcon = R .drawable .dsploit_icon ,
59+ resTitle = R .string .crash_dialog_title ,
60+ resCommentPrompt = R .string .crash_dialog_comment
61+ )
62+
63+ @ AcraCore (applicationLogFile = "/cSploitd.log" )
64+
5565public class CSploitApplication extends Application {
66+
5667 @ Override
5768 public void onCreate () {
5869 SharedPreferences themePrefs = getSharedPreferences ("THEME" , 0 );
@@ -76,7 +87,11 @@ public void onCreate() {
7687 System .errorLogging (e );
7788 }
7889
79- ACRA .setConfig (ACRA .getConfig ().setApplicationLogFile (System .getCorePath () + "/cSploitd.log" ));
90+ CoreConfigurationBuilder builder = new CoreConfigurationBuilder (this );
91+ builder .setBuildConfigClass (BuildConfig .class ).setReportFormat (StringFormat .JSON );
92+ builder .getPluginConfigurationBuilder (HttpSenderConfigurationBuilder .class );
93+ builder .getPluginConfigurationBuilder (NotificationConfigurationBuilder .class );
94+ ACRA .init (this , builder );
8095
8196 // load system modules even if the initialization failed
8297 System .registerPlugin (new RouterPwn ());
@@ -89,4 +104,11 @@ public void onCreate() {
89104 System .registerPlugin (new MITM ());
90105 System .registerPlugin (new PacketForger ());
91106 }
107+
108+ @ Override
109+ protected void attachBaseContext (Context base ) {
110+ super .attachBaseContext (base );
111+ MultiDex .install (this );
112+ ACRA .init (this );
113+ }
92114}
0 commit comments