Skip to content

Commit

Permalink
Included TextView successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
igoticecream committed Sep 25, 2016
1 parent 2b44064 commit 467e8d7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions app/src/main/java/com/icecream/snorlax/module/Snorlax.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
import javax.inject.Inject;

import android.app.Application;
import android.content.ContextWrapper;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.icecream.snorlax.BuildConfig;
import com.icecream.snorlax.app.SnorlaxApp;
Expand Down Expand Up @@ -83,6 +89,26 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
FeatureHelper.unsubscribe(mMitm, mMock, mCapture, mEncounter);
}
});
//~~~~~~~~~~~~~~~~~~~~~~
XposedHelpers.findAndHookConstructor("com.unity3d.player.UnityPlayer", classLoader, ContextWrapper.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
FrameLayout frameLayout = (FrameLayout) param.thisObject;

TextView textView = new TextView(frameLayout.getContext());
textView.setText("HOLAAAA");
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20.0f);

FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT
);
params.gravity = Gravity.CENTER;

frameLayout.addView(textView, params);
}
});
//~~~~~~~~~~~~~~~~~~~~~~
}

private void handleSnorlaxLoadPackage(final ClassLoader classLoader) {
Expand Down

0 comments on commit 467e8d7

Please sign in to comment.