Minister 发表于 2022-2-14 12:35

Anyview 本地(补充)

本帖最后由 Minister 于 2022-2-14 12:58 编辑

上一贴 https://www.52pojie.cn/thread-1584601-1-1.html

此次更改的效果图:


用到的工具:

[*]Android Killer
[*]jadx-gui-1.2.0-no-jre-win.exe



更改过程:
1.搜索关键词 "上传至A盘"


2.用jadx 搜关键词"upload_file_to_a_disk"

百度一下adapter 适配器
猜:com.anyview.core.AppShelfAdapter 是App的适配,宏观
    com.anyview.core.FileIndexAdapter是APP下主观文件索引的适配,等级低于App的适配
应该点进去com.anyview.core.AppShelfAdapter,(万一错了,重来{:1_918:})
    @Override // com.anyview.api.core.AbsBaseAdapter
    public void showPopMenu(int position) {
      super.showPopMenu(position);
      String fullPath = ((ReaderHistoryBean) this.mDataHolders.get((this.mDataHolders.size() - 1) - this.selection)).getFullpath();
      Activity activity = this.mActivity;
      BaseDialog.Builder builder = new BaseDialog.Builder(activity);
      String[] stringlist = ((fullPath == null || !fullPath.endsWith(".aikan")) && fullPath != null && !"".equals(fullPath)) ? new String[]{activity.getString(C0031R.string.delete), activity.getString(C0031R.string.property), activity.getString(C0031R.string.replace_cover), activity.getString(C0031R.string.rename), activity.getString(C0031R.string.upload_file_to_a_disk)} : new String[]{activity.getString(C0031R.string.delete), activity.getString(C0031R.string.property), activity.getString(C0031R.string.replace_cover), activity.getString(C0031R.string.rename)};
      String path = ((ReaderHistoryBean) this.mDataHolders.get((this.mDataHolders.size() - 1) - this.selection)).getFullpath();
      if (path.endsWith(".html") || path.endsWith(".htm")) {
            stringlist = new String[]{activity.getString(C0031R.string.delete), activity.getString(C0031R.string.property), activity.getString(C0031R.string.replace_cover)};
      }
      builder.setItems(stringlist, this);
      builder.create().setCanceledOnTouchOutside(true);
      builder.show();
    }

对比一下


修改位置如图




