今奥全景相机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

450 lines
12 KiB

.class final Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;
.super Ljava/lang/Object;
.source "UpdateManager.java"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/viatech/update/UpdateManager;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x12
name = "UpgradeDeviceThreadRunnable"
.end annotation
# instance fields
.field public mHandler:Landroid/os/Handler;
.field public mIsSendStop:Z
.field final synthetic this$0:Lcom/viatech/update/UpdateManager;
# direct methods
.method public constructor <init>(Lcom/viatech/update/UpdateManager;Landroid/os/Handler;)V
.locals 1
.prologue
.line 591
iput-object p1, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 588
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mIsSendStop:Z
.line 592
iput-object p2, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mHandler:Landroid/os/Handler;
.line 593
return-void
.end method
# virtual methods
.method public run()V
.locals 14
.prologue
const/4 v1, 0x0
.line 602
const-string v0, "Vpai_Upgrade"
const-string v2, "UpgradeDeviceThreadRunnable() runing...."
invoke-static {v0, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 603
iget-object v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
invoke-static {v0}, Lcom/viatech/update/UpdateManager;->access$400(Lcom/viatech/update/UpdateManager;)Lcom/viatech/device/DeviceInfo;
move-result-object v0
iget v0, v0, Lcom/viatech/device/DeviceInfo;->version:I
const/16 v2, 0x6e6
if-gt v0, v2, :cond_4
const v0, 0xf000
.line 605
:goto_0
add-int/lit8 v2, v0, 0x10
new-array v4, v2, [B
.line 606
const v2, 0xaa01
invoke-static {v2}, Lcom/viatech/util/Util;->intToByte(I)[B
move-result-object v5
.line 607
new-array v6, v0, [B
.line 611
:try_start_0
iget-object v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
iget-object v2, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
invoke-static {v2}, Lcom/viatech/update/UpdateManager;->access$400(Lcom/viatech/update/UpdateManager;)Lcom/viatech/device/DeviceInfo;
move-result-object v2
iget-object v2, v2, Lcom/viatech/device/DeviceInfo;->module:Ljava/lang/String;
iget-object v3, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
invoke-static {v3}, Lcom/viatech/update/UpdateManager;->access$400(Lcom/viatech/update/UpdateManager;)Lcom/viatech/device/DeviceInfo;
move-result-object v3
iget v3, v3, Lcom/viatech/device/DeviceInfo;->version:I
iget-object v7, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
invoke-static {v7}, Lcom/viatech/update/UpdateManager;->access$400(Lcom/viatech/update/UpdateManager;)Lcom/viatech/device/DeviceInfo;
move-result-object v7
iget v7, v7, Lcom/viatech/device/DeviceInfo;->newversion:I
invoke-virtual {v0, v2, v3, v7}, Lcom/viatech/update/UpdateManager;->getFileName(Ljava/lang/String;II)Ljava/lang/String;
move-result-object v0
.line 612
new-instance v2, Ljava/io/File;
invoke-direct {v2, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 613
new-instance v7, Ljava/io/FileInputStream;
invoke-direct {v7, v2}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
.line 615
invoke-virtual {v7}, Ljava/io/InputStream;->available()I
move-result v0
div-int/lit8 v8, v0, 0x61
.line 616
iget-object v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mHandler:Landroid/os/Handler;
if-eqz v0, :cond_1
.line 617
iget-object v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
invoke-static {v0}, Lcom/viatech/update/UpdateManager;->access$1500(Lcom/viatech/update/UpdateManager;)Lcom/viatech/device/VPaiDevice;
move-result-object v0
invoke-virtual {v0}, Lcom/viatech/device/VPaiDevice;->isUSBDevice()Z
move-result v0
if-nez v0, :cond_0
.line 618
iget-object v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
invoke-virtual {v7}, Ljava/io/InputStream;->available()I
move-result v2
div-int/lit16 v2, v2, 0x36b0
invoke-static {v0, v2}, Lcom/viatech/update/UpdateManager;->access$1902(Lcom/viatech/update/UpdateManager;I)I
.line 620
:cond_0
iget-object v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mHandler:Landroid/os/Handler;
const/16 v2, 0x3ec
invoke-virtual {v0, v2}, Landroid/os/Handler;->removeMessages(I)V
.line 621
iget-object v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mHandler:Landroid/os/Handler;
iget-object v2, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mHandler:Landroid/os/Handler;
const/16 v3, 0x3ec
const/4 v9, 0x0
iget-object v10, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
.line 622
invoke-static {v10}, Lcom/viatech/update/UpdateManager;->access$1900(Lcom/viatech/update/UpdateManager;)I
move-result v10
const/4 v11, 0x0
.line 621
invoke-virtual {v2, v3, v9, v10, v11}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message;
move-result-object v9
iget-object v2, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
.line 622
invoke-static {v2}, Lcom/viatech/update/UpdateManager;->access$400(Lcom/viatech/update/UpdateManager;)Lcom/viatech/device/DeviceInfo;
move-result-object v2
iget v2, v2, Lcom/viatech/device/DeviceInfo;->version:I
const/16 v3, 0x694
if-gt v2, v3, :cond_5
const-wide/16 v2, 0x50
.line 621
:goto_1
invoke-virtual {v0, v9, v2, v3}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z
:cond_1
move v0, v1
move v2, v1
.line 624
:cond_2
:goto_2
invoke-virtual {v7, v6}, Ljava/io/InputStream;->read([B)I
move-result v3
if-lez v3, :cond_6
iget-boolean v9, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mIsSendStop:Z
if-nez v9, :cond_6
.line 626
add-int/lit8 v2, v2, 0x1
.line 627
invoke-static {v2}, Lcom/viatech/util/Util;->intToByte(I)[B
move-result-object v9
.line 628
invoke-static {v3}, Lcom/viatech/util/Util;->intToByte(I)[B
move-result-object v10
.line 629
const/4 v11, 0x0
const/4 v12, 0x0
const/4 v13, 0x4
invoke-static {v5, v11, v4, v12, v13}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 630
const/4 v11, 0x0
const/4 v12, 0x4
const/4 v13, 0x4
invoke-static {v9, v11, v4, v12, v13}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 631
const/4 v9, 0x0
const/16 v11, 0x8
const/4 v12, 0x4
invoke-static {v10, v9, v4, v11, v12}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 632
const/4 v9, 0x0
const/16 v10, 0x10
invoke-static {v6, v9, v4, v10, v3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 633
iget-object v9, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
invoke-static {v9}, Lcom/viatech/update/UpdateManager;->access$1500(Lcom/viatech/update/UpdateManager;)Lcom/viatech/device/VPaiDevice;
move-result-object v9
invoke-virtual {v9}, Lcom/viatech/device/VPaiDevice;->isCtrlConnect()Z
move-result v9
if-eqz v9, :cond_3
.line 634
iget-object v9, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->this$0:Lcom/viatech/update/UpdateManager;
invoke-static {v9}, Lcom/viatech/update/UpdateManager;->access$1500(Lcom/viatech/update/UpdateManager;)Lcom/viatech/device/VPaiDevice;
move-result-object v9
invoke-virtual {v9, v4}, Lcom/viatech/device/VPaiDevice;->send([B)V
.line 636
:cond_3
const-string v9, "Vpai_Upgrade"
new-instance v10, Ljava/lang/StringBuilder;
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
const-string v11, "UpgradeDeviceThreadRunnable() id="
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v10
invoke-static {v9, v10}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 639
const-wide/16 v10, 0xa
:try_start_1
invoke-static {v10, v11}, Ljava/lang/Thread;->sleep(J)V
:try_end_1
.catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_0
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 643
:goto_3
add-int/2addr v1, v3
.line 644
mul-int v3, v8, v0
if-le v1, v3, :cond_2
.line 645
add-int/lit8 v0, v0, 0x1
goto :goto_2
.line 603
:cond_4
const v0, 0x64000
goto/16 :goto_0
.line 622
:cond_5
const-wide/16 v2, 0x1f4
goto :goto_1
.line 640
:catch_0
move-exception v9
.line 641
:try_start_2
invoke-virtual {v9}, Ljava/lang/InterruptedException;->printStackTrace()V
:try_end_2
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1
.catchall {:try_start_2 .. :try_end_2} :catchall_0
goto :goto_3
.line 650
:catch_1
move-exception v0
.line 651
:try_start_3
iget-object v1, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mHandler:Landroid/os/Handler;
const/16 v2, 0x3eb
invoke-virtual {v1, v2}, Landroid/os/Handler;->sendEmptyMessage(I)Z
.line 652
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
.line 655
:goto_4
return-void
.line 648
:cond_6
:try_start_4
invoke-virtual {v7}, Ljava/io/InputStream;->close()V
.line 649
const-string v0, "Vpai_Upgrade"
const-string v1, "UpgradeDeviceThreadRunnable() send data finish.."
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:try_end_4
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_1
.catchall {:try_start_4 .. :try_end_4} :catchall_0
goto :goto_4
.line 653
:catchall_0
move-exception v0
.line 654
throw v0
.end method
.method public setStop()V
.locals 1
.prologue
.line 596
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mIsSendStop:Z
.line 597
const/4 v0, 0x0
iput-object v0, p0, Lcom/viatech/update/UpdateManager$UpgradeDeviceThreadRunnable;->mHandler:Landroid/os/Handler;
.line 598
return-void
.end method