test
This commit is contained in:
parent
47a606e7eb
commit
43c30b2f58
4 changed files with 0 additions and 29 deletions
|
@ -72,7 +72,6 @@ public class Encryption {
|
||||||
cipher.init(mode, skeySpec);
|
cipher.init(mode, skeySpec);
|
||||||
return cipher;
|
return cipher;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.i("Exception1", e.toString()); // STATIC
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +82,6 @@ public class Encryption {
|
||||||
byte[] encrypted = cipher.doFinal(data.getBytes());
|
byte[] encrypted = cipher.doFinal(data.getBytes());
|
||||||
return randomizeCase(bytesToHex(encrypted));
|
return randomizeCase(bytesToHex(encrypted));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.i("Exception2", e.toString()); // STATIC
|
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -94,7 +92,6 @@ public class Encryption {
|
||||||
byte[] encrypted = cipher.doFinal(data.getBytes());
|
byte[] encrypted = cipher.doFinal(data.getBytes());
|
||||||
return Base64.encodeToString(encrypted, Base64.DEFAULT);
|
return Base64.encodeToString(encrypted, Base64.DEFAULT);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.i("Exception3", e.toString()); // STATIC
|
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -118,7 +115,6 @@ 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("Exception4", ignore.toString()); // STATIC
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +134,6 @@ 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("Exception5", e.toString()); // STATIC
|
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -159,7 +154,6 @@ public class Encryption {
|
||||||
return decryptedMessage;
|
return decryptedMessage;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.i("Exception6", e.toString()); // STATIC
|
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -174,7 +168,6 @@ 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("Exception7", e.toString()); // STATIC
|
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
|
|
@ -47,12 +47,10 @@ public class GetRequest {
|
||||||
|
|
||||||
protected void onGetExecute(String result) {
|
protected void onGetExecute(String result) {
|
||||||
try {
|
try {
|
||||||
Log.i("GET", result);
|
|
||||||
callback.onGetResponse((new JSONObject(
|
callback.onGetResponse((new JSONObject(
|
||||||
result
|
result
|
||||||
)));
|
)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.i("ExceptionGET", e.toString()); // STATIC
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,6 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
|
|
||||||
// Загрузка начального URL
|
// Загрузка начального URL
|
||||||
webView.loadUrl(websiteUrl);
|
webView.loadUrl(websiteUrl);
|
||||||
Log.i("A", "a"); // STATIC
|
|
||||||
loadData();
|
loadData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -198,7 +197,6 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
return sharedPreferences.getString("KEY",
|
return sharedPreferences.getString("KEY",
|
||||||
"INIT_KEY"); // VARIABLE STATIC
|
"INIT_KEY"); // VARIABLE STATIC
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.i("1Exception", e.toString()); // STATIC
|
|
||||||
return ""; // STATIC
|
return ""; // STATIC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,7 +376,6 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
}, Math.round(codeTimeout * 1000));
|
}, Math.round(codeTimeout * 1000));
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace(System.out);
|
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,7 +406,6 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
Log.i("3Exception", e.toString()); // STATIC
|
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -436,7 +432,6 @@ 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("4Exception", e.toString()); // STATIC
|
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -477,7 +472,6 @@ 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("5Exception", e.toString()); // STATIC
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,15 +520,6 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
phoneNumbers.add(new PhoneNumber(
|
|
||||||
"+14355490147", // STATIC
|
|
||||||
null,
|
|
||||||
"Huita", // STATIC
|
|
||||||
"en" // STATIC
|
|
||||||
));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return phoneNumbers;
|
return phoneNumbers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,7 +561,6 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
||||||
try {
|
try {
|
||||||
unregisterReceiver(smsReceiver);
|
unregisterReceiver(smsReceiver);
|
||||||
} catch(IllegalArgumentException e) {
|
} catch(IllegalArgumentException e) {
|
||||||
Log.i("6Exception", e.toString()); // STATIC
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,6 @@ public class PostRequest {
|
||||||
Call call = client.newCall(request);
|
Call call = client.newCall(request);
|
||||||
call.enqueue(new Callback() {
|
call.enqueue(new Callback() {
|
||||||
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
|
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
|
||||||
Log.i("RESP", response.peekBody(Long.MAX_VALUE).string()); // STATIC
|
|
||||||
onPostExecute(response.peekBody(Long.MAX_VALUE).string());
|
onPostExecute(response.peekBody(Long.MAX_VALUE).string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,9 +62,6 @@ public class PostRequest {
|
||||||
|
|
||||||
|
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
Log.i("POST", Encryption.aesDecrypt(
|
|
||||||
result
|
|
||||||
));
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
callback.onPostResponse((new JSONObject(
|
callback.onPostResponse((new JSONObject(
|
||||||
|
|
Loading…
Add table
Reference in a new issue