定位支付宝删除好友函数

定位支付宝删除好友函数

通过uiautomatorviewer工具可以确定好友管理页面的Activity为:
com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity
下图中的set_delete为删除好友的按钮。通过追踪OnClick最终找到了删除好友的函数。

1
2
3
4
// OnClick
else if(arg10 == this.j) {
this.alert(((String)v1), String.format(this.getString(f.delete_alert), this.k.getDisplayName()), this.getString(f.delete), new com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$22(this), this.getString(f.cancel), new com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$23(this));
}
1
2
3
4
5
6
7
8
9
10
11
// com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$22
final class com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$22 implements DialogInterface$OnClickListener {
com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$22(ProfileSettingActivity arg1) {
this.a = arg1;
super();
}

public final void onClick(DialogInterface arg2, int arg3) {
ProfileSettingActivity.c(this.a);
}
}
1
2
3
4
5
// ProfileSettingActivity.c
static void c(ProfileSettingActivity arg3) {
arg3.showProgressDialog(null);
Observable.create(new com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$4(arg3)).subscribeOn(Schedulers.from(ThreadExecutorUtil.acquireUrgentExecutor())).observeOn(AndroidSchedulers.mainThread()).subscribe(new com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$2(arg3), new com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$3(arg3));
}
1
2
3
4
5
6
7
8
9
10
11
12
// com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$4
final class com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$4 implements ObservableOnSubscribe {
com.alipay.android.phone.wallet.profileapp.ui.ProfileSettingActivity$4(ProfileSettingActivity arg1) {
this.a = arg1;
super();
}

public final void subscribe(ObservableEmitter arg2) {
arg2.onNext(Boolean.valueOf(ProfileSettingActivity.d(this.a)));
arg2.onComplete();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// ProfileSettingActivity.d
static boolean d(ProfileSettingActivity arg4) {
boolean v0_2;
HandleRelationReq v0 = new HandleRelationReq();
v0.targetUserId = arg4.k.userId;
v0.bizType = "2";
v0.alipayAccount = arg4.k.account;
HandleRelaionResult v0_1 = arg4.u.handleRelation(v0);
arg4.dismissProgressDialog();
if (v0_1 == null || ((BaseResult) v0_1).resultCode != 100) {
String v0_3 = v0_1 != null ? ((BaseResult) v0_1).resultDesc: arg4.getResources().getString(f.request_fail);
arg4.toast(v0_3, 0);
v0_2 = false;
} else {
e.a(arg4.k.userId);
v0_2 = true;
}

return v0_2;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public interface AlipayRelationManageService {
@OperationType(value="alipay.mobile.relation.friendRequest") @CheckLogin HandleRelaionResult addFriendRequest(AddFriendReq arg1);

@OperationType(value="alipay.mobile.relation.batchFriendRequest") @CheckLogin BaseResult batchAddFriendRequest(AddFriendBatchReq arg1);

@OperationType(value="alipay.mobile.relation.handleFriendship") @CheckLogin HandleRelaionResult handleRelation(HandleRelationReq arg1);

@OperationType(value="alipay.mobile.relation.setBlacked") @CheckLogin BaseResult setBlacked(SetBlackedReq arg1);

@OperationType(value="alipay.mobile.relation.setFriendConfig") @CheckLogin BaseResult setFriendConfig(SetConfigReq arg1);

@OperationType(value="alipay.mobile.relation.setRemarkName") @CheckLogin BaseResult setRemarkName(SetRemarkNameReq arg1);

@OperationType(value="alipay.mobile.relation.pb.upload") @CheckLogin AddressUploadResult upload(UploadMobileContact arg1);
}

public class HandleRelaionResult extends BaseResult implements Serializable {
public String addReqSetShowRealName;
public FriendVO friendVO;
public int toastType;

public HandleRelaionResult() {
super();
}
}

private AlipayRelationManageService u;
HandleRelaionResult v0_1 = arg4.u.handleRelation(v0);