hamburger3975 发表于 2024-6-6 18:54

向大佬求助软件权限问题

现有一个企业内部通讯录软件,因为权限有限,有些人的联系方式无法显示,但是对方来电话的时候会有提示,我尝试修改过permission为1(默认为6)但是可能不匹配,然后全部联系人都显示不出来,看看哪位大佬可以指点一下,要怎么通过NP来修改这个权限。

const-string v4, "token"

    .line 159
    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v2, v4}, Lcom/mz/li/DataManage/SettingDM;->setToken(Landroid/content/Context;Ljava/lang/String;)V

    const-string v4, "phone"

    .line 160
    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v2, v4}, Lcom/mz/li/DataManage/SettingDM;->setMyPhoneNumb(Landroid/content/Context;Ljava/lang/String;)V

    const-string v4, "name"

    .line 161
    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v2, v4}, Lcom/mz/li/DataManage/SettingDM;->setMyName(Landroid/content/Context;Ljava/lang/String;)V

    const-string v4, "group_type"

    .line 163
    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 164
    invoke-static {v4}, Lcom/mz/li/Tool/StringTool;->isBank(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_36

    const-string v4, "-1"

    .line 167
    :cond_36
    invoke-static {v4}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-static {v2, v4}, Lcom/mz/li/DataManage/SettingDM;->setMyShortNumType(Landroid/content/Context;I)V

    const-string v4, "permission"

    .line 168
    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v4

    invoke-static {v2, v4}, Lcom/mz/li/DataManage/SettingDM;->setMyPowerGlass(Landroid/content/Context;I)V

    const-string v4, "category_2"

    .line 169
    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v4

    invoke-static {v2, v4}, Lcom/mz/li/DataManage/SettingDM;->setMyGroupCategory(Landroid/content/Context;I)V

    const-string v4, "date"

    .line 170
    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/mz/li/DataManage/SettingDM;->setMyRegestTime(Landroid/content/Context;Ljava/lang/String;)V

    .line 171
    iget-object v3, p0, Lcom/mz/li/DataManage/ServiceSettingDM$5$1;->this$1:Lcom/mz/li/DataManage/ServiceSettingDM$5;

    iget-object v3, v3, Lcom/mz/li/DataManage/ServiceSettingDM$5;->val$code:Ljava/lang/String;

    invoke-static {v2, v3}, Lcom/mz/li/DataManage/SettingDM;->setMyCode(Landroid/content/Context;Ljava/lang/String;)V

    .line 173
    invoke-static {v2}, Lcom/mz/li/DB/DbHelp;->initCDb(Landroid/content/Context;)Lcom/mz/li/DB/CDBHelper;

    move-result-object v3

    invoke-virtual {v3}, Lcom/mz/li/DB/CDBHelper;->getReadableDatabase()Lnet/sqlcipher/database/SQLiteDatabase;

    move-result-object v3

    .line 174
    new-instance v4, Ljava/lang/StringBuilder;

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

    invoke-static {v2}, Lcom/mz/li/DataManage/SettingDM;->getMyGroupCateory(Landroid/content/Context;)I

    move-result v5

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

    const-string v5, ""

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

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

    move-result-object v4

    const-string v5, "select * from zq_num_category_2 where zq_index=? "

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

    aput-object v4, v6, v1

    .line 176
    invoke-virtual {v3, v5, v6}, Lnet/sqlcipher/database/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Lnet/sqlcipher/Cursor;

    move-result-object v4

    .line 178
    invoke-interface {v4}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v5

    if-eqz v5, :cond_a9

    const-string v5, "zq_name"

    .line 179
    invoke-interface {v4, v5}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v5

    invoke-interface {v4, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    .line 180
    invoke-static {v2, v5}, Lcom/mz/li/DataManage/SettingDM;->setMyGroupName(Landroid/content/Context;Ljava/lang/String;)V

    .line 183
    :cond_a9
    invoke-interface {v4}, Landroid/database/Cursor;->close()V

    .line 184
    invoke-virtual {v3}, Lnet/sqlcipher/database/SQLiteDatabase;->close()V
    :try_end_af
    .catch Lorg/json/JSONException; {:try_start_2 .. :try_end_af} :catch_b1

    const/4 v0, 0x0

    goto :goto_b5

    :catch_b1
    move-exception v1

    .line 187
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    :goto_b5
    if-eqz v0, :cond_c3

    .line 191
    iget-object v0, p0, Lcom/mz/li/DataManage/ServiceSettingDM$5$1;->this$1:Lcom/mz/li/DataManage/ServiceSettingDM$5;

    iget-object v0, v0, Lcom/mz/li/DataManage/ServiceSettingDM$5;->this$0:Lcom/mz/li/DataManage/ServiceSettingDM;

    iget-object v1, p0, Lcom/mz/li/DataManage/ServiceSettingDM$5$1;->this$1:Lcom/mz/li/DataManage/ServiceSettingDM$5;

    iget-object v1, v1, Lcom/mz/li/DataManage/ServiceSettingDM$5;->val$callBack:Lcom/cowherd/component/net/SzCallBack;

    invoke-virtual {v0, v1, p1}, Lcom/mz/li/DataManage/ServiceSettingDM;->callErrorInMainThread(Lcom/cowherd/component/net/SzCallBack;Lcom/cowherd/component/net/SzResponse;)V

    goto :goto_ce

    .line 193
    :cond_c3
    iget-object v0, p0, Lcom/mz/li/DataManage/ServiceSettingDM$5$1;->this$1:Lcom/mz/li/DataManage/ServiceSettingDM$5;

    iget-object v0, v0, Lcom/mz/li/DataManage/ServiceSettingDM$5;->this$0:Lcom/mz/li/DataManage/ServiceSettingDM;

    iget-object v1, p0, Lcom/mz/li/DataManage/ServiceSettingDM$5$1;->this$1:Lcom/mz/li/DataManage/ServiceSettingDM$5;

    iget-object v1, v1, Lcom/mz/li/DataManage/ServiceSettingDM$5;->val$callBack:Lcom/cowherd/component/net/SzCallBack;

    invoke-virtual {v0, v1, p1}, Lcom/mz/li/DataManage/ServiceSettingDM;->callSuccessInMainThread(Lcom/cowherd/component/net/SzCallBack;Lcom/cowherd/component/net/SzResponse;)V

    :goto_ce
    return-void
.end method

pxhzai 发表于 2024-6-7 03:48

在分析你提供的代码片段后,特别是关于权限的部分,看到以下代码段在处理权限:

```smali
const-string v4, "permission"

.line 168
invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

move-result-object v4

invoke-static {v4}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

move-result-object v4

invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

move-result v4

invoke-static {v2, v4}, Lcom/mz/li/DataManage/SettingDM;->setMyPowerGlass(Landroid/content/Context;I)V
```

这段代码从 JSON 对象中提取 "permission" 字段,并将其转换为 Integer,最终调用 `setMyPowerGlass` 方法设置权限。

要修改权限以确保所有联系人的联系方式显示,可以尝试以下步骤:

1. **理解权限值**:确保你清楚不同权限值代表的含义。例如,默认的 `permission` 为 6,修改为 1 导致所有联系人不可见。你需要确定哪个值(或值的范围)能显示所有联系人的联系方式。

2. **修改权限值**:通过反编译和修改 APK 文件来调整权限值。你可能需要使用 APK 反编译工具,例如 `apktool`,并修改相关的 smali 文件。

3. **重新编译和签名 APK**:完成修改后,使用 `apktool` 重新编译 APK 文件,并使用正确的签名工具重新签名 APK。

假设你已经成功反编译 APK,可以尝试修改 `setMyPowerGlass` 的调用:

```smali
const-string v4, "permission"

.line 168
invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

move-result-object v4

invoke-static {v4}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

move-result-object v4

# 修改权限值为一个你认为合适的值,比如 2
const/4 v5, 0x2

invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

move-result v4

invoke-static {v2, v4}, Lcom/mz/li/DataManage/SettingDM;->setMyPowerGlass(Landroid/content/Context;I)V
```

这个修改的目的是将权限直接设置为 2(假设 2 是合适的权限值),而不是从 JSON 对象中读取。

**注意**:修改 APK 和权限需要一定的技术背景和工具支持。如果你不确定具体的权限值,建议与开发人员或技术支持联系,确保修改不会引起其他问题。
页: [1]
查看完整版本: 向大佬求助软件权限问题