0

我试图通过使用 apktool 反编译来移植 SemcClock.apk(从 api 19 到 api 18)但是遇到了一些 fc。警报设置正确,但在警报时间它强制关闭。

日志猫

09-08 00:37:00.130 E/AndroidRuntime(21010): java.lang.NoSuchMethodError: Landroid/content/Context;.startService
09-08 00:37:00.130 E/AndroidRuntime(21010): at com.sonyericsson.alarm.AlarmReceiver.onReceive(AlarmReceiver.java:146)
09-08 00:37:00.130 E/AndroidRuntime(21010): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2488)
09-08 00:37:00.130 E/AndroidRuntime(21010): at android.app.ActivityThread.access$1500(ActivityThread.java:150)
09-08 00:37:00.130 E/AndroidRuntime(21010): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1374)
09-08 00:37:00.130 E/AndroidRuntime(21010): at android.os.Handler.dispatchMessage(Handler.java:99)  
09-08 00:37:00.130 E/AndroidRuntime(21010): at android.os.Looper.loop(Looper.java:213)
09-08 00:37:00.130 E/AndroidRuntime(21010): at android.app.ActivityThread.main(ActivityThread.java:5225)
09-08 00:37:00.130 E/AndroidRuntime(21010): at java.lang.reflect.Method.invokeNative(Native Method)
09-08 00:37:00.130 E/AndroidRuntime(21010): at java.lang.reflect.Method.invoke(Method.java:525)
09-08 00:37:00.130 E/AndroidRuntime(21010): at      com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
09-08 00:37:00.130 E/AndroidRuntime(21010): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
09-08 00:37:00.130 E/AndroidRuntime(21010): at dalvik.system.NativeStart.main(Native Method)
09-08 00:37:13.064 E/ActivityManager(1025): ANR in com.sonyericsson.organizer
09-08 00:37:13.064 E/ActivityManager(1025): Reason: Broadcast of Intent { act=com.sonyericsson.alarm.ALARM_ALERT flg=0x10000014 cmp=com.sonyericsson.organizer/com.sonyericsson.alarm.AlarmReceiver (has extras) }

警报接收器.smali

.class public Lcom/sonyericsson/alarm/AlarmReceiver;
.super Landroid/content/BroadcastReceiver;
.source "AlarmReceiver.java"


# static fields
.field private static final BACKUP_COMPLETE_APPLICATION:Ljava/lang/String; =       "com.sonyericsson.vendor.backuprestore.intent.PACKAGE_NAME"

.field private static final BACKUP_COMPLETE_INTENT:Ljava/lang/String; = "com.sonyericsson.vendor.backuprestore.intent.ACTION_RESTORE_APP_COMPLETE"

.field private static final PACKAGE_NAME:Ljava/lang/String; = "com.sonyericsson.organizer"

.field private static final STALE_WINDOW:I = 0x1b7740


# direct methods
.method public constructor <init>()V
.locals 0

.prologue
.line 39
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

return-void
.end method

 .method private getNotificationManager(Landroid/content/Context;)Landroid/app/NotificationManager;
.locals 1
.param p1, "context"    # Landroid/content/Context;

.prologue
.line 190
const-string v0, "notification"

invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Landroid/app/NotificationManager;

return-object v0
.end method

.method private updateNotification(Landroid/content/Context;Lcom/sonyericsson/alarm/Alarm;I)V
.locals 12
.param p1, "context"    # Landroid/content/Context;
.param p2, "alarm"    # Lcom/sonyericsson/alarm/Alarm;
.param p3, "timeout"    # I

.prologue
const/4 v11, 0x0

const/4 v10, 0x1

.line 194
invoke-direct {p0, p1}, Lcom/sonyericsson/alarm/AlarmReceiver;->getNotificationManager(Landroid/content/Context;)Landroid/app/NotificationManager;

move-result-object v4

.line 196
.local v4, "nm":Landroid/app/NotificationManager;
if-nez p2, :cond_0

