Skip to content

Commit

Permalink
Make codes better
Browse files Browse the repository at this point in the history
  • Loading branch information
Chipppppppppp committed Jan 23, 2024
1 parent 39131e6 commit f4f2f2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/java/io/github/chipppppppppp/lime/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,12 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if (deleteRecommendation) {
hookTarget = lparam.classLoader.loadClass("android.widget.LinearLayout");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
int recommendationResId = -1;
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
View view = (View) param.thisObject;
Context context = view.getContext();
int recommendationResId = context.getResources().getIdentifier("home_tab_contents_recommendation_placement", "id", context.getPackageName());
if (recommendationResId == -1) recommendationResId = context.getResources().getIdentifier("home_tab_contents_recommendation_placement", "id", context.getPackageName());
if (view.getId() == recommendationResId) view.setVisibility(View.GONE);
}
});
Expand Down

0 comments on commit f4f2f2d

Please sign in to comment.