美文网首页
晚上调试的代码

晚上调试的代码

作者: 我在等你回复可你没回 | 来源:发表于2019-06-13 00:29 被阅读0次
    package com.wenfengtou.xposedsimpledemo;
    
    import android.database.Cursor;
    import android.graphics.drawable.Drawable;
    import android.util.Log;
    
    import java.util.ArrayList;
    import java.util.Collection;
    
    import de.robv.android.xposed.IXposedHookLoadPackage;
    import de.robv.android.xposed.XC_MethodHook;
    import de.robv.android.xposed.XposedBridge;
    import de.robv.android.xposed.XposedHelpers;
    import de.robv.android.xposed.callbacks.XC_LoadPackage;
    
    public class HookMain implements IXposedHookLoadPackage {
        private static final String TAG = "HookMain";
        @Override
        public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
            if(!lpparam.packageName.equals("tv.danmaku.bili")) return;
            XposedBridge.log("wenfengtou start tv.danmaku.bili");
            Log.i(TAG,"wenfengtou start tv.danmaku.bili");
    
            XposedHelpers.findAndHookMethod("com.bilibili.magicasakura.widgets.TintImageView", lpparam.classLoader, "setImageDrawable", Drawable.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i("setImageDrawable", "setImageDrawable"  + param.args[0], new Throwable());
                    param.args[1] = 0;
                }
            });
    
            Class recyclerViewClass = XposedHelpers.findClass("android.support.v7.widget.RecyclerView", lpparam.classLoader);
            XposedHelpers.findAndHookMethod("com.bilibili.app.comm.comment2.comments.view.y$4", lpparam.classLoader, "a", recyclerViewClass, int.class, int.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i("wenfengy", "wenfengy" , new Throwable());
                    param.args[1] = 0;
                }
            });
    
            Class recyclerViewmClass = XposedHelpers.findClass("android.support.v7.widget.RecyclerView.m", lpparam.classLoader);
            XposedHelpers.findAndHookMethod("android.support.v7.widget.RecyclerView", lpparam.classLoader, "addOnScrollListener", recyclerViewmClass, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i("addOnScrollListener", "addOnScrollListener" , new Throwable());
                }
            });
    
            XposedHelpers.findAndHookMethod("android.databinding.ObservableArrayList", lpparam.classLoader, "addAll",Collection.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Collection collection =(Collection) param.args[0];
                    Log.i("ObservableArrayList", "ObservableArrayList" , new Throwable());
                    Log.i("ObservableArrayList", "collection size" + collection.size() + collection);
                }
            });
    
            XposedHelpers.findAndHookMethod("com.bilibili.app.comm.comment2.comments.view.ab", lpparam.classLoader, "run", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i("view.ab", "view.ab" , new Throwable());
                }
            });
    
            XposedHelpers.findAndHookMethod("b.evp$3", lpparam.classLoader, "run", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i("b.evp", "b.evp" , new Throwable());
                }
            });
    
            XposedHelpers.findAndHookMethod("android.view.ViewRootImpl", lpparam.classLoader, "requestLayout", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i("requestLayout", "requestLayout" , new Throwable());
                }
            });
    
    
    
    
    
    
    
    
            ClassLoader classLoader = lpparam.classLoader;
            Class<?> accountManagerClass = classLoader.loadClass("com.tencent.weread.account.model.AccountManager");
            Class<?> accountClass = classLoader.loadClass("com.tencent.weread.model.domain.Account");
            Log.i(TAG,"wenfengtou load accountClass " + accountClass);
            if (accountClass != null) {
                XposedBridge.log("wenfengtou load class " + accountClass.toString());
                Log.i(TAG,"wenfengtou load class " + accountClass.toString());
            }
            /*888888888888888888888888888888888*/
            XposedHelpers.findAndHookMethod("com.tencent.weread.account.model.AccountManager", lpparam.classLoader, "saveAccount", accountClass, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Object accountObj = param.args[0];
                    Log.i(TAG, "afterHookedMethod saveAccount");
                    Object MemberCard = XposedHelpers.callMethod(accountObj, "getMemberCard");
                    if (MemberCard != null) {
                        Log.i(TAG, "MemberCard =" + (String) MemberCard.toString());
                    }
                }
            });
            /*888888888888888888888888888888888*/
    
            /*888888888888888888888888888888888*/
            Class<?> friendRankClass = XposedHelpers.findClass("com.tencent.weread.model.domain.FriendRank", classLoader);
            if (friendRankClass != null) {
                XposedBridge.log("wenfengtou load class " + friendRankClass.toString());
                Log.i(TAG,"wenfengtou load class " + friendRankClass.toString());
            }
            XposedHelpers.findAndHookMethod("com.tencent.weread.home.view.PersonalView", lpparam.classLoader, "renderRankAndExchange", friendRankClass, int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Object friendRankObj = param.args[0];
                    Object i = param.args[1];
                    Log.i(TAG, "before renderRankAndExchange");
                    //修改阅读时间显示
                    //Object readingTime = XposedHelpers.callMethod(friendRankObj, "setReadingTime", 6000);
                    //Log.i(TAG, "readingTime = " +  readingTime + " i = " + i);
                }
            });
            /*888888888888888888888888888888888*/
    
            /*888888888888888888888888888888888*/
            Class<?> userInfoClass = XposedHelpers.findClass("com.tencent.weread.model.domain.UserInfo", classLoader);
            if (userInfoClass != null) {
                XposedBridge.log("wenfengtou load class " + userInfoClass.toString());
                Log.i(TAG,"wenfengtou load class " + userInfoClass.toString());
            }
            XposedHelpers.findAndHookMethod("com.tencent.weread.home.fragment.PersonalController", lpparam.classLoader, "renderUserInfo", userInfoClass, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Object userInfoObj = param.args[0];
                    Log.i(TAG, "before renderUserInfo");
                    //修改兑换数量显示
                    //XposedHelpers.callMethod(userInfoObj, "setCanExchange", 400);
                    //Log.i(TAG, "userInfoObj = " +  userInfoObj);
                }
            });
            /*888888888888888888888888888888888*/
    
            /*888888888888888888888888888888888*/
            XposedHelpers.findAndHookMethod("com.tencent.weread.model.domain.UserInfo", lpparam.classLoader, "convertTo",  new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    //Log.i(TAG, "before convertTo" ,new Throwable());
                    Log.i(TAG, "userInfoObj = " +  param.thisObject);
                    //XposedHelpers.callMethod(param.thisObject,"setCurrentReadingTime", 6000);
                }
    
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i(TAG, "after convertTo");
                    Object currentReadTime = XposedHelpers.callMethod(param.thisObject,"getCurrentReadingTime");
                    Log.i(TAG, "currentReadTime = " +  currentReadTime);
                }
            });
    
            XposedHelpers.findAndHookMethod("com.tencent.weread.model.domain.UserInfo", lpparam.classLoader, "convertFrom", Cursor.class,  new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    //Log.i(TAG, "before convertFrom" ,new Throwable());
                    Log.i(TAG, "userInfoObj = " +  param.thisObject);
                    //XposedHelpers.callMethod(param.thisObject,"setCurrentReadingTime", 6000);
                }
    
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    //Log.i(TAG, "after convertFrom");
                    //Object currentReadTime = XposedHelpers.callMethod(param.thisObject,"getCurrentReadingTime");
                   // Log.i(TAG, "currentReadTime = " +  currentReadTime);
                }
            });
            /*888888888888888888888888888888888*/
    
            /*888888888888888888888888888888888*/
            final Class<?> accelerate100Class = XposedHelpers.findClass("com.tencent.weread.book.feature.Accelerate100", classLoader);
            if (accelerate100Class != null) {
                XposedBridge.log("wenfengtou load class " + accelerate100Class.toString());
                Log.i(TAG,"wenfengtou load class " + accelerate100Class.toString());
            }
            XposedHelpers.findAndHookMethod("com.tencent.weread.book.feature.Accelerate1", lpparam.classLoader, "acceleration", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i(TAG, "after acceleration");
                    //XposedHelpers.callMethod(param.thisObject, "mapIndex",Integer.valueOf(1),1,accelerate100Class);
                    //param.setResult(100);
                    //修改兑换数量显示
                    //XposedHelpers.callMethod(userInfoObj, "setCanExchange", 400);
                    //Log.i(TAG, "userInfoObj = " +  userInfoObj);
                }
            });
    
    
            final Class<?> readingProgressReporterClass = XposedHelpers.findClass("com.tencent.weread.reader.util.ReadingProgressReporter", classLoader);
            if (accelerate100Class != null) {
                XposedBridge.log("wenfengtou load class " + accelerate100Class.toString());
                Log.i(TAG,"wenfengtou load class " + accelerate100Class.toString());
            }
            XposedHelpers.findAndHookMethod("com.tencent.weread.book.fragment.ProgressReportStrategy", lpparam.classLoader, "onPageChange",int.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    XposedHelpers.setStaticIntField(readingProgressReporterClass,"REPORT_READ_PROGRESS_INTERVAL",Integer.MAX_VALUE/4);
                    Log.i(TAG, "after onPageChange" + XposedHelpers.getStaticIntField(readingProgressReporterClass, "REPORT_READ_PROGRESS_INTERVAL"));
                    //XposedHelpers.callMethod(param.thisObject, "mapIndex",Integer.valueOf(1),1,accelerate100Class);
                    //param.setResult(100);
                    //修改兑换数量显示
                    //XposedHelpers.callMethod(userInfoObj, "setCanExchange", 400);
                    //Log.i(TAG, "userInfoObj = " +  userInfoObj);
                }
            });
    
            XposedHelpers.findAndHookMethod("com.tencent.weread.book.fragment.ProgressReportStrategy", lpparam.classLoader, "calculateReadingTime",new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i(TAG, "after calculateReadingTime" + XposedHelpers.getLongField(param.thisObject,"readingTime"));
    
                    Long readingTime = XposedHelpers.getLongField(param.thisObject,"readingTime");
                    XposedHelpers.setLongField(param.thisObject,"readingTime", readingTime + 24*60*60000);
                    //XposedHelpers.callMethod(param.thisObject, "mapIndex",Integer.valueOf(1),1,accelerate100Class);
                    //param.setResult(100);
                    //修改兑换数量显示
                    //XposedHelpers.callMethod(userInfoObj, "setCanExchange", 400);
                    //Log.i(TAG, "userInfoObj = " +  userInfoObj);
                }
            });
    
            XposedHelpers.findAndHookMethod("com.tencent.weread.util.WRLog", lpparam.classLoader, "log", int.class , String.class, String.class,new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    super.beforeHookedMethod(param);
                    Log.i(TAG, "before WRLog log" + param.args[1] + " " + param.args[2]);
                }
            });
    
            XposedHelpers.findAndHookMethod("com.tencent.weread.util.WRLog", lpparam.classLoader, "log", int.class , String.class, String.class,new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    super.beforeHookedMethod(param);
                    Log.i(TAG, "before WRLog log" + param.args[1] + " " + param.args[2]);
                }
            });
    
            final Class<?> offlineReadingInfoClass = XposedHelpers.findClass("com.tencent.weread.model.domain.OfflineReadingInfo", classLoader);
            if (offlineReadingInfoClass != null) {
                XposedBridge.log("wenfengtou load class " + offlineReadingInfoClass.toString());
                Log.i(TAG,"wenfengtou load class " + offlineReadingInfoClass.toString());
            }
            XposedHelpers.findAndHookMethod("com.tencent.weread.book.ReportService", lpparam.classLoader, "getOfflineReadingInfos", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i(TAG, "after getOfflineReadingInfos wenfengtou2");
                    Object offlineReadingInfo = XposedHelpers.newInstance(offlineReadingInfoClass);
                    XposedHelpers.callMethod(offlineReadingInfo, "setId",1412577512 );
                    XposedHelpers.callMethod(offlineReadingInfo, "setBookId","721367" );
                    XposedHelpers.callMethod(offlineReadingInfo, "setChapterUid",17 );
                    XposedHelpers.callMethod(offlineReadingInfo, "setChapterOffset",10311 );
                    XposedHelpers.callMethod(offlineReadingInfo, "setSummary","面对生老病死带来的未知和恐惧,人们总会有某种宗教情结油然而生。且不说已经确诊的患者,即使是健康的人,在做每年一度的例行体检时,医生哪怕一句不经意的提问,类似“平时感觉哪儿不舒服吗”,都会紧张得要命,直到结果出来没问题,这一身汗才算落下去。至于真有病的患者,医生说三句话就能直接把小病吓成中病,中病变成大病,大病直接弄死。第一句“你怎么才来啊”,第二句“想吃点啥就吃点啥吧”,第三句“还真没有什么办法”。尤其是第一句,多坚强的人,一听这话立马吓软了。\n" +
                            "1915年,美国一位名叫特鲁多的医生去世了,他的墓碑上刻着三行字:“偶尔去治愈,常常去帮助,总是在抚慰。”这三行字里,似乎有着对医生这个职业更为深远的定义。\n" +
                            "特鲁多医生年轻的时候,曾患过肺结核,那时的肺结核患者相当于被宣判了死刑。他来到一个宁静的湖畔,等待着独自告别世界,可" );
                    XposedHelpers.callMethod(offlineReadingInfo, "setProgress",-1 );
                    XposedHelpers.callMethod(offlineReadingInfo, "setReadingTime",36000);
                    XposedHelpers.callMethod(offlineReadingInfo, "setInMyShelf",true );
                    ArrayList arrayList = new ArrayList();
                    arrayList.add(offlineReadingInfo);
                    param.setResult(arrayList);
    
                }
            });
            /*888888888888888888888888888888888*/
    
        }
    
    }
    
    package com.wenfengtou.xposedsimpledemo;
    
    import android.content.Context;
    import android.content.pm.ActivityInfo;
    import android.content.pm.ApplicationInfo;
    import android.content.res.Configuration;
    import android.database.Cursor;
    import android.graphics.Bitmap;
    import android.graphics.drawable.BitmapDrawable;
    import android.graphics.drawable.Drawable;
    import android.net.Uri;
    import android.util.AttributeSet;
    import android.util.Log;
    import android.view.Choreographer;
    import android.view.ViewGroup;
    import android.view.WindowManager;
    import android.widget.Toast;
    
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.lang.annotation.Target;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.UUID;
    
    import de.robv.android.xposed.IXposedHookLoadPackage;
    import de.robv.android.xposed.XC_MethodHook;
    import de.robv.android.xposed.XposedBridge;
    import de.robv.android.xposed.XposedHelpers;
    import de.robv.android.xposed.callbacks.XC_LoadPackage;
    
    public class HookMain implements IXposedHookLoadPackage {
        private static final String TAG = "HookMain";
        static  int count = 0;
    
        private static String generateFileName() {
            return UUID.randomUUID().toString();
        }
    
        public static String saveBitmap( Bitmap mBitmap) {
    
            File filePic;
            try {
                filePic = new File("/sdcard/bibi/" + count + ".jpg");
                if (!filePic.exists()) {
                    filePic.getParentFile().mkdirs();
                    filePic.createNewFile();
                }
                FileOutputStream fos = new FileOutputStream(filePic);
                mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
                fos.flush();
                fos.close();
                Log.i(TAG, "saveBitmap" + generateFileName());
            } catch (IOException e) {
                // TODO Auto-generated catch block
                Log.i(TAG, "saveBitmap error" + e.toString());
                e.printStackTrace();
                return null;
            }
    
            return filePic.getAbsolutePath();
        }
    
        @Override
        public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
            if(!lpparam.packageName.equals("tv.danmaku.bili") && !lpparam.packageName.equals("android")) return;
    
            if (lpparam.packageName.equals("android")) {
                Log.i(TAG,"wenfengtou androidhook!!");
                XposedHelpers.findAndHookMethod("com.android.server.wm.WindowManagerService", lpparam.classLoader, "getOrientationLocked", new XC_MethodHook() {
                    @Override
                    protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                        super.afterHookedMethod(param);
                        Log.i("getOrientationLocked","getOrientationLocked");
                     //   param.setResult(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
                    }
                });
            }
    
            XposedBridge.log("wenfengtou start tv.danmaku.bili");
            Log.i(TAG,"wenfengtou start tv.danmaku.bili mFrameIntervalNanos=" + XposedHelpers.getLongField(Choreographer.getInstance(),"mFrameIntervalNanos"));
    
            XposedHelpers.findAndHookMethod("android.view.ViewRootImpl", lpparam.classLoader, "requestLayout", new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("requestLayout", "requestLayout" , new Throwable());
                    Object mHandlingLayoutInLayoutRequest = XposedHelpers.getObjectField(param.thisObject, "mHandlingLayoutInLayoutRequest");
                    Log.i("requestLayout", "mHandlingLayoutInLayoutRequest =" + mHandlingLayoutInLayoutRequest);
    
                    // Object obj =  param.args[0];
                    // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
            XposedHelpers.findAndHookMethod("android.widget.Toast$TN", lpparam.classLoader, "handleShow", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                  //  WindowManager.LayoutParams params = (WindowManager.LayoutParams) XposedHelpers.getObjectField(param.thisObject, "mParams");
    
                    Log.i("handleShow2", "handleShow");
                    param.args[1] = 0;
                }
            });
    
    
            Class recyclerViewClass = XposedHelpers.findClass("android.support.v7.widget.RecyclerView", lpparam.classLoader);
            XposedHelpers.findAndHookMethod("com.bilibili.app.comm.comment2.comments.view.y$4", lpparam.classLoader, "a", recyclerViewClass, int.class, int.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    super.afterHookedMethod(param);
                    Log.i("wenfengy", "wenfengy" , new Throwable());
                    param.args[1] = 0;
                }
            });
    
            XposedHelpers.findAndHookMethod("android.databinding.ObservableArrayList", lpparam.classLoader, "addAll", Collection.class,new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("ObservableArrayList", "ObservableArrayList" , new Throwable());
                    Collection collection = (Collection) param.args[0];
                   // collection.clear();
                  // param.args[0] = collection;
                    Log.i("ObservableArrayList", "collection.size =" + collection.size());
    
                    //Log.i("ObservableArrayList", "mHandlingLayoutInLayoutRequest =" + mHandlingLayoutInLayoutRequest);
                    // Object obj =  param.args[0];
                    // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
    
            XposedHelpers.findAndHookMethod("android.view.ViewRootImpl", lpparam.classLoader, "performTraversals", new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("performTraversals", "performTraversals" , new Throwable());
                    Object mView = XposedHelpers.getObjectField(param.thisObject, "mView");
                    Object mAdded = XposedHelpers.getObjectField(param.thisObject, "mAdded");
                    Object mStopped = XposedHelpers.getObjectField(param.thisObject, "mStopped");
                    Object mReportNextDraw = XposedHelpers.getObjectField(param.thisObject, "mReportNextDraw");
                    Object mLayoutRequested = XposedHelpers.getObjectField(param.thisObject, "mLayoutRequested");
                    Log.i("performTraversals", "mView =" + mView + " mAdded=" + mAdded + " mStopped=" + mStopped + " mReportNextDraw=" + mReportNextDraw + " mLayoutRequested=" + mLayoutRequested);
    
                   // Object obj =  param.args[0];
                    // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
            XposedHelpers.findAndHookMethod("android.view.ViewRootImpl", lpparam.classLoader, "performLayout", WindowManager.LayoutParams.class, int.class ,int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("performLayout", "performLayout" , new Throwable());
                    Object obj =  param.args[0];
                    // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
            XposedHelpers.findAndHookMethod("com.android.internal.policy.DecorView", lpparam.classLoader, "onLayout",boolean.class,int.class, int.class, int.class, int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("DecorView", "onLayout" , new Throwable());
                    Object obj =  param.args[0];
                    // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
            XposedHelpers.findAndHookMethod("android.widget.LinearLayout", lpparam.classLoader, "onLayout",boolean.class,int.class, int.class, int.class, int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("LinearLayoutonLayout", "onLayout" , new Throwable());
                    Object obj =  param.args[0];
                    // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
            XposedHelpers.findAndHookMethod("android.view.ViewRootImpl", lpparam.classLoader, "doTraversal", new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("doTraversal", "doTraversal" , new Throwable());
                    Object obj =  param.args[0];
                    // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
    
            XposedHelpers.findAndHookMethod("com.bilibili.app.comm.comment2.comments.view.aa", lpparam.classLoader, "b", ViewGroup.class, int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("view.aa", "view.aa" , new Throwable());
                    Object obj =  param.args[0];
                    // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
            XposedHelpers.findAndHookMethod("android.view.Choreographer", lpparam.classLoader, "postFrameCallback", Choreographer.FrameCallback.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("postFrameCallback", "postFrameCallback " + param.args[0], new Throwable());
                }
            });
            ClassLoader classLoader = lpparam.classLoader;
            Class<?> aeiClass = classLoader.loadClass("b.aei");
            Class<?> zaClass = classLoader.loadClass("b.za");
            Log.i(TAG,"wenfengtou load aeiClass " + aeiClass);
            Log.i(TAG,"wenfengtou load zaClass " + zaClass);
    
            XposedHelpers.findAndHookMethod("b.xn", lpparam.classLoader, "a", ViewGroup.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("b.xn", "b.xn ViewGroup " , new Throwable());
                    Object obj =  param.args[0];
                   // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
    
            Class<?> aaClass = classLoader.loadClass("com.bilibili.app.comm.comment2.comments.view.aa");
            Log.i(TAG,"wenfengtou load aeiClass " + aaClass);
    
            XposedHelpers.findAndHookMethod("com.bilibili.app.comm.comment2.comments.view.aa", lpparam.classLoader, "b", ViewGroup.class, int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.i("view.aa", "view.aa" , new Throwable());
                    Object obj =  param.args[0];
                    // Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
    
            XposedHelpers.findAndHookConstructor("com.bilibili.magicasakura.widgets.TintTextView", lpparam.classLoader, Context.class, AttributeSet.class, int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                   // Log.i(TAG, "new TintTextView count = " + count, new Throwable());
                    super.beforeHookedMethod(param);
                }
            });
    
            XposedHelpers.findAndHookMethod("com.bilibili.magicasakura.widgets.TintImageView", lpparam.classLoader, "setBackgroundDrawable", Drawable.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    count ++;
                    Log.i(TAG, "setBackgroundDrawable count = " + count, new Throwable());
                    Object obj =  param.args[0];
                    Log.i(TAG, "before saveBitmap0 " + obj);
                    /*
                    BitmapDrawable bd = (BitmapDrawable) drawable;
                    Log.i(TAG, "before saveBitmap1");
                    Bitmap bitmap = bd.getBitmap();
                    Log.i(TAG, "before saveBitmap2");
                    saveBitmap(bitmap);
                    super.beforeHookedMethod(param);
                    */
                }
            });
    
            XposedHelpers.findAndHookMethod("com.bilibili.magicasakura.widgets.TintImageView", lpparam.classLoader, "setBackgroundResource", int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    count ++;
                    Log.i(TAG, "setBackgroundResource count = " + count, new Throwable());
                    Object obj =  param.args[0];
                    Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
            XposedHelpers.findAndHookMethod("com.bilibili.magicasakura.widgets.TintImageView", lpparam.classLoader, "setImageDrawable", Drawable.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    count ++;
                    Log.i("setImageDrawable", "setImageDrawable count = " + count, new Throwable());
                    Object obj =  param.args[0];
                    if (obj instanceof BitmapDrawable) {
                        Log.i(TAG, "catch a bitmapdrawable " + obj);
                        BitmapDrawable bd = (BitmapDrawable) obj;
                        Log.i(TAG, "before saveBitmap1");
                        Bitmap bitmap = bd.getBitmap();
                        Log.i(TAG, "before saveBitmap2");
                        saveBitmap(bitmap);
                        super.beforeHookedMethod(param);
                    }
    
                }
            });
    
            XposedHelpers.findAndHookMethod("com.bilibili.magicasakura.widgets.TintImageView", lpparam.classLoader, "setImageResource", int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    count ++;
                    Log.i(TAG, "setImageResource count = " + count, new Throwable());
                    Object obj =  param.args[0];
                    Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
            XposedHelpers.findAndHookMethod("com.bilibili.magicasakura.widgets.TintImageView", lpparam.classLoader, "setImageURI", Uri.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    count ++;
                    Log.i(TAG, "setImageURI count = " + count, new Throwable());
                    Object obj =  param.args[0];
                    Log.i(TAG, "before saveBitmap0 " + obj);
                }
            });
    
    
            /*
            XposedHelpers.findAndHookMethod("android.view.Choreographer", lpparam.classLoader, "doFrame", long.class, int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    count ++;
                    Log.i("doFrame", "doFrame " + param.args[0], new Throwable());
                }
            });
            */
    
        }
    
    }
    

    是一个DimLayer mAnimationBackgroundSurface = new DimLayer(mService, this, mDisplayContent.getDisplayId(),
    "animation background stackId=" + mStackId);

    怎么变成-1了呢?

    bool AudioTrack::AudioTrackThread::threadLoop()
    {
    {
    AutoMutex _l(mMyLock);
    if (mPaused) {
    mMyCond.wait(mMyLock);
    // caller will check for exitPending()
    return true;
    }
    if (mIgnoreNextPausedInt) {
    mIgnoreNextPausedInt = false;
    mPausedInt = false;
    }
    if (mPausedInt) {
    if (mPausedNs > 0) {
    //ALOGE("processAudioBuffer() before waitRelative %" PRId64, mPausedNs);
    (void) mMyCond.waitRelative(mMyLock, mPausedNs);
    ALOGE("processAudioBuffer() after waitRelative %" PRId64, mPausedNs);
    } else {
    mMyCond.wait(mMyLock);
    }
    mPausedInt = false;
    return true;
    }
    }
    if (exitPending()) {
    return false;
    }
    nsecs_t ns = mReceiver.processAudioBuffer();
    ALOGE("processAudioBuffer() returned %" PRId64, ns);
    switch (ns) {
    case 0:
    return true;
    case NS_INACTIVE:
    pauseInternal();
    return true;
    case NS_NEVER:
    return false;
    case NS_WHENEVER:
    // Event driven: call wake() when callback notifications conditions change.
    ns = INT64_MAX;
    // fall through
    default:
    LOG_ALWAYS_FATAL_IF(ns < 0, "processAudioBuffer() returned %" PRId64, ns);
    pauseInternal(ns);
    return true;
    }
    }

    相关文章

      网友评论

          本文标题:晚上调试的代码

          本文链接:https://www.haomeiwen.com/subject/pcudfctx.html