From 3a50a529f0af769d583e591df7e5102f2b810428 Mon Sep 17 00:00:00 2001 From: qwe7002 Date: Wed, 30 Oct 2019 20:41:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/qwe7002/telegram_rc/chat_command_service.java | 8 ++++---- .../main/java/com/qwe7002/telegram_rc/public_func.java | 4 ++-- .../java/com/qwe7002/telegram_rc/sms_receiver.java | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/qwe7002/telegram_rc/chat_command_service.java b/app/src/main/java/com/qwe7002/telegram_rc/chat_command_service.java index df9c3dc7..c3bc81dc 100644 --- a/app/src/main/java/com/qwe7002/telegram_rc/chat_command_service.java +++ b/app/src/main/java/com/qwe7002/telegram_rc/chat_command_service.java @@ -289,7 +289,7 @@ private void receive_handle(JsonObject result_obj) { break; } Thread.sleep(100); - count++; + ++count; } Thread.sleep(1000); } catch (InterruptedException e) { @@ -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"); } @@ -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); @@ -645,7 +645,7 @@ public void run() { } } if (magnification <= 11) { - magnification++; + ++magnification; } } else { public_func.write_log(context, "response code:" + response.code()); diff --git a/app/src/main/java/com/qwe7002/telegram_rc/public_func.java b/app/src/main/java/com/qwe7002/telegram_rc/public_func.java index 918f64e6..98c474a0 100644 --- a/app/src/main/java/com/qwe7002/telegram_rc/public_func.java +++ b/app/src/main/java/com/qwe7002/telegram_rc/public_func.java @@ -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); @@ -476,7 +476,7 @@ static String read_file_last_line(Context context, @SuppressWarnings("SameParame if (count == (line - 1)) { break; } - count++; + ++count; } } return builder.toString(); diff --git a/app/src/main/java/com/qwe7002/telegram_rc/sms_receiver.java b/app/src/main/java/com/qwe7002/telegram_rc/sms_receiver.java index 9aecd6b9..7478429e 100644 --- a/app/src/main/java/com/qwe7002/telegram_rc/sms_receiver.java +++ b/app/src/main/java/com/qwe7002/telegram_rc/sms_receiver.java @@ -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); @@ -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); @@ -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) { @@ -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); @@ -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"); }