Created
April 18, 2016 11:50
-
-
Save yishai-glide/cd99991f42c8b7a386127a5b8ac6f6cd to your computer and use it in GitHub Desktop.
This file contains hidden or 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 org.teamsik.apps.hackingchallenge; | |
import android.content.Context; | |
import android.util.Base64; | |
public abstract class a | |
{ | |
public static boolean a(Context paramContext, String paramString) | |
{ | |
byte[] arrayOfByte1 = a(paramString); | |
byte[] arrayOfByte2 = Base64.decode("BFF1NwF1YRTl", 2); | |
if (arrayOfByte1.length != arrayOfByte2.length) | |
return false; | |
for (int i = 0; ; i++) | |
{ | |
if (i >= arrayOfByte1.length) | |
break label48; | |
if (arrayOfByte1[i] != arrayOfByte2[i]) | |
break; | |
} | |
label48: return true; | |
} | |
private static byte[] a(String paramString) | |
{ | |
byte[] arrayOfByte = paramString.getBytes(); | |
for (int i = 0; i < arrayOfByte.length; i++) | |
{ | |
arrayOfByte[i] = ((byte)(0xFF & arrayOfByte[i] << 4 | arrayOfByte[i] >> 4)); | |
arrayOfByte[i] = ((byte)(0x42 ^ arrayOfByte[i])); | |
} | |
return arrayOfByte; | |
} | |
} |
This file contains hidden or 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 org.teamsik.apps.hackingchallenge; | |
import android.app.Dialog; | |
import android.content.res.Resources; | |
import android.os.Bundle; | |
import android.support.v7.a.b; | |
import android.support.v7.a.u; | |
import android.util.Log; | |
import android.util.TypedValue; | |
import android.view.View; | |
import android.widget.EditText; | |
import android.widget.ImageView; | |
import android.widget.ImageView.ScaleType; | |
import android.widget.Toast; | |
public class MainActivity extends u | |
{ | |
private static final String i = MainActivity.class.getSimpleName(); | |
private EditText j = null; | |
private int a(int paramInt) | |
{ | |
return (int)TypedValue.applyDimension(1, paramInt, getResources().getDisplayMetrics()); | |
} | |
private void j() | |
{ | |
android.support.v7.a.a locala = f(); | |
locala.a(2131099669); | |
locala.b(0x10 | locala.a()); | |
ImageView localImageView = new ImageView(locala.b()); | |
localImageView.setScaleType(ImageView.ScaleType.FIT_END); | |
localImageView.setImageResource(2130837574); | |
b localb = new b(a(150), -1, 8388629); | |
localb.rightMargin = 0; | |
localb.topMargin = a(12); | |
localb.bottomMargin = a(12); | |
localImageView.setLayoutParams(localb); | |
locala.a(localImageView); | |
} | |
private void k() | |
{ | |
Dialog localDialog = new Dialog(this); | |
localDialog.requestWindowFeature(1); | |
localDialog.setTitle(2131099672); | |
localDialog.setContentView(2130968602); | |
localDialog.show(); | |
} | |
protected void onCreate(Bundle paramBundle) | |
{ | |
super.onCreate(paramBundle); | |
setContentView(2130968601); | |
j(); | |
String str = i; | |
Object[] arrayOfObject = new Object[1]; | |
arrayOfObject[0] = Integer.valueOf(1); | |
Log.i(str, String.format("Challenge Difficulty: %d", arrayOfObject)); | |
} | |
protected void onStart() | |
{ | |
super.onStart(); | |
this.j = ((EditText)findViewById(2131492944)); | |
} | |
public void verifyPasswordClick(View paramView) | |
{ | |
if (!a.a(this, this.j.getText().toString())) | |
{ | |
Toast.makeText(this, 2131099670, 1).show(); | |
return; | |
} | |
k(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment