Skip to content

Commit

Permalink
修改语法
Browse files Browse the repository at this point in the history
  • Loading branch information
qwe7002 committed Oct 30, 2019
1 parent cbf2f19 commit 3a50a52
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private void receive_handle(JsonObject result_obj) {
break;
}
Thread.sleep(100);
count++;
++count;
}
Thread.sleep(1000);
} catch (InterruptedException e) {
Expand Down Expand Up @@ -337,7 +337,7 @@ private void receive_handle(JsonObject result_obj) {
String msg_send_to = public_func.get_send_phone_number(msg_send_list[1]);
if (public_func.is_phone_number(msg_send_to)) {
StringBuilder msg_send_content = new StringBuilder();
for (int i = 2; i < msg_send_list.length; i++) {
for (int i = 2; i < msg_send_list.length; ++i) {
if (msg_send_list.length != 3 && i != 2) {
msg_send_content.append("\n");
}
Expand Down Expand Up @@ -618,7 +618,7 @@ public void run() {
public_func.write_log(context, "Connection to the Telegram API service failed,try again after " + sleep_time + " seconds.");
magnification = 1;
if (error_magnification <= 59) {
error_magnification++;
++error_magnification;
}
try {
Thread.sleep(sleep_time * 1000);
Expand All @@ -645,7 +645,7 @@ public void run() {
}
}
if (magnification <= 11) {
magnification++;
++magnification;
}
} else {
public_func.write_log(context, "response code:" + response.code());
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/qwe7002/telegram_rc/public_func.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static int parse_int(String int_str) {

static String get_send_phone_number(String phone_number) {
StringBuilder result = new StringBuilder();
for (int i = 0; i < phone_number.length(); i++) {
for (int i = 0; i < phone_number.length(); ++i) {
char c = phone_number.charAt(i);
if (c == '+' || Character.isDigit(c)) {
result.append(c);
Expand Down Expand Up @@ -476,7 +476,7 @@ static String read_file_last_line(Context context, @SuppressWarnings("SameParame
if (count == (line - 1)) {
break;
}
count++;
++count;
}
}
return builder.toString();
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/com/qwe7002/telegram_rc/sms_receiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void onReceive(final Context context, Intent intent) {
Object[] pdus = (Object[]) extras.get("pdus");
assert pdus != null;
final SmsMessage[] messages = new SmsMessage[pdus.length];
for (int i = 0; i < pdus.length; i++) {
for (int i = 0; i < pdus.length; ++i) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
String format = extras.getString("format");
messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i], format);
Expand Down Expand Up @@ -143,7 +143,7 @@ public void onReceive(final Context context, Intent intent) {
} catch (InterruptedException e) {
e.printStackTrace();
}
loop_count++;
++loop_count;
}
String status = context.getString(R.string.action_failed);
WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
Expand All @@ -169,7 +169,7 @@ public void onReceive(final Context context, Intent intent) {
break;
}
Thread.sleep(100);
count++;
++count;
}
Thread.sleep(1000);//Wait 3 second to avoid startup failure
} catch (InterruptedException e) {
Expand All @@ -196,7 +196,7 @@ public void onReceive(final Context context, Intent intent) {
} catch (InterruptedException e) {
e.printStackTrace();
}
loop_count++;
++loop_count;
}
}
raw_request_body_text = context.getString(R.string.system_message_head) + "\n" + context.getString(R.string.switch_data);
Expand All @@ -215,7 +215,7 @@ public void onReceive(final Context context, Intent intent) {
String msg_send_to = public_func.get_send_phone_number(msg_send_list[0]);
if (public_func.is_phone_number(msg_send_to) && msg_send_list.length != 1) {
StringBuilder msg_send_content = new StringBuilder();
for (int i = 1; i < msg_send_list.length; i++) {
for (int i = 1; i < msg_send_list.length; ++i) {
if (msg_send_list.length != 2 && i != 1) {
msg_send_content.append("\n");
}
Expand Down

0 comments on commit 3a50a52

Please sign in to comment.