Skip to content

Commit ccd6ab4

Browse files
committed
reformat code
1 parent cea4076 commit ccd6ab4

1 file changed

Lines changed: 90 additions & 90 deletions

File tree

cSploit/src/org/csploit/android/ActionActivity.java

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -42,114 +42,114 @@
4242
import java.util.ArrayList;
4343

4444
public class ActionActivity extends AppCompatActivity {
45-
private ArrayList<Plugin> mAvailable = null;
46-
private ListView theList;
47-
48-
@Override
49-
public void onCreate(Bundle savedInstanceState) {
50-
SharedPreferences themePrefs = getSharedPreferences("THEME", 0);
51-
Boolean isDark = themePrefs.getBoolean("isDark", false);
52-
53-
if (isDark)
54-
setTheme(R.style.DarkTheme);
55-
else
56-
setTheme(R.style.AppTheme);
57-
super.onCreate(savedInstanceState);
58-
59-
if (System.getTargets() != null && System.getTargets().size() > 0 && System.getCurrentTarget() != null) {
60-
setTitle("cSploit > " + System.getCurrentTarget());
61-
setContentView(R.layout.actions_layout);
62-
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
63-
theList = (ListView) findViewById(R.id.android_list);
64-
mAvailable = System.getPluginsForTarget();
65-
ActionsAdapter mActionsAdapter = new ActionsAdapter();
66-
theList.setAdapter(mActionsAdapter);
67-
theList.setOnItemClickListener(new ListView.OnItemClickListener() {
68-
@Override
69-
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
70-
71-
if (System.checkNetworking(ActionActivity.this)) {
72-
Plugin plugin = mAvailable.get(position);
73-
System.setCurrentPlugin(plugin);
74-
75-
if (plugin.hasLayoutToShow()) {
76-
Toast.makeText(ActionActivity.this, getString(R.string.selected) + getString(plugin.getName()), Toast.LENGTH_SHORT).show();
77-
78-
startActivity(new Intent(
79-
ActionActivity.this,
80-
plugin.getClass()
81-
));
82-
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_left);
83-
} else
84-
plugin.onActionClick(getApplicationContext());
85-
}
86-
}
87-
});
88-
} else {
89-
new FinishDialog(getString(R.string.warning), getString(R.string.something_went_wrong), this).show();
45+
private ArrayList<Plugin> mAvailable = null;
46+
private ListView theList;
47+
48+
@Override
49+
public void onCreate(Bundle savedInstanceState) {
50+
SharedPreferences themePrefs = getSharedPreferences("THEME", 0);
51+
Boolean isDark = themePrefs.getBoolean("isDark", false);
52+
53+
if (isDark)
54+
setTheme(R.style.DarkTheme);
55+
else
56+
setTheme(R.style.AppTheme);
57+
super.onCreate(savedInstanceState);
58+
59+
if (System.getTargets() != null && System.getTargets().size() > 0 && System.getCurrentTarget() != null) {
60+
setTitle("cSploit > " + System.getCurrentTarget());
61+
setContentView(R.layout.actions_layout);
62+
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
63+
theList = (ListView) findViewById(R.id.android_list);
64+
mAvailable = System.getPluginsForTarget();
65+
ActionsAdapter mActionsAdapter = new ActionsAdapter();
66+
theList.setAdapter(mActionsAdapter);
67+
theList.setOnItemClickListener(new ListView.OnItemClickListener() {
68+
@Override
69+
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
70+
71+
if (System.checkNetworking(ActionActivity.this)) {
72+
Plugin plugin = mAvailable.get(position);
73+
System.setCurrentPlugin(plugin);
74+
75+
if (plugin.hasLayoutToShow()) {
76+
Toast.makeText(ActionActivity.this, getString(R.string.selected) + getString(plugin.getName()), Toast.LENGTH_SHORT).show();
77+
78+
startActivity(new Intent(
79+
ActionActivity.this,
80+
plugin.getClass()
81+
));
82+
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_left);
83+
} else
84+
plugin.onActionClick(getApplicationContext());
85+
}
9086
}
87+
});
88+
} else {
89+
new FinishDialog(getString(R.string.warning), getString(R.string.something_went_wrong), this).show();
9190
}
91+
}
9292

9393

94-
@Override
95-
public boolean onOptionsItemSelected(MenuItem item) {
96-
switch (item.getItemId()) {
97-
case android.R.id.home:
94+
@Override
95+
public boolean onOptionsItemSelected(MenuItem item) {
96+
switch (item.getItemId()) {
97+
case android.R.id.home:
9898

99-
onBackPressed();
99+
onBackPressed();
100100

101-
return true;
101+
return true;
102102

103-
default:
104-
return super.onOptionsItemSelected(item);
105-
}
103+
default:
104+
return super.onOptionsItemSelected(item);
106105
}
106+
}
107107

108108

109-
@Override
110-
public void onBackPressed() {
111-
super.onBackPressed();
112-
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_left);
113-
}
109+
@Override
110+
public void onBackPressed() {
111+
super.onBackPressed();
112+
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_left);
113+
}
114114

115-
public class ActionsAdapter extends ArrayAdapter<Plugin> {
116-
public ActionsAdapter() {
117-
super(ActionActivity.this, R.layout.actions_list_item, mAvailable);
118-
}
115+
public class ActionsAdapter extends ArrayAdapter<Plugin> {
116+
public ActionsAdapter() {
117+
super(ActionActivity.this, R.layout.actions_list_item, mAvailable);
118+
}
119119

120-
@SuppressLint("NewApi")
121-
@Override
122-
public View getView(int position, View convertView, ViewGroup parent) {
123-
View row = convertView;
124-
ActionHolder holder;
120+
@SuppressLint("NewApi")
121+
@Override
122+
public View getView(int position, View convertView, ViewGroup parent) {
123+
View row = convertView;
124+
ActionHolder holder;
125125

126-
if (row == null) {
127-
LayoutInflater inflater = (LayoutInflater) ActionActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
128-
row = inflater.inflate(R.layout.actions_list_item, parent, false);
129-
if (getSharedPreferences("THEME", 0).getBoolean("isDark", false))
130-
row.setBackground(getResources().getDrawable(R.drawable.card_background_dark));
131-
holder = new ActionHolder();
126+
if (row == null) {
127+
LayoutInflater inflater = (LayoutInflater) ActionActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
128+
row = inflater.inflate(R.layout.actions_list_item, parent, false);
129+
if (getSharedPreferences("THEME", 0).getBoolean("isDark", false))
130+
row.setBackground(getResources().getDrawable(R.drawable.card_background_dark));
131+
holder = new ActionHolder();
132132

133-
holder.icon = (ImageView) (row != null ? row.findViewById(R.id.actionIcon) : null);
134-
holder.name = (TextView) (row != null ? row.findViewById(R.id.actionName) : null);
135-
holder.description = (TextView) (row != null ? row.findViewById(R.id.actionDescription) : null);
136-
if (row != null) row.setTag(holder);
133+
holder.icon = (ImageView) (row != null ? row.findViewById(R.id.actionIcon) : null);
134+
holder.name = (TextView) (row != null ? row.findViewById(R.id.actionName) : null);
135+
holder.description = (TextView) (row != null ? row.findViewById(R.id.actionDescription) : null);
136+
if (row != null) row.setTag(holder);
137137

138-
} else holder = (ActionHolder) row.getTag();
138+
} else holder = (ActionHolder) row.getTag();
139139

140-
Plugin action = mAvailable.get(position);
140+
Plugin action = mAvailable.get(position);
141141

142-
holder.icon.setImageResource(action.getIconResourceId());
143-
holder.name.setText(getString(action.getName()));
144-
holder.description.setText(getString(action.getDescription()));
142+
holder.icon.setImageResource(action.getIconResourceId());
143+
holder.name.setText(getString(action.getName()));
144+
holder.description.setText(getString(action.getDescription()));
145145

146-
return row;
147-
}
146+
return row;
147+
}
148148

149-
public class ActionHolder {
150-
ImageView icon;
151-
TextView name;
152-
TextView description;
153-
}
149+
public class ActionHolder {
150+
ImageView icon;
151+
TextView name;
152+
TextView description;
154153
}
154+
}
155155
}

0 commit comments

Comments
 (0)