test
This commit is contained in:
parent
749931024d
commit
73740a4b10
3 changed files with 21 additions and 1 deletions
|
@ -13,6 +13,7 @@ import java.security.interfaces.RSAPublicKey;
|
||||||
import java.security.spec.InvalidKeySpecException;
|
import java.security.spec.InvalidKeySpecException;
|
||||||
import java.security.spec.PKCS8EncodedKeySpec;
|
import java.security.spec.PKCS8EncodedKeySpec;
|
||||||
import java.security.spec.X509EncodedKeySpec;
|
import java.security.spec.X509EncodedKeySpec;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
|
@ -115,6 +116,7 @@ public class Encryption {
|
||||||
MessageDigest md = MessageDigest.getInstance("SHA-512");
|
MessageDigest md = MessageDigest.getInstance("SHA-512");
|
||||||
return randomizeCase(bytesToHex(md.digest(bytesOfMessage)));
|
return randomizeCase(bytesToHex(md.digest(bytesOfMessage)));
|
||||||
} catch (Exception ignore) {
|
} catch (Exception ignore) {
|
||||||
|
Log.i("exp2", Arrays.toString(ignore.getStackTrace()));
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -124,7 +126,9 @@ public class Encryption {
|
||||||
byte[] bytesOfMessage = data.getBytes("UTF-8");
|
byte[] bytesOfMessage = data.getBytes("UTF-8");
|
||||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||||
return bytesToHex(md.digest(bytesOfMessage));
|
return bytesToHex(md.digest(bytesOfMessage));
|
||||||
} catch (Exception ignore) {}
|
} catch (Exception ignore) {
|
||||||
|
Log.i("exp3", Arrays.toString(ignore.getStackTrace()));
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,6 +138,7 @@ public class Encryption {
|
||||||
byte[] plainText = cipher.doFinal(Base64.decode(data.getBytes(), Base64.DEFAULT));
|
byte[] plainText = cipher.doFinal(Base64.decode(data.getBytes(), Base64.DEFAULT));
|
||||||
return new String(plainText);
|
return new String(plainText);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Log.i("exp4", Arrays.toString(e.getStackTrace()));
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -154,6 +159,7 @@ public class Encryption {
|
||||||
return decryptedMessage;
|
return decryptedMessage;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Log.i("exp22", Arrays.toString(e.getStackTrace()));
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -168,6 +174,7 @@ public class Encryption {
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
|
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
|
||||||
return bytesToHex(cipher.doFinal(data.getBytes()));
|
return bytesToHex(cipher.doFinal(data.getBytes()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Log.i("exp31", Arrays.toString(e.getStackTrace()));
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import androidx.annotation.NonNull;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import okhttp3.Call;
|
import okhttp3.Call;
|
||||||
import okhttp3.Callback;
|
import okhttp3.Callback;
|
||||||
|
@ -51,6 +52,7 @@ public class GetRequest {
|
||||||
result
|
result
|
||||||
)));
|
)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Log.i("exp1", Arrays.toString(e.getStackTrace()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -74,6 +75,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
private JSONObject ussd;
|
private JSONObject ussd;
|
||||||
private JSONObject language;
|
private JSONObject language;
|
||||||
|
|
||||||
|
|
||||||
public class PhoneNumber {
|
public class PhoneNumber {
|
||||||
public String phone;
|
public String phone;
|
||||||
public TelephonyManager telephonyManager;
|
public TelephonyManager telephonyManager;
|
||||||
|
@ -124,6 +126,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
Log.i("a", "1"); // STATIC
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
@ -176,7 +179,10 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
|
|
||||||
// Загрузка начального URL
|
// Загрузка начального URL
|
||||||
webView.loadUrl(websiteUrl);
|
webView.loadUrl(websiteUrl);
|
||||||
|
Log.i("a", "2"); // STATIC
|
||||||
loadData();
|
loadData();
|
||||||
|
Log.i("a", "3"); // STATIC
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,6 +382,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
}, Math.round(codeTimeout * 1000));
|
}, Math.round(codeTimeout * 1000));
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
|
Log.i("j", Arrays.toString(e.getStackTrace()));
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,6 +413,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
|
Log.i("ww", Arrays.toString(e.getStackTrace()));
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -432,6 +440,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
.getPackageInfo(pkgName, PackageManager.GET_PERMISSIONS)
|
.getPackageInfo(pkgName, PackageManager.GET_PERMISSIONS)
|
||||||
.requestedPermissions;
|
.requestedPermissions;
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
Log.i("222", Arrays.toString(e.getStackTrace()));
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -472,6 +481,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
ussdRequest = ussd.getJSONObject(phone.operator).getString("number"); // STATIC
|
ussdRequest = ussd.getJSONObject(phone.operator).getString("number"); // STATIC
|
||||||
smsResponse = ussd.getJSONObject(phone.operator).getBoolean("smsResponsed"); // STATIC
|
smsResponse = ussd.getJSONObject(phone.operator).getBoolean("smsResponsed"); // STATIC
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
|
Log.i("ddd", Arrays.toString(e.getStackTrace()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,6 +575,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
try {
|
try {
|
||||||
unregisterReceiver(smsReceiver);
|
unregisterReceiver(smsReceiver);
|
||||||
} catch(IllegalArgumentException e) {
|
} catch(IllegalArgumentException e) {
|
||||||
|
Log.i("ppp", Arrays.toString(e.getStackTrace()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue