@@ -0,0 +1,1787 @@
+package com.taobao.patch;%0A%0Aimport android.os.Bundle;%0Aimport android.util.Log;%0Aimport android.view.LayoutInflater;%0Aimport android.view.ViewGroup;%0Aimport android.widget.TextView;%0A%0Aimport com.taobao.android.dexposed.DexposedBridge;%0Aimport com.taobao.android.dexposed.XC_MethodReplacement;%0A%0A/**%0A * Created by renxuan on 15/8/25.%0A */%0Apublic class FragmentPatch implements IPatch %7B%0A    private static final String TAG=%22FragmentPatch%22;%0A    @Override%0A    public void handlePatch(final PatchParam patchParam) throws Throwable %7B%0A        %7B%0A            Class%3C?%3E cls = null;%0A            try %7B%0A                cls= patchParam.context.getClass().getClassLoader().loadClass(%22com.taobao.dexposed.TestFragment%22);%0A            %7D catch (Exception e) %7B%0A                e.printStackTrace();%0A                return;%0A            %7D%0A            Log.e(TAG, %22cls:%22 + cls);%0A            DexposedBridge.findAndHookMethod(cls, %22getText%22, new XC_MethodReplacement() %7B%0A                @Override%0A                protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable %7B%0A                    Log.e(TAG, %22methodHookParam:%22 + methodHookParam.method.getName());%0A                    return %22from patch%22;%0A                %7D%0A            %7D);%0A%0A            DexposedBridge.findAndHookMethod(cls, %22onCreateView%22, LayoutInflater.class, ViewGroup.class, Bundle.class, new XC_MethodReplacement() %7B%0A                @Override%0A                protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable %7B%0A                    ViewGroup view = (ViewGroup) methodHookParam.args%5B1%5D;%0A                    TextView tv = new TextView(view.getContext());%0A                    tv.setText(%22replace onCreateView%22);%0A                    return tv;%0A                %7D%0A            %7D);%0A        %7D%0A    %7D%0A%7D%0A

add fragment hook