以下是改完后的完整代码
.method protected showPopMenu(I)V
    .locals 14
    .param p1, "position"    # I

    .prologue
    const v13, 0x7f0600c6

    const/4 v12, 0x3

    const/4 v11, 0x2

    const/4 v10, 0x0

    const/4 v9, 0x1

    .line 309
    invoke-super {p0, p1}, Lcom/anyview/api/core/AbsBaseAdapter;->showPopMenu(I)V

    .line 310
    iget-object v6, p0, Lcom/anyview/core/AppShelfAdapter;->mDataHolders:Ljava/util/ArrayList;

    .line 311
    iget-object v7, p0, Lcom/anyview/core/AppShelfAdapter;->mDataHolders:Ljava/util/ArrayList;

    invoke-virtual {v7}, Ljava/util/ArrayList;->size()I

    move-result v7

    add-int/lit8 v7, v7, -0x1

    iget v8, p0, Lcom/anyview/core/AppShelfAdapter;->selection:I

    sub-int/2addr v7, v8

    .line 310
    invoke-virtual {v6, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Lcom/anyview/reader/bean/ReaderHistoryBean;

    .line 311
    invoke-virtual {v6}, Lcom/anyview/reader/bean/ReaderHistoryBean;->getFullpath()Ljava/lang/String;

    move-result-object v2

    .line 312
    .local v2, "fullPath":Ljava/lang/String;
    iget-object v0, p0, Lcom/anyview/core/AppShelfAdapter;->mActivity:Lcom/anyview/api/core/HandlerActivity;

    .line 313
    .local v0, "activity":Landroid/app/Activity;
    new-instance v1, Lcom/anyview/api/core/BaseDialog$Builder;

    invoke-direct {v1, v0}, Lcom/anyview/api/core/BaseDialog$Builder;-><init>(Landroid/app/Activity;)V

    .line 314
    .local v1, "builder":Lcom/anyview/api/core/BaseDialog$Builder;
    const/4 v5, 0x0

    .line 315
    .local v5, "stringlist":[Ljava/lang/String;
    if-eqz v2, :cond_0

    const-string v6, ".aikan"

    invoke-virtual {v2, v6}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v6

    if-nez v6, :cond_1

    :cond_0
    if-eqz v2, :cond_1

    .line 316
    const-string v6, ""

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

    move-result v6

    if-eqz v6, :cond_4

    .line 317
    :cond_1
    const/4 v6, 0x4

    new-array v5, v6, [Ljava/lang/String;

    .line 319
    .end local v5    # "stringlist":[Ljava/lang/String;
    invoke-virtual {v0, v13}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v10

    .line 320
    const v6, 0x7f0600c9

    invoke-virtual {v0, v6}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v9

    .line 321
    const v6, 0x7f0600c7

    invoke-virtual {v0, v6}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v11

    .line 322
    const v6, 0x7f060116

    invoke-virtual {v0, v6}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v12

    .line 333
    .restart local v5    # "stringlist":[Ljava/lang/String;
    :goto_0
    iget-object v6, p0, Lcom/anyview/core/AppShelfAdapter;->mDataHolders:Ljava/util/ArrayList;

    iget-object v7, p0, Lcom/anyview/core/AppShelfAdapter;->mDataHolders:Ljava/util/ArrayList;

    invoke-virtual {v7}, Ljava/util/ArrayList;->size()I

    move-result v7

    add-int/lit8 v7, v7, -0x1

    .line 334
    iget v8, p0, Lcom/anyview/core/AppShelfAdapter;->selection:I

    sub-int/2addr v7, v8

    .line 333
    invoke-virtual {v6, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/anyview/reader/bean/ReaderHistoryBean;

    .line 335
    .local v4, "rh":Lcom/anyview/reader/bean/ReaderHistoryBean;
    invoke-virtual {v4}, Lcom/anyview/reader/bean/ReaderHistoryBean;->getFullpath()Ljava/lang/String;

    move-result-object v3

    .line 336
    .local v3, "path":Ljava/lang/String;
    const-string v6, ".html"

    invoke-virtual {v3, v6}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v6

    if-nez v6, :cond_2

    const-string v6, ".htm"

    invoke-virtual {v3, v6}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_3

    .line 337
    :cond_2
    new-array v5, v12, [Ljava/lang/String;

    .line 339
    .end local v5    # "stringlist":[Ljava/lang/String;
    invoke-virtual {v0, v13}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v10

    .line 340
    const v6, 0x7f0600c9

    invoke-virtual {v0, v6}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v9

    .line 341
    const v6, 0x7f0600c7

    invoke-virtual {v0, v6}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v11

    .line 344
    .restart local v5    # "stringlist":[Ljava/lang/String;
    :cond_3
    invoke-virtual {v1, v5, p0}, Lcom/anyview/api/core/BaseDialog$Builder;->setItems([Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Lcom/anyview/api/core/BaseDialog$Builder;

    .line 345
    invoke-virtual {v1}, Lcom/anyview/api/core/BaseDialog$Builder;->create()Lcom/anyview/api/core/BaseDialog;

    move-result-object v6

    invoke-virtual {v6, v9}, Lcom/anyview/api/core/BaseDialog;->setCanceledOnTouchOutside(Z)V

    .line 346
    invoke-virtual {v1}, Lcom/anyview/api/core/BaseDialog$Builder;->show()Lcom/anyview/api/core/BaseDialog;

    .line 347
    return-void

    .line 324
    .end local v3    # "path":Ljava/lang/String;
    .end local v4    # "rh":Lcom/anyview/reader/bean/ReaderHistoryBean;
    :cond_4
    const/4 v6, 0x4 # 这里是创建文本型数组及元素个数,屏蔽掉一个 在元数组成员数基础上减掉一个 改为0x4

    new-array v5, v6, [Ljava/lang/String;

    .line 326
    .end local v5    # "stringlist":[Ljava/lang/String;
    invoke-virtual {v0, v13}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v10

    .line 327
    const v6, 0x7f0600c9

    invoke-virtual {v0, v6}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v9

    .line 328
    const v6, 0x7f0600c7

    invoke-virtual {v0, v6}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v11

    .line 329
    const v6, 0x7f060116

    invoke-virtual {v0, v6}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v12

    #const/4 v6, 0x4屏蔽索引及内容

    .line 330
    #const v7, 0x7f0601d4

    #invoke-virtual {v0, v7}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    #move-result-object v7

    #aput-object v7, v5, v6

    .line 324
    .restart local v5    # "stringlist":[Ljava/lang/String;
    goto :goto_0
.end method








Dboykey 发表于 2022-2-14 12:56

学习到了!谢谢大神分享经验

ulife 发表于 2022-2-14 13:54

感谢分享,如果能提供本版成品APP链接就更好了

cl19980429 发表于 2022-2-14 14:12

学习了, 感谢分享

臭味香头 发表于 2022-2-14 14:16

楼主的目的是取消上传A盘菜单吗?

鑫鑫鑫鑫 发表于 2022-2-14 14:16

感谢分享,学习了

我今天是大佬 发表于 2022-2-14 14:42

学习了, 有空研究, 感谢分享

lwlwss 发表于 2022-2-14 14:46

伸手党默默点赞寻找下成品:Dweeqw

fkuejinn 发表于 2022-2-14 15:07

最新的成品有分享吗,伸手党点赞~~

df2k 发表于 2022-2-14 15:47

教程很详尽, 感谢分享
页: [1] 2 3
查看完整版本: Anyview 本地(补充)