@@ -88,37 +88,39 @@ private static ClassInfo resolveDialpadFragment(ClassLoader cl) {
88
88
}
89
89
90
90
public static void init (final XSharedPreferences prefs , final XSharedPreferences qhPrefs ,
91
- final ClassLoader classLoader , final String packageName ) {
92
- try {
93
- XposedHelpers .findAndHookMethod (CLASS_DIALTACTS_ACTIVITY , classLoader ,
94
- "onResume" , new XC_MethodHook () {
95
- @ Override
96
- protected void afterHookedMethod (MethodHookParam param ) throws Throwable {
97
- prefs .reload ();
98
- if (!prefs .getBoolean (GravityBoxSettings .PREF_KEY_DIALER_SHOW_DIALPAD , false )) return ;
99
-
100
- final String realClassName = param .thisObject .getClass ().getName ();
101
- Method m = null ;
102
- for (String mn : new String [] { "showDialpadFragment" , "f" }) {
103
- if (realClassName .equals (CLASS_DIALTACTS_ACTIVITY )) {
104
- m = XposedHelpers .findMethodExactIfExists (
105
- param .thisObject .getClass (), mn , boolean .class );
106
- } else if (realClassName .equals (CLASS_DIALTACTS_ACTIVITY_GOOGLE )) {
107
- m = XposedHelpers .findMethodExactIfExists (
108
- param .thisObject .getClass ().getSuperclass (), mn , boolean .class );
91
+ final ClassLoader classLoader , final String packageName , int sdkVersion ) {
92
+ if (sdkVersion < 28 ) {
93
+ try {
94
+ XposedHelpers .findAndHookMethod (CLASS_DIALTACTS_ACTIVITY , classLoader ,
95
+ "onResume" , new XC_MethodHook () {
96
+ @ Override
97
+ protected void afterHookedMethod (MethodHookParam param ) throws Throwable {
98
+ prefs .reload ();
99
+ if (!prefs .getBoolean (GravityBoxSettings .PREF_KEY_DIALER_SHOW_DIALPAD , false )) return ;
100
+
101
+ final String realClassName = param .thisObject .getClass ().getName ();
102
+ Method m = null ;
103
+ for (String mn : new String [] { "showDialpadFragment" , "f" }) {
104
+ if (realClassName .equals (CLASS_DIALTACTS_ACTIVITY )) {
105
+ m = XposedHelpers .findMethodExactIfExists (
106
+ param .thisObject .getClass (), mn , boolean .class );
107
+ } else if (realClassName .equals (CLASS_DIALTACTS_ACTIVITY_GOOGLE )) {
108
+ m = XposedHelpers .findMethodExactIfExists (
109
+ param .thisObject .getClass ().getSuperclass (), mn , boolean .class );
110
+ }
111
+ if (m != null ) break ;
112
+ }
113
+ if (m == null ) {
114
+ GravityBox .log (TAG , "DialtactsActivity: couldn't identify showDialpadFragment method" );
115
+ } else {
116
+ m .invoke (param .thisObject , false );
117
+ if (DEBUG ) log ("showDialpadFragment() called within " + realClassName );
109
118
}
110
- if (m != null ) break ;
111
- }
112
- if (m == null ) {
113
- GravityBox .log (TAG , "DialtactsActivity: couldn't identify showDialpadFragment method" );
114
- } else {
115
- m .invoke (param .thisObject , false );
116
- if (DEBUG ) log ("showDialpadFragment() called within " + realClassName );
117
119
}
118
- }
119
- });
120
- } catch ( Throwable t ) {
121
- GravityBox . log ( TAG , "DialtactsActivity: incompatible version of Dialer app" , t );
120
+ });
121
+ } catch ( Throwable t ) {
122
+ GravityBox . log ( TAG , "DialtactsActivity: incompatible version of Dialer app" , t );
123
+ }
122
124
}
123
125
124
126
try {
0 commit comments