smali-如何在此代码中设置一些永久文本
smali-how to set some permanent text in this code
以下 smali 代码从字符串中获取 url,然后我们可以将 link 共享给其他应用程序。但我想发送一些永久文本而不是 url 或从字符串返回的文本。例如,我想分享 "hello, how are you" 而不是从字符串中获取的临时文本。那么我应该在下面的smali代码中更改什么来实现这个?
.line 512
const-string v2, "android.intent.action.SEND"
invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 513
const-string v2, "android.intent.extra.SUBJECT"
iget-object v3, p0, Lcom/myapp/c/b/q;->t:Lcom/myapp/a/b/c;
iget-object v3, v3, Lcom/myapp/a/b/c;->d:Ljava/lang/String;
invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 514
const-string v2, "android.intent.extra.TEXT"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
iget-object v4, p0, Lcom/myapp/c/b/q;->t:Lcom/myapp/a/b/c;
iget-object v4, v4, Lcom/myapp/a/b/c;->d:Ljava/lang/String;
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
const-string v4, "\n\n"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v3, "\n\n"
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v3, v6, Lcom/myapp/a/a/n;->c:Ljava/lang/String;
invoke-static {v3}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;
move-result-object v3
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, v2, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 515
const-string v0, "text/plain"
invoke-virtual {v1, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 516
const v0, 0x7f020126
.line 517
invoke-virtual {p0, v0}, Lcom/myapp/c/b/q;->getString(I)Ljava/lang/String;
move-result-object v0
.line 518
invoke-static {v1, v0}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p0, v0}, Lcom/myapp/c/b/q;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.catch Ljava/lang/Error; {:try_start_0 .. :try_end_0} :catch_1
goto :goto_0
.line 519
:catch_0
move-exception v0
invoke-static {v0}, Lcom/myapp/d/e;->a(Ljava/lang/Exception;)V
goto :goto_0
.line 520
:catch_1
move-exception v0
您的代码的某些 类 被混淆了,但通过一些猜测我们可以发现连接 html 文本的部分在这里:
iget-object v3, v6, Lcom/myapp/a/a/n;->c:Ljava/lang/String;
invoke-static {v3}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;
move-result-object v3
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v0
如果我没记错的话,在 v0 中有将与其他应用共享的字符串:
invoke-virtual {v1, v2, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
以下 smali 代码从字符串中获取 url,然后我们可以将 link 共享给其他应用程序。但我想发送一些永久文本而不是 url 或从字符串返回的文本。例如,我想分享 "hello, how are you" 而不是从字符串中获取的临时文本。那么我应该在下面的smali代码中更改什么来实现这个?
.line 512
const-string v2, "android.intent.action.SEND"
invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 513
const-string v2, "android.intent.extra.SUBJECT"
iget-object v3, p0, Lcom/myapp/c/b/q;->t:Lcom/myapp/a/b/c;
iget-object v3, v3, Lcom/myapp/a/b/c;->d:Ljava/lang/String;
invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 514
const-string v2, "android.intent.extra.TEXT"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
iget-object v4, p0, Lcom/myapp/c/b/q;->t:Lcom/myapp/a/b/c;
iget-object v4, v4, Lcom/myapp/a/b/c;->d:Ljava/lang/String;
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
const-string v4, "\n\n"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v3, "\n\n"
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v3, v6, Lcom/myapp/a/a/n;->c:Ljava/lang/String;
invoke-static {v3}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;
move-result-object v3
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, v2, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 515
const-string v0, "text/plain"
invoke-virtual {v1, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 516
const v0, 0x7f020126
.line 517
invoke-virtual {p0, v0}, Lcom/myapp/c/b/q;->getString(I)Ljava/lang/String;
move-result-object v0
.line 518
invoke-static {v1, v0}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p0, v0}, Lcom/myapp/c/b/q;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.catch Ljava/lang/Error; {:try_start_0 .. :try_end_0} :catch_1
goto :goto_0
.line 519
:catch_0
move-exception v0
invoke-static {v0}, Lcom/myapp/d/e;->a(Ljava/lang/Exception;)V
goto :goto_0
.line 520
:catch_1
move-exception v0
您的代码的某些 类 被混淆了,但通过一些猜测我们可以发现连接 html 文本的部分在这里:
iget-object v3, v6, Lcom/myapp/a/a/n;->c:Ljava/lang/String;
invoke-static {v3}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;
move-result-object v3
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v0
如果我没记错的话,在 v0 中有将与其他应用共享的字符串:
invoke-virtual {v1, v2, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;