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.
405 lines
9.5 KiB
405 lines
9.5 KiB
.class public Lcom/viatech/ClausesServiceActivity; |
|
.super Landroid/app/Activity; |
|
.source "ClausesServiceActivity.java" |
|
|
|
|
|
# instance fields |
|
.field private a:Landroid/webkit/WebView; |
|
|
|
|
|
# direct methods |
|
.method public constructor <init>()V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 20 |
|
invoke-direct {p0}, Landroid/app/Activity;-><init>()V |
|
|
|
return-void |
|
.end method |
|
|
|
.method private a(Ljava/lang/String;)V |
|
.locals 2 |
|
|
|
.prologue |
|
.line 69 |
|
:try_start_0 |
|
iget-object v0, p0, Lcom/viatech/ClausesServiceActivity;->a:Landroid/webkit/WebView; |
|
|
|
invoke-virtual {v0, p1}, Landroid/webkit/WebView;->loadUrl(Ljava/lang/String;)V |
|
:try_end_0 |
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 |
|
|
|
.line 73 |
|
:goto_0 |
|
return-void |
|
|
|
.line 70 |
|
:catch_0 |
|
move-exception v0 |
|
|
|
.line 71 |
|
const-string v1, "Vpai_ClausesServiceActivity" |
|
|
|
invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method private a(Ljava/lang/String;I)V |
|
.locals 7 |
|
|
|
.prologue |
|
const/4 v6, 0x0 |
|
|
|
const/4 v5, -0x2 |
|
|
|
const/4 v4, 0x1 |
|
|
|
.line 85 |
|
invoke-virtual {p0}, Lcom/viatech/ClausesServiceActivity;->getActionBar()Landroid/app/ActionBar; |
|
|
|
move-result-object v0 |
|
|
|
.line 86 |
|
if-nez v0, :cond_0 |
|
|
|
.line 101 |
|
:goto_0 |
|
return-void |
|
|
|
.line 88 |
|
:cond_0 |
|
invoke-virtual {v0, v4}, Landroid/app/ActionBar;->setDisplayHomeAsUpEnabled(Z)V |
|
|
|
.line 89 |
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I |
|
|
|
const/16 v2, 0x12 |
|
|
|
if-lt v1, v2, :cond_1 |
|
|
|
.line 90 |
|
invoke-virtual {v0, p2}, Landroid/app/ActionBar;->setHomeAsUpIndicator(I)V |
|
|
|
.line 91 |
|
:cond_1 |
|
const/4 v1, 0x0 |
|
|
|
invoke-virtual {v0, v1}, Landroid/app/ActionBar;->setTitle(Ljava/lang/CharSequence;)V |
|
|
|
.line 92 |
|
invoke-virtual {v0, v4}, Landroid/app/ActionBar;->setDisplayShowTitleEnabled(Z)V |
|
|
|
.line 93 |
|
invoke-virtual {v0, v6}, Landroid/app/ActionBar;->setDisplayShowHomeEnabled(Z)V |
|
|
|
.line 94 |
|
new-instance v1, Landroid/widget/TextView; |
|
|
|
invoke-direct {v1, p0}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V |
|
|
|
.line 95 |
|
invoke-virtual {v1, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V |
|
|
|
.line 96 |
|
const/4 v2, -0x1 |
|
|
|
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setTextColor(I)V |
|
|
|
.line 97 |
|
invoke-virtual {p0}, Lcom/viatech/ClausesServiceActivity;->getResources()Landroid/content/res/Resources; |
|
|
|
move-result-object v2 |
|
|
|
const v3, 0x7f0800c0 |
|
|
|
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getDimension(I)F |
|
|
|
move-result v2 |
|
|
|
invoke-virtual {v1, v6, v2}, Landroid/widget/TextView;->setTextSize(IF)V |
|
|
|
.line 98 |
|
new-instance v2, Landroid/app/ActionBar$LayoutParams; |
|
|
|
const/16 v3, 0x11 |
|
|
|
invoke-direct {v2, v5, v5, v3}, Landroid/app/ActionBar$LayoutParams;-><init>(III)V |
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/app/ActionBar;->setCustomView(Landroid/view/View;Landroid/app/ActionBar$LayoutParams;)V |
|
|
|
.line 100 |
|
invoke-virtual {v0, v4}, Landroid/app/ActionBar;->setDisplayShowCustomEnabled(Z)V |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method protected onCreate(Landroid/os/Bundle;)V |
|
.locals 5 |
|
|
|
.prologue |
|
const/4 v3, 0x1 |
|
|
|
.line 29 |
|
invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V |
|
|
|
.line 30 |
|
const v0, 0x7f03001e |
|
|
|
invoke-virtual {p0, v0}, Lcom/viatech/ClausesServiceActivity;->setContentView(I)V |
|
|
|
.line 31 |
|
invoke-static {}, Lcom/viatech/Config;->a()Lcom/viatech/Config; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v0, p0}, Lcom/viatech/Config;->a(Landroid/app/Activity;)V |
|
|
|
.line 33 |
|
invoke-virtual {p0}, Lcom/viatech/ClausesServiceActivity;->getActionBar()Landroid/app/ActionBar; |
|
|
|
move-result-object v0 |
|
|
|
.line 34 |
|
if-eqz v0, :cond_0 |
|
|
|
.line 35 |
|
invoke-virtual {p0}, Lcom/viatech/ClausesServiceActivity;->getResources()Landroid/content/res/Resources; |
|
|
|
move-result-object v1 |
|
|
|
const v2, 0x7f02023d |
|
|
|
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v0, v1}, Landroid/app/ActionBar;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V |
|
|
|
.line 36 |
|
const v0, 0x7f070042 |
|
|
|
invoke-virtual {p0, v0}, Lcom/viatech/ClausesServiceActivity;->getString(I)Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
const v1, 0x7f020081 |
|
|
|
invoke-direct {p0, v0, v1}, Lcom/viatech/ClausesServiceActivity;->a(Ljava/lang/String;I)V |
|
|
|
.line 39 |
|
:cond_0 |
|
const v0, 0x7f0c007e |
|
|
|
invoke-virtual {p0, v0}, Lcom/viatech/ClausesServiceActivity;->findViewById(I)Landroid/view/View; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Landroid/webkit/WebView; |
|
|
|
iput-object v0, p0, Lcom/viatech/ClausesServiceActivity;->a:Landroid/webkit/WebView; |
|
|
|
.line 40 |
|
iget-object v0, p0, Lcom/viatech/ClausesServiceActivity;->a:Landroid/webkit/WebView; |
|
|
|
invoke-virtual {v0}, Landroid/webkit/WebView;->getSettings()Landroid/webkit/WebSettings; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v0, v3}, Landroid/webkit/WebSettings;->setJavaScriptEnabled(Z)V |
|
|
|
.line 41 |
|
iget-object v0, p0, Lcom/viatech/ClausesServiceActivity;->a:Landroid/webkit/WebView; |
|
|
|
invoke-virtual {v0}, Landroid/webkit/WebView;->getSettings()Landroid/webkit/WebSettings; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v0, v3}, Landroid/webkit/WebSettings;->setAllowFileAccess(Z)V |
|
|
|
.line 43 |
|
invoke-virtual {p0}, Lcom/viatech/ClausesServiceActivity;->getResources()Landroid/content/res/Resources; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration; |
|
|
|
move-result-object v0 |
|
|
|
iget-object v0, v0, Landroid/content/res/Configuration;->locale:Ljava/util/Locale; |
|
|
|
.line 44 |
|
invoke-virtual {v0}, Ljava/util/Locale;->getLanguage()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
.line 45 |
|
invoke-virtual {v0}, Ljava/util/Locale;->getCountry()Ljava/lang/String; |
|
|
|
move-result-object v2 |
|
|
|
.line 46 |
|
const-string v0, "Vpai_ClausesServiceActivity" |
|
|
|
new-instance v3, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v4, "language: " |
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v3 |
|
|
|
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v3 |
|
|
|
const-string v4, ", country:" |
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v3 |
|
|
|
invoke-virtual {v3, v2}, 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 {v0, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I |
|
|
|
.line 47 |
|
const-string v0, "en" |
|
|
|
.line 48 |
|
if-eqz v1, :cond_1 |
|
|
|
if-eqz v2, :cond_1 |
|
|
|
.line 49 |
|
invoke-virtual {v1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
.line 50 |
|
invoke-virtual {v2}, Ljava/lang/String;->toLowerCase()Ljava/lang/String; |
|
|
|
move-result-object v2 |
|
|
|
.line 51 |
|
const-string v3, "zh" |
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z |
|
|
|
move-result v1 |
|
|
|
if-eqz v1, :cond_1 |
|
|
|
.line 52 |
|
const-string v1, "cn" |
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z |
|
|
|
move-result v1 |
|
|
|
if-eqz v1, :cond_2 |
|
|
|
.line 53 |
|
const-string v0, "zh" |
|
|
|
.line 62 |
|
:cond_1 |
|
:goto_0 |
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v2, "file:///android_res/raw/clause_" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, ".txt" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
.line 64 |
|
invoke-direct {p0, v0}, Lcom/viatech/ClausesServiceActivity;->a(Ljava/lang/String;)V |
|
|
|
.line 65 |
|
return-void |
|
|
|
.line 54 |
|
:cond_2 |
|
const-string v1, "tw" |
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z |
|
|
|
move-result v1 |
|
|
|
if-eqz v1, :cond_3 |
|
|
|
.line 55 |
|
const-string v0, "tw" |
|
|
|
goto :goto_0 |
|
|
|
.line 56 |
|
:cond_3 |
|
const-string v1, "hk" |
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z |
|
|
|
move-result v1 |
|
|
|
if-eqz v1, :cond_1 |
|
|
|
.line 57 |
|
const-string v0, "tw" |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z |
|
.locals 2 |
|
|
|
.prologue |
|
.line 78 |
|
invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I |
|
|
|
move-result v0 |
|
|
|
const v1, 0x102002c |
|
|
|
if-ne v0, v1, :cond_0 |
|
|
|
.line 79 |
|
invoke-virtual {p0}, Lcom/viatech/ClausesServiceActivity;->onBackPressed()V |
|
|
|
.line 81 |
|
:cond_0 |
|
const/4 v0, 0x1 |
|
|
|
return v0 |
|
.end method
|
|
|