就不放了,某交(y)友(p)app
拿到app就先拿到jadx中分析,发现这是36*加壳。
这是时候我们就要祭出脱壳神奇Youpk
Youpk的操作文档具体可以看Youpk的github,再次感谢Youpk。
我们在吧修复好的dex放在jadx中分析。
修复的很给力,也可以看出源代码基本没有混淆,这就更利于我们的分析了。
第一处
else if (this.isVip <= 1) { new CommomDialog(this, R.style.dialog, true, "成为会员才能私聊哦!", new CommomDialog.OnCloseListener() { /* class com.**.**.main.user.UserInfoActivity.AnonymousClass6 */ /* JADX WARN: Type inference failed for: r0v0, types: [android.content.Context, com.**.**.main.user.UserInfoActivity] */ @Override // com.**.**.widget.dialog.CommomDialog.OnCloseListener public void onClick(Dialog dialog, boolean z) { if (z) { UserInfoActivity.this.startActivity(new Intent((Context) UserInfoActivity.this, MembersActivity.class)); dialog.dismiss(); } } }).setTitle("温馨提示").setPositiveButton("开通会员").show(); return;
else if 里面的this.isVip
只有小于1才会进入,也就是提示让你开通会员。
第二处
if (this.isVip > 1) { Intent intent = new Intent((Context) this, (Class<?>) ChatActivity.class); intent.putExtra(UserCacheInfo.COLUMNNAME_USERIDIMID, this.user_id); intent.putExtra("userId", this.user_imid); startActivity(intent); return; } new CommomDialog(this, R.style.dialog, true, "成为会员才能私聊哦!", new CommomDialog.OnCloseListener() { /* class com.**.**.main.user.UserInfoActivity.AnonymousClass8 */ /* JADX WARN: Type inference failed for: r0v0, types: [android.content.Context, com.**.**.main.user.UserInfoActivity] */ @Override // com.u**.**.widget.dialog.CommomDialog.OnCloseListener public void onClick(Dialog dialog, boolean z) { if (z) { UserInfoActivity.this.startActivity(new Intent((Context) UserInfoActivity.this, MembersActivity.class)); dialog.dismiss(); } } }).setTitle("温馨提示").setPositiveButton("开通会员").show(); return; } return;
这里可以看到this.isVip
大于1的话就会提示“开通会员了呢”
最后
其实只要进入到this.isVip
大于1那不就,,,,嘿嘿嘿
继续分析一下这个isVip是在哪里赋值呢。查找用例。。。。。
找到啦。。我们改下返回值
我们这里frida改一下。
献上代码
这里还会有个小问题,就是这块类没在内存加载的时候会报错,这时候点下某人的主页就好了。
Java.perform(function () { var pre = Java.use("com.***.***.utils.UncleSharedPreferences"); pre.getInt.overload('android.content.Context', 'java.lang.String').implementation = function (a1, a2) { return 2; } })
看看效果。。。
发过去了。。。
但是我们需要一直用的话就要一个xposed的插件。
这里app采用的36加固,那我们就不能用常规的classloader进行hook,直接用36壳的classloader进行hook。
XposedHelpers.findAndHookMethod("com.stub.StubApp", loadPackageParam.classLoader, "attachBaseContext", Context.class, new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { super.afterHookedMethod(param); Context context = (Context) param.args[0]; ClassLoader classLoader = context.getClassLoader(); classLoaders = classLoader; XposedHelpers.findAndHookMethod("com.***.***.utils.UncleSharedPreferences", classLoader, "getInt", Context.class, String.class, new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { //设置返回值为2 param.setResult(2); } }); XposedHelpers.findAndHookMethod("com.***.***.utils.DateUtil", classLoader, "getDayDiff", Date.class, Date.class, new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { param.setResult(0L); } }); } });
好了完美。。。私聊小姐姐(**)们
发送文本消息 //创建一条文本消息,content为消息文字内容,toChatUsername为对方用户或者群聊的id,后文皆是如此 EMMessage message = EMMessage.createTxtSendMessage(content, toChatUsername); //如果是群聊,设置chattype,默认是单聊 if (chatType == CHATTYPE_GROUP) message.setChatType(ChatType.GroupChat); //发送消息 EMClient.getInstance().chatManager().sendMessage(message);ddms如下
if (this.chatFragmentHelper != null) { this.chatFragmentHelper.onSetMessageAttributes(eMMessage); } if (this.chatType == 2) { eMMessage.setChatType(EMMessage.ChatType.GroupChat); } else if (this.chatType == 3) { eMMessage.setChatType(EMMessage.ChatType.ChatRoom); } EaseUser userInfo = EaseUserUtils.getUserInfo(eMMessage.getFrom(), UncleSharedPreferences.getString(SZApplication.getContext(), UncleSharedPreferences.SP_UID)); eMMessage.setAttribute("avatar", userInfo.getAvatar()); eMMessage.setAttribute("gender", UncleSharedPreferences.getString(SZApplication.getContext(), UncleSharedPreferences.SP_USER_SEX)); eMMessage.setAttribute("name", userInfo.getNickname()); eMMessage.setAttribute("token", UncleSharedPreferences.getString(SZApplication.getContext(), UncleSharedPreferences.SP_UID)); if (UserCacheManager.getImidFromCache(this.toChatUsername) != null) { eMMessage.setAttribute("tokenTo", UserCacheManager.getImidFromCache(this.toChatUsername).getUserId()); } else { eMMessage.setAttribute("tokenTo", ""); } eMMessage.setAttribute("nameTo", eMMessage.getTo()); eMMessage.setAttribute("avatarTo", UncleSharedPreferences.getString(SZApplication.getContext(), UncleSharedPreferences.SP_TO_USER_AVATAR)); EMClient.getInstance().chatManager().saveMessage(eMMessage);知道上边的我们就可以用frida玩玩。
var to_user_id = '1000477560'; var content = '我是一个机器人你信吗'; var uid = '1000511189'; var EMMessage = Java.use("com.hyphenate.chat.EMMessage"); var eMMessage = EMMessage.createTxtSendMessage(content, to_user_id); eMMessage.setAttribute("avatar", "http://***/android/pic/1591284964")//头像 eMMessage.setAttribute("gender", "1") eMMessage.setAttribute("name", "看123了看刻录机") eMMessage.setAttribute("token", uid)//自己uid eMMessage.setAttribute("nameTo", to_user_id)//对方imid eMMessage.setAttribute("avatarTo", "") eMMessage.setAttribute("tokenTo", to_user_id) var EMClient = Java.use("com.hyphenate.chat.EMClient"); EMClient.getInstance().chatManager().saveMessage(eMMessage)
UserCacheManager.save(this.user_id, this.user_imid, this.nickname, this.avatar); EaseUser easeUser = new EaseUser(this.user_imid); easeUser.setAvatar(this.avatar); easeUser.setNickname(this.nickname); if (this.isVip > 1) { Intent intent = new Intent((Context) this, (Class<?>) ChatActivity.class); intent.putExtra(UserCacheInfo.COLUMNNAME_USERIDIMID, this.user_id); intent.putExtra("userId", this.user_imid); startActivity(intent); return; }这次用xposed实现发送消息和启动ui。
Class EMMessage = XposedHelpers.findClass("com.hyphenate.chat.EMMessage", classLoaders); Object eMMessage = XposedHelpers.callStaticMethod(EMMessage, "createTxtSendMessage", content, to_user_id); XposedHelpers.callMethod(eMMessage, "setAttribute", "avatar", avatar); XposedHelpers.callMethod(eMMessage, "setAttribute", "gender", gender); XposedHelpers.callMethod(eMMessage, "setAttribute", "name", name); XposedHelpers.callMethod(eMMessage, "setAttribute", "token", token); XposedHelpers.callMethod(eMMessage, "setAttribute", "nameTo", nameTo); XposedHelpers.callMethod(eMMessage, "setAttribute", "avatarTo", avatarTo); XposedHelpers.callMethod(eMMessage, "setAttribute", "tokenTo", tokenTo); Class EMClient = XposedHelpers.findClass("com.hyphenate.chat.EMClient", classLoaders); Object getInstance = XposedHelpers.callStaticMethod(EMClient, "getInstance"); Object chatManager = XposedHelpers.callMethod(getInstance, "chatManager"); XposedHelpers.callMethod(chatManager, "saveMessage", eMMessage); Class ChatActivity = XposedHelpers.findClass("com.***.***.main.im.ChatActivity", classLoaders); Class UserCacheManager = XposedHelpers.findClass("com.***.***.main.im.cache.UserCacheManager", classLoaders); XposedHelpers.callStaticMethod(UserCacheManager, "save", to_user_id, to_user_id, to_user_id, avatar); Class EaseUser = XposedHelpers.findClass("com.hyphenate.easeui.domain.EaseUser", classLoaders); Object easeUsernewInstance = XposedHelpers.newInstance(EaseUser, to_user_id); XposedHelpers.callMethod(easeUsernewInstance, "setNickname", to_user_id); XposedHelpers.callMethod(easeUsernewInstance, "setAvatar", avatar); Intent intentChat = new Intent(contexts, ChatActivity); intentChat.putExtra("userImId", to_user_id); intentChat.putExtra("userId", to_user_id); contexts.startActivity(intentChat);这就基本完成了。