@@ -95,6 +95,12 @@ protected void onCreate(Bundle savedInstanceState) {
9595 CurrentStatus .setEllipsize (TextUtils .TruncateAt .END );
9696 CurrentStatus .setLines (1 );
9797
98+ setupGears ();
99+
100+ registerBroadcastReceiver ();
101+ }
102+
103+ private void setupGears (){
98104 final ImageView GearProgressLeft = (ImageView ) findViewById (R .id .gear_progress_left );
99105 final ImageView GearProgressRight = (ImageView ) findViewById (R .id .gear_progress_right );
100106
@@ -120,11 +126,9 @@ public void run() {
120126 GearProgressRight .setAnimation (GearProgressRightAnim );
121127 }
122128 });
123-
124- registerBroadcastReceiver ();
125129 }
126130
127- public void startProcessorService () {
131+ private void startProcessorService () {
128132 Utils .killAllProcessorServices (this );
129133 Intent mServiceIntent = new Intent (getContext (), ProcessService .class );
130134 mServiceIntent .setAction (Constants .ACTION .START_PROCESS );
@@ -133,7 +137,7 @@ public void startProcessorService() {
133137 startService (mServiceIntent );
134138 }
135139
136- public void registerBroadcastReceiver () {
140+ private void registerBroadcastReceiver () {
137141 IntentFilter statusIntentFilter = new IntentFilter (Constants .PROCESS_BROADCAST_ACTION );
138142 registerReceiver (processStatusReceiver , statusIntentFilter );
139143 }
@@ -159,9 +163,9 @@ private boolean fromNotification() {
159163 }
160164
161165 private void exitWithError () {
166+ Toast .makeText (baseContext , "There was an error initialising the decompiler with the app you selected." , Toast .LENGTH_LONG ).show ();
162167 finish ();
163168 overridePendingTransition (R .anim .fadein , R .anim .fadeout );
164- Toast .makeText (baseContext , "There was an error initialising the decompiler with the app you selected." , Toast .LENGTH_LONG ).show ();
165169 }
166170
167171 @ Override
@@ -189,13 +193,16 @@ public void onReceive(Context context, Intent intent) {
189193 case "optimise_dex_start" :
190194 CurrentStatus .setText ("Optimising dex file" );
191195 break ;
196+
192197 case "optimising" :
193198 CurrentStatus .setText ("Optimising dex file" );
194199 CurrentLine .setText ("" );
195200 break ;
201+
196202 case "optimise_dex_finish" :
197203 CurrentStatus .setText ("Finishing optimisation" );
198204 break ;
205+
199206 case "merging_classes" :
200207 CurrentStatus .setText ("Merging classes" );
201208 CurrentLine .setText ("" );
@@ -209,7 +216,6 @@ public void onReceive(Context context, Intent intent) {
209216 startActivityForResult (iOne , 1 );
210217 overridePendingTransition (R .anim .fadein , R .anim .fadeout );
211218 }
212-
213219 break ;
214220
215221 case "start_activity_with_error" :
@@ -224,6 +230,7 @@ public void onReceive(Context context, Intent intent) {
224230 break ;
225231
226232 case "exit_process_on_error" :
233+ Toast .makeText (baseContext , "Exiting with error." , Toast .LENGTH_SHORT ).show ();
227234 finish ();
228235 overridePendingTransition (R .anim .fadein , R .anim .fadeout );
229236 break ;
@@ -236,16 +243,21 @@ public void onReceive(Context context, Intent intent) {
236243 case "dex2jar" :
237244 CurrentStatus .setText ("Decompiling dex to jar" );
238245 break ;
246+
239247 case "jar2java" :
240248 CurrentStatus .setText ("Decompiling to java" );
241249 break ;
250+
242251 case "res" :
243252 CurrentStatus .setText ("Extracting Resources" );
244253 break ;
254+
245255 case "exit" :
256+ Toast .makeText (baseContext , "Exiting." , Toast .LENGTH_SHORT ).show ();
246257 finish ();
247258 overridePendingTransition (R .anim .fadein , R .anim .fadeout );
248259 break ;
260+
249261 default :
250262 CurrentLine .setText (statusData );
251263 }
0 commit comments