Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhinianblog committed Feb 29, 2024
1 parent 6d09aa6 commit 36e874a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
8 changes: 8 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
defaultConfig {
applicationId "com.iwhalecloud.demo"
minSdk 28
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/iwhalecloud/demo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnI
private String serverUrl;

//定义下拉列表需要显示的文本数组
private final static String[] starArray = {"ark.leafxxx.win", "login.ouklc.com"};
private final static String[] starArray = {"ark.leafxxx.win", "login.ouklc.com", "jd.222798.xyz"};


private BroadcastReceiver receiver = new BroadcastReceiver() {
Expand Down
33 changes: 18 additions & 15 deletions app/src/main/java/com/iwhalecloud/demo/SMS/MyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,21 +214,21 @@ private Notification getNotification(String title, String message) {
// 唯一的通知通道的id.
String notificationChannelId = "notification_channel_id_01";
// Android8.0以上的系统,新建消息通道
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// //用户可见的通道名称
// String channelName = "Foreground Service Notification";
// //通道的重要程度
// int importance = NotificationManager.IMPORTANCE_HIGH;
// NotificationChannel notificationChannel = new NotificationChannel(notificationChannelId, channelName, importance);
// notificationChannel.setDescription("Channel description");
// //LED灯
// notificationChannel.enableLights(false);
// //震动
// notificationChannel.enableVibration(false);
// if (notificationManager != null) {
// notificationManager.createNotificationChannel(notificationChannel);
// }
// }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//用户可见的通道名称
String channelName = "Foreground Service Notification";
//通道的重要程度
int importance = NotificationManager.IMPORTANCE_HIGH;
NotificationChannel notificationChannel = new NotificationChannel(notificationChannelId, channelName, importance);
notificationChannel.setDescription("Channel description");
//LED灯
notificationChannel.enableLights(false);
//震动
notificationChannel.enableVibration(false);
if (notificationManager != null) {
notificationManager.createNotificationChannel(notificationChannel);
}
}

NotificationCompat.Builder builder = new NotificationCompat.Builder(this, notificationChannelId);
//通知小图标
Expand Down Expand Up @@ -358,6 +358,9 @@ public void onChange(boolean selfChange, Uri uri) {
if (smsUrlList.contains(uri.toString()) || uri.toString().contains("content://sms/raw") || uri.toString().equals("content://sms") || uri.toString().equals("content://sms/inbox-insert")) {
return;
}
if(!uri.toString().startsWith("content://sms/inbox")) {
return;
}
smsUrlList.add(uri.toString());
setSmsCode();
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">京东ck续期</string>
<string name="app_name">京东一键登录</string>
</resources>

0 comments on commit 36e874a

Please sign in to comment.