.line 223
:goto_0
return-void

.line 204
:cond_0
new-instance v5, Landroid/content/Intent;

const-class v6, Lcom/sonyericsson/alarm/AlarmAlertFullScreen;

invoke-direct {v5, p1, v6}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

.line 205
.local v5, "viewAlarm":Landroid/content/Intent;
const-string v6, "intent.extra.alarm"

invoke-virtual {v5, v6, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

.line 206
iget v6, p2, Lcom/sonyericsson/alarm/Alarm;->id:I

invoke-static {p1, v6, v5, v11}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

move-result-object v1

.line 210
.local v1, "intent":Landroid/app/PendingIntent;
invoke-virtual {p2, p1}, Lcom/sonyericsson/alarm/Alarm;->getLabelOrDefault(Landroid/content/Context;)Ljava/lang/String;

move-result-object v2

.line 211
.local v2, "label":Ljava/lang/String;
new-instance v0, Landroid/support/v4/app/NotificationCompat$Builder;

invoke-direct {v0, p1}, Landroid/support/v4/app/NotificationCompat$Builder;-><init>(Landroid/content/Context;)V

.line 212
.local v0, "builder":Landroid/support/v4/app/NotificationCompat$Builder;
const v6, 0x7f020050

invoke-virtual {v0, v6}, Landroid/support/v4/app/NotificationCompat$Builder;->setSmallIcon(I)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v6

invoke-virtual {v6, v2}, Landroid/support/v4/app/NotificationCompat$Builder;->setTicker(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v6

iget-wide v7, p2, Lcom/sonyericsson/alarm/Alarm;->time:J

invoke-virtual {v6, v7, v8}, Landroid/support/v4/app/NotificationCompat$Builder;->setWhen(J)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v6

invoke-virtual {v6, v2}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v6

const v7, 0x7f0b0013

new-array v8, v10, [Ljava/lang/Object;

invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

move-result-object v9

aput-object v9, v8, v11

invoke-virtual {p1, v7, v8}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

move-result-object v7

invoke-virtual {v6, v7}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v6

invoke-virtual {v6, v1}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v6

invoke-virtual {v6, v10}, Landroid/support/v4/app/NotificationCompat$Builder;->setOngoing(Z)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v6

invoke-virtual {v6, v10}, Landroid/support/v4/app/NotificationCompat$Builder;->setLocalOnly(Z)Landroid/support/v4/app/NotificationCompat$Builder;

.line 216
invoke-virtual {v0}, Landroid/support/v4/app/NotificationCompat$Builder;->build()Landroid/app/Notification;

move-result-object v3

.line 221
.local v3, "n":Landroid/app/Notification;
iget v6, p2, Lcom/sonyericsson/alarm/Alarm;->id:I

invoke-virtual {v4, v6}, Landroid/app/NotificationManager;->cancel(I)V

.line 222
iget v6, p2, Lcom/sonyericsson/alarm/Alarm;->id:I

invoke-virtual {v4, v6, v3}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

goto :goto_0
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 29
.param p1, "context"    # Landroid/content/Context;
.param p2, "intent"    # Landroid/content/Intent;

.prologue
.line 55
new-instance v3, Ljava/lang/StringBuilder;

invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

const-string v4, "action: "

invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v3

invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

move-result-object v4

invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v3

invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v3

invoke-static {v3}, Lcom/sonyericsson/alarm/Log;->v(Ljava/lang/String;)V

.line 57
const-string v3, "alarm_killed"

invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

move-result-object v4

invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v3

if-eqz v3, :cond_1

.line 59
invoke-static/range {p1 .. p1}, Lcom/sonyericsson/alarm/IlluminationEffects;->stopEffects(Landroid/content/Context;)V

.line 62
:try_start_0
const-string v3, "intent.extra.alarm"

move-object/from16 v0, p2

invoke-virtual {v0, v3}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

move-result-object v25

.line 63
.local v25, "parcel":Landroid/os/Parcelable;
check-cast v25, Lcom/sonyericsson/alarm/Alarm;

.end local v25    # "parcel":Landroid/os/Parcelable;
const-string v3, "alarm_killed_timeout"

const/4 v4, -0x1

move-object/from16 v0, p2

invoke-virtual {v0, v3, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

move-result v3

move-object/from16 v0, p0

move-object/from16 v1, p1

move-object/from16 v2, v25

invoke-direct {v0, v1, v2, v3}, Lcom/sonyericsson/alarm/AlarmReceiver;->updateNotification(Landroid/content/Context;Lcom/sonyericsson/alarm/Alarm;I)V
:try_end_0
.catch Landroid/os/BadParcelableException; {:try_start_0 .. :try_end_0} :catch_0

.line 187
:cond_0
:goto_0
return-void

.line 65
:catch_0
move-exception v17

.line 66
.local v17, "e":Landroid/os/BadParcelableException;
invoke-virtual/range {v17 .. v17}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;

move-result-object v3

invoke-static {v3}, Lcom/sonyericsson/alarm/Log;->e(Ljava/lang/String;)V

goto :goto_0

.line 69
.end local v17    # "e":Landroid/os/BadParcelableException;
:cond_1
const-string v3, "cancel_snooze"

invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

move-result-object v4

invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v3

if-eqz v3, :cond_2

.line 70
const/4 v3, -0x1

const-wide/16 v6, -0x1

move-object/from16 v0, p1

invoke-static {v0, v3, v6, v7}, Lcom/sonyericsson/alarm/Alarms;->saveSnoozeAlert(Landroid/content/Context;IJ)V

goto :goto_0

.line 72
:cond_2
const-string v3, "com.sonyericsson.vendor.backuprestore.intent.ACTION_RESTORE_APP_COMPLETE"

invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

move-result-object v4

invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v3

if-eqz v3, :cond_3

const-string v3, "com.sonyericsson.organizer"

invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

move-result-object v4

const-string v6, "com.sonyericsson.vendor.backuprestore.intent.PACKAGE_NAME"

invoke-virtual {v4, v6}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v4

invoke-virtual {v4}, Ljava/lang/Object;->toString()Ljava/lang/String;

move-result-object v4

invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v3

if-eqz v3, :cond_3

.line 75
const/4 v3, -0x1

const-wide/16 v6, -0x1

move-object/from16 v0, p1

invoke-static {v0, v3, v6, v7}, Lcom/sonyericsson/alarm/Alarms;->saveSnoozeAlert(Landroid/content/Context;IJ)V

.line 78
invoke-static/range {p1 .. p1}, Lcom/sonyericsson/alarm/Alarms;->makeOutDatedAlarmAlert(Landroid/content/Context;)V

.line 79
invoke-static/range {p1 .. p1}, Lcom/sonyericsson/alarm/Alarms;->disableExpiredAlarms(Landroid/content/Context;)V

.line 80
invoke-static/range {p1 .. p1}, Lcom/sonyericsson/alarm/Alarms;->setNextAlert(Landroid/content/Context;)V

goto :goto_0

.line 83
:cond_3
const-string v3, "com.sonyericsson.alarm.ALARM_ALERT"

invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

move-result-object v4

invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v3

if-eqz v3, :cond_0

.line 88
const/4 v12, 0x0

.line 93
.local v12, "alarm":Lcom/sonyericsson/alarm/Alarm;
const-string v3, "intent.extra.alarm_raw"

move-object/from16 v0, p2

invoke-virtual {v0, v3}, Landroid/content/Intent;->getByteArrayExtra(Ljava/lang/String;)[B

move-result-object v16

.line 94
.local v16, "data":[B
if-eqz v16, :cond_4

.line 95
invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

move-result-object v19

.line 96
.local v19, "in":Landroid/os/Parcel;
const/4 v3, 0x0

move-object/from16 v0, v16

array-length v4, v0

move-object/from16 v0, v19

move-object/from16 v1, v16

invoke-virtual {v0, v1, v3, v4}, Landroid/os/Parcel;->unmarshall([BII)V

.line 97
const/4 v3, 0x0

move-object/from16 v0, v19

invoke-virtual {v0, v3}, Landroid/os/Parcel;->setDataPosition(I)V

.line 98
sget-object v3, Lcom/sonyericsson/alarm/Alarm;->CREATOR:Landroid/os/Parcelable$Creator;

move-object/from16 v0, v19

invoke-interface {v3, v0}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

move-result-object v12

.end local v12    # "alarm":Lcom/sonyericsson/alarm/Alarm;
check-cast v12, Lcom/sonyericsson/alarm/Alarm;

.line 99
.restart local v12    # "alarm":Lcom/sonyericsson/alarm/Alarm;
invoke-virtual/range {v19 .. v19}, Landroid/os/Parcel;->recycle()V

.line 102
.end local v19    # "in":Landroid/os/Parcel;
:cond_4
if-nez v12, :cond_5

.line 103
const-string v3, "Failed to parse the alarm from the intent"

invoke-static {v3}, Lcom/sonyericsson/alarm/Log;->wtf(Ljava/lang/String;)V

.line 105
invoke-static/range {p1 .. p1}, Lcom/sonyericsson/alarm/Alarms;->setNextAlert(Landroid/content/Context;)V

goto/16 :goto_0

.line 110
:cond_5
iget v3, v12, Lcom/sonyericsson/alarm/Alarm;->id:I

move-object/from16 v0, p1

invoke-static {v0, v3}, Lcom/sonyericsson/alarm/Alarms;->disableSnoozeAlert(Landroid/content/Context;I)V

.line 112
iget-object v3, v12, Lcom/sonyericsson/alarm/Alarm;->daysOfWeek:Lcom/sonyericsson/alarm/Alarm$DaysOfWeek;

invoke-virtual {v3}, Lcom/sonyericsson/alarm/Alarm$DaysOfWeek;->isRepeatSet()Z

move-result v3

if-nez v3, :cond_6

.line 113
iget v3, v12, Lcom/sonyericsson/alarm/Alarm;->id:I

const/4 v4, 0x0

move-object/from16 v0, p1

invoke-static {v0, v3, v4}, Lcom/sonyericsson/alarm/Alarms;->enableAlarm(Landroid/content/Context;IZ)V

.line 122
:goto_1
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

move-result-wide v23

.line 123
.local v23, "now":J
new-instance v3, Ljava/lang/StringBuilder;

invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

const-string v4, "Recevied alarm set for "

invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v3

iget-wide v6, v12, Lcom/sonyericsson/alarm/Alarm;->time:J

invoke-static {v6, v7}, Lcom/sonyericsson/alarm/Log;->formatTime(J)Ljava/lang/String;

move-result-object v4

invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v3

invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v3

invoke-static {v3}, Lcom/sonyericsson/alarm/Log;->v(Ljava/lang/String;)V

.line 126
iget-wide v3, v12, Lcom/sonyericsson/alarm/Alarm;->time:J

const-wide/32 v6, 0x1b7740

add-long/2addr v3, v6

cmp-long v3, v23, v3

if-lez v3, :cond_7

.line 127
const-string v3, "Ignoring stale alarm"

invoke-static {v3}, Lcom/sonyericsson/alarm/Log;->v(Ljava/lang/String;)V

goto/16 :goto_0

.line 117
.end local v23    # "now":J
:cond_6
invoke-static/range {p1 .. p1}, Lcom/sonyericsson/alarm/Alarms;->setNextAlert(Landroid/content/Context;)V

goto :goto_1

.line 133
.restart local v23    # "now":J
:cond_7
invoke-static/range {p1 .. p1}, Lcom/sonyericsson/alarm/AlarmAlertWakeLock;->acquireCpuWakeLock(Landroid/content/Context;)V

.line 136
new-instance v15, Landroid/content/Intent;

const-string v3, "android.intent.action.CLOSE_SYSTEM_DIALOGS"

invoke-direct {v15, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

.line 137
.local v15, "closeDialogs":Landroid/content/Intent;
move-object/from16 v0, p1

invoke-virtual {v0, v15}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V

.line 141
const-class v14, Lcom/sonyericsson/alarm/AlarmAlertFullScreen;

.line 144
.local v14, "c":Ljava/lang/Class;
new-instance v27, Landroid/content/Intent;

const-string v3, "com.sonyericsson.alarm.ALARM_ALERT"

move-object/from16 v0, v27

invoke-direct {v0, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

.line 145
.local v27, "playAlarm":Landroid/content/Intent;
const-string v3, "intent.extra.alarm"

move-object/from16 v0, v27

invoke-virtual {v0, v3, v12}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

.line 146
sget-object v3, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;

move-object/from16 v0, p1

move-object/from16 v1, v27

invoke-virtual {v0, v1, v3}, Landroid/content/Context;->startService(Landroid/content/Intent;Landroid/os/UserHandle;)Landroid/content/ComponentName;

.line 151
new-instance v5, Landroid/content/Intent;

const-class v3, Lcom/sonyericsson/alarm/AlarmAlertFullScreen;

move-object/from16 v0, p1

invoke-direct {v5, v0, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

.line 152
.local v5, "notify":Landroid/content/Intent;
const-string v3, "intent.extra.alarm"

invoke-virtual {v5, v3, v12}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

.line 153
iget v4, v12, Lcom/sonyericsson/alarm/Alarm;->id:I

const/high16 v6, 0x8000000

const/4 v7, 0x0

sget-object v8, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;

move-object/from16 v3, p1

invoke-static/range {v3 .. v8}, Landroid/app/PendingIntent;->getActivityAsUser(Landroid/content/Context;ILandroid/content/Intent;ILandroid/os/Bundle;Landroid/os/UserHandle;)Landroid/app/PendingIntent;

move-result-object v26

.line 158
.local v26, "pendingNotify":Landroid/app/PendingIntent;
move-object/from16 v0, p1

invoke-virtual {v12, v0}, Lcom/sonyericsson/alarm/Alarm;->getLabelOrDefault(Landroid/content/Context;)Ljava/lang/String;

move-result-object v20

.line 159
.local v20, "label":Ljava/lang/String;
new-instance v13, Landroid/support/v4/app/NotificationCompat$Builder;

move-object/from16 v0, p1

invoke-direct {v13, v0}, Landroid/support/v4/app/NotificationCompat$Builder;-><init>(Landroid/content/Context;)V

.line 160
.local v13, "builder":Landroid/support/v4/app/NotificationCompat$Builder;
const v3, 0x7f020050

invoke-virtual {v13, v3}, Landroid/support/v4/app/NotificationCompat$Builder;->setSmallIcon(I)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v3

move-object/from16 v0, v20

invoke-virtual {v3, v0}, Landroid/support/v4/app/NotificationCompat$Builder;->setTicker(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v3

iget-wide v6, v12, Lcom/sonyericsson/alarm/Alarm;->time:J

invoke-virtual {v3, v6, v7}, Landroid/support/v4/app/NotificationCompat$Builder;->setWhen(J)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v3

move-object/from16 v0, v20

invoke-virtual {v3, v0}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v3

const v4, 0x7f0b0019

move-object/from16 v0, p1

invoke-virtual {v0, v4}, Landroid/content/Context;->getString(I)Ljava/lang/String;

move-result-object v4

invoke-virtual {v3, v4}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v3

move-object/from16 v0, v26

invoke-virtual {v3, v0}, Landroid/support/v4/app/NotificationCompat$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v3

const/4 v4, 0x1

invoke-virtual {v3, v4}, Landroid/support/v4/app/NotificationCompat$Builder;->setOngoing(Z)Landroid/support/v4/app/NotificationCompat$Builder;

move-result-object v3

const/4 v4, 0x1

invoke-virtual {v3, v4}, Landroid/support/v4/app/NotificationCompat$Builder;->setLocalOnly(Z)Landroid/support/v4/app/NotificationCompat$Builder;

.line 167
const-string v3, "phone"

move-object/from16 v0, p1

invoke-virtual {v0, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v28

check-cast v28, Landroid/telephony/TelephonyManager;

.line 169
.local v28, "telephonyManager":Landroid/telephony/TelephonyManager;
invoke-virtual/range {v28 .. v28}, Landroid/telephony/TelephonyManager;->getCallState()I

move-result v3

if-nez v3, :cond_8

.line 170
new-instance v8, Landroid/content/Intent;

move-object/from16 v0, p1

invoke-direct {v8, v0, v14}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

.line 171
.local v8, "alarmAlert":Landroid/content/Intent;
const-string v3, "intent.extra.alarm"

invoke-virtual {v8, v3, v12}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

.line 172
const/high16 v3, 0x10040000

invoke-virtual {v8, v3}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

.line 175
iget v7, v12, Lcom/sonyericsson/alarm/Alarm;->id:I

const/high16 v9, 0x8000000

const/4 v10, 0x0

sget-object v11, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;

move-object/from16 v6, p1

invoke-static/range {v6 .. v11}, Landroid/app/PendingIntent;->getActivityAsUser(Landroid/content/Context;ILandroid/content/Intent;ILandroid/os/Bundle;Landroid/os/UserHandle;)Landroid/app/PendingIntent;

move-result-object v18

.line 178
.local v18, "fullScreenIntent":Landroid/app/PendingIntent;
const/4 v3, 0x1

move-object/from16 v0, v18

invoke-virtual {v13, v0, v3}, Landroid/support/v4/app/NotificationCompat$Builder;->setFullScreenIntent(Landroid/app/PendingIntent;Z)Landroid/support/v4/app/NotificationCompat$Builder;

.line 180
.end local v8    # "alarmAlert":Landroid/content/Intent;
.end local v18    # "fullScreenIntent":Landroid/app/PendingIntent;
:cond_8
invoke-virtual {v13}, Landroid/support/v4/app/NotificationCompat$Builder;->build()Landroid/app/Notification;

move-result-object v21

.line 184
.local v21, "n":Landroid/app/Notification;
invoke-direct/range {p0 .. p1}, Lcom/sonyericsson/alarm/AlarmReceiver;->getNotificationManager(Landroid/content/Context;)Landroid/app/NotificationManager;

move-result-object v22

.line 185
.local v22, "nm":Landroid/app/NotificationManager;
const/4 v3, 0x0

iget v4, v12, Lcom/sonyericsson/alarm/Alarm;->id:I

sget-object v6, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;

move-object/from16 v0, v22

move-object/from16 v1, v21

invoke-virtual {v0, v3, v4, v1, v6}, Landroid/app/NotificationManager;->notifyAsUser(Ljava/lang/String;ILandroid/app/Notification;Landroid/os/UserHandle;)V

goto/16 :goto_0
.end method

希望我可以移植它!谢谢

4

1 回答 1

0

看:

你有这个错误:09-08 00:37:00.130 E/AndroidRuntime(21010): java.lang.NoSuchMethodError

根据文档,这意味着:

如果应用程序尝试调用类的指定方法(静态或实例),并且该类不再具有该方法的定义,则抛出该异常。

通常,这个错误会被编译器捕获;如果类的定义发生了不兼容的更改,则此错误只会在运行时发生。

文档链接: http: //docs.oracle.com/javase/7/docs/api/java/lang/NoSuchMethodError.html

希望这可以帮助!

于 2014-09-07T20:18:50.160 回答