一个适合练手的小app,不涉及native层的分析
jadx打开,直接搜索vip字符串

定位到com.eumlab.prometronome.baselib.util.UserCache的isPro方法
这里把hook掉isPro的返回值为true就可以直接使用vip功能了

但是点进去用户界面会直接闪退,应该是后续对user中CustomerVip的实例进行了操作,但我们直接hook的isPro所以导致其实user的vip成员仍然为null


所以我们只需手动构造一个CustomerVip并调用该user实例的setVip方法就可以了
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 29 30 31 32 33 34 35
| function main(){ Java.perform(function(){
var String = Java.use("java.lang.String"); var CustomerVip = Java.use("com.eumlab.prometronome.baselib.data.db.entity.CustomerVip")
var MyCustomerVip = CustomerVip.$new(); var MyCustomerVip_level = String.$new("114514"); var MyCustomer_customerId = String.$new("114514"); var MyCustomer_startDate = String.$new("114514-14-19"); var MyCustomer_endDate = String.$new("114513-14-19"); var MyCustomerVip_level = String.$new("114514");
MyCustomerVip.setStatus(1) MyCustomerVip.setVipLevel(MyCustomerVip_level); MyCustomerVip.setStartDate(MyCustomer_startDate) MyCustomerVip.setEndDate(MyCustomer_endDate) MyCustomerVip.setCustomerId(MyCustomer_customerId) dumpAllFieldValue(MyCustomerVip)
var User = Java.use("com.eumlab.prometronome.baselib.data.db.entity.User") var getVip = User.getVip getVip.implementation = function(){ this.setVip(MyCustomerVip) var result = this.getVip() console.log("getVip => ", result) return result } }) } setImmediate(main)
|
最后结果
