| | | |
Offset 6, 20 lines modified | Offset 6, 22 lines modified |
6 | import·androidx.fragment.app.DialogFragment; | 6 | import·androidx.fragment.app.DialogFragment; |
7 | import·androidx.preference.PreferenceFragmentCompat; | 7 | import·androidx.preference.PreferenceFragmentCompat; |
8 | import·androidx.preference.PreferenceScreen; | 8 | import·androidx.preference.PreferenceScreen; |
9 | import·androidx.preference.PreferenceCategory; | 9 | import·androidx.preference.PreferenceCategory; |
10 | import·android.view.View; | 10 | import·android.view.View; |
11 | import·android.content.pm.PackageManager$NameNotFoundException; | 11 | import·android.content.pm.PackageManager$NameNotFoundException; |
12 | import·androidx.preference.Preference$OnPreferenceClickListener; | 12 | import·androidx.preference.Preference$OnPreferenceClickListener; |
| 13 | import·java.util.Iterator; |
13 | import·java.util.ArrayList; | 14 | import·java.util.ArrayList; |
14 | import·com.android.permissioncontroller.permission.model.Permission; | 15 | import·com.android.permissioncontroller.permission.model.Permission; |
15 | import·androidx.fragment.app.FragmentTransaction; | 16 | import·androidx.fragment.app.FragmentTransaction; |
16 | import·androidx.fragment.app.Fragment; | 17 | import·androidx.fragment.app.Fragment; |
17 | import·com.android.permissioncontroller.permission.utils.SafetyNetLogger; | 18 | import·android.content.Intent; |
18 | import·com.android.permissioncontroller.permission.utils.LocationUtils; | 19 | import·com.android.permissioncontroller.permission.utils.LocationUtils; |
| 20 | import·com.android.permissioncontroller.permission.utils.SafetyNetLogger; |
19 | import·android.os.Parcelable; | 21 | import·android.os.Parcelable; |
20 | import·android.os.Bundle; | 22 | import·android.os.Bundle; |
21 | import·androidx.preference.Preference; | 23 | import·androidx.preference.Preference; |
22 | import·android.content.pm.PackageInfo; | 24 | import·android.content.pm.PackageInfo; |
23 | import·java.util.List; | 25 | import·java.util.List; |
24 | import·android.content.pm.PackageItemInfo; | 26 | import·android.content.pm.PackageItemInfo; |
25 | import·android.content.Context; | 27 | import·android.content.Context; |
Offset 48, 33 lines modified | Offset 50, 38 lines modified |
48 | ····private·PackageManager$OnPermissionsChangedListener·mPermissionChangeListener; | 50 | ····private·PackageManager$OnPermissionsChangedListener·mPermissionChangeListener; |
49 | ···· | 51 | ···· |
50 | ····private·RestrictedLockUtils$EnforcedAdmin·getAdmin()·{ | 52 | ····private·RestrictedLockUtils$EnforcedAdmin·getAdmin()·{ |
51 | ········return·RestrictedLockUtils.getProfileOrDeviceOwner(((Fragment)this).getContext(),·this.mGroup.getUser()); | 53 | ········return·RestrictedLockUtils.getProfileOrDeviceOwner(((Fragment)this).getContext(),·this.mGroup.getUser()); |
52 | ····} | 54 | ····} |
53 | ···· | 55 | ···· |
54 | ····private·AppPermissionGroup·getAppPermissionGroup()·{ | 56 | ····private·AppPermissionGroup·getAppPermissionGroup()·{ |
55 | ········final·FragmentActivity·activity·=·((Fragment)this).getActivity(); | 57 | ········final·FragmentActivity·requireActivity·=·((Fragment)this).requireActivity(); |
56 | ········final·Context·context·=·((PreferenceFragmentCompat)this).getPreferenceManager().getContext(); | 58 | ········final·Context·context·=·((PreferenceFragmentCompat)this).getPreferenceManager().getContext(); |
57 | ········final·String·string·=·((Fragment)this).getArguments().getString("android.intent.extra.PACKAGE_NAME"); | 59 | ········final·String·string·=·((Fragment)this).requireArguments().getString("android.intent.extra.PACKAGE_NAME"); |
58 | ········String·str·=·((Fragment)this).getArguments().getString("android.intent.extra.PERMISSION_GROUP_NAME"); | 60 | ········String·str·=·((Fragment)this).requireArguments().getString("android.intent.extra.PERMISSION_GROUP_NAME"); |
59 | ········if·(str·==·null)·{ | 61 | ········if·(str·==·null)·{ |
60 | ············str·=·((Fragment)this).getArguments().getString("android.intent.extra.PERMISSION_NAME"); | 62 | ············str·=·((Fragment)this).requireArguments().getString("android.intent.extra.PERMISSION_NAME"); |
61 | ········} | 63 | ········} |
62 | ········final·PackageItemInfo·groupInfo·=·Utils.getGroupInfo(str,·context); | 64 | ········final·PackageItemInfo·groupInfo·=·Utils.getGroupInfo(str,·context); |
63 | ········final·List·groupPermissionInfos·=·Utils.getGroupPermissionInfos(str,·context); | 65 | ········final·List·groupPermissionInfos·=·Utils.getGroupPermissionInfos(str,·context); |
64 | ········final·String·s·=·"Illegal·group:·"; | 66 | ········final·String·s·=·"Illegal·group:·"; |
65 | ········final·String·s2·=·"AppPermissionFragment"; | 67 | ········final·String·s2·=·"AppPermissionFragment"; |
66 | ········if·(groupInfo·==·null·||·groupPermissionInfos·==·null)·{ | 68 | ········if·(groupInfo·==·null·||·groupPermissionInfos·==·null)·{ |
67 | ············final·StringBuilder·sb·=·new·StringBuilder(); | 69 | ············final·StringBuilder·sb·=·new·StringBuilder(); |
68 | ············sb.append(s); | 70 | ············sb.append(s); |
69 | ············sb.append(str); | 71 | ············sb.append(str); |
70 | ············Log.i(s2,·sb.toString()); | 72 | ············Log.i(s2,·sb.toString()); |
71 | ············return·null; | 73 | ············return·null; |
72 | ········} | 74 | ········} |
73 | ········final·PackageInfo·packageInfo·=·AutoPermissionsUtils.getPackageInfo((Activity)activity,·string,·(UserHandle)((Fragment)this).getArguments().getParcelable("android.intent.extra.USER")); | 75 | ········final·UserHandle·userHandle·=·(UserHandle)((Fragment)this).requireArguments().getParcelable("android.intent.extra.USER"); |
| 76 | ········if·(userHandle·==·null)·{ |
| 77 | ············Log.e(s2,·"User·handle·is·null"); |
| 78 | ············return·null; |
| 79 | ········} |
| 80 | ········final·PackageInfo·packageInfo·=·AutoPermissionsUtils.getPackageInfo((Activity)requireActivity,·string,·userHandle); |
74 | ········if·(packageInfo·==·null)·{ | 81 | ········if·(packageInfo·==·null)·{ |
75 | ············Log.i(s2,·"PackageInfo·is·null"); | 82 | ············Log.i(s2,·"PackageInfo·is·null"); |
76 | ············return·null; | 83 | ············return·null; |
77 | ········} | 84 | ········} |
78 | ········final·AppPermissionGroup·create·=·AppPermissionGroup.create(context,·packageInfo,·groupInfo,·groupPermissionInfos,·false); | 85 | ········final·AppPermissionGroup·create·=·AppPermissionGroup.create(context,·packageInfo,·groupInfo,·groupPermissionInfos,·false); |
79 | ········if·(create·!=·null·&&·Utils.shouldShowPermission(context,·create))·{ | 86 | ········if·(create·!=·null·&&·Utils.shouldShowPermission(context,·create))·{ |
80 | ············return·create; | 87 | ············return·create; |
Offset 126, 17 lines modified | Offset 133, 52 lines modified |
126 | ············arguments.putString(s,·s3); | 133 | ············arguments.putString(s,·s3); |
127 | ········} | 134 | ········} |
128 | ········arguments.putParcelable("android.intent.extra.USER",·(Parcelable)userHandle); | 135 | ········arguments.putParcelable("android.intent.extra.USER",·(Parcelable)userHandle); |
129 | ········((Fragment)autoAppPermissionFragment).setArguments(arguments); | 136 | ········((Fragment)autoAppPermissionFragment).setArguments(arguments); |
130 | ········return·autoAppPermissionFragment; | 137 | ········return·autoAppPermissionFragment; |
131 | ····} | 138 | ····} |
132 | ···· | 139 | ···· |
| 140 | ····private·void·onDenyAnyWay(int·mHasConfirmedRevoke)·{ |
| 141 | ········int·hasGrantedByDefaultPermission; |
| 142 | ········if·((mHasConfirmedRevoke·&·0x1)·!=·0x0)·{ |
| 143 | ············if·(this.mGroup.areRuntimePermissionsGranted())·{ |
| 144 | ················SafetyNetLogger.logPermissionToggled(this.mGroup); |
| 145 | ············} |
| 146 | ············this.mGroup.revokeRuntimePermissions(false); |
| 147 | ············hasGrantedByDefaultPermission·=·(this.mGroup.hasGrantedByDefaultPermission()·?·1·:·0); |
| 148 | ········} |
| 149 | ········else·{ |
| 150 | ············hasGrantedByDefaultPermission·=·0; |
| 151 | ········} |
| 152 | ········mHasConfirmedRevoke·&=·0x2; |
| 153 | ········if·(mHasConfirmedRevoke·!=·0·&&·this.mGroup.getBackgroundPermissions()·!=·null)·{ |
| 154 | ············mHasConfirmedRevoke·=·(this.mGroup.getBackgroundPermissions().areRuntimePermissionsGranted()·?·1·:·0); |
| 155 | ············if·(mHasConfirmedRevoke·!=·0)·{ |
| 156 | ················SafetyNetLogger.logPermissionToggled(this.mGroup.getBackgroundPermissions()); |
| 157 | ············} |
| 158 | ············this.mGroup.getBackgroundPermissions().revokeRuntimePermissions(false); |
| 159 | ············mHasConfirmedRevoke·=·(this.mGroup.getBackgroundPermissions().hasGrantedByDefaultPermission()·?·1·:·0); |
| 160 | ············hasGrantedByDefaultPermission·|=·mHasConfirmedRevoke; |
| 161 | ········} |
| 162 | ········Label_0170:·{ |
| 163 | ············if·(hasGrantedByDefaultPermission·==·0)·{ |
| 164 | ················mHasConfirmedRevoke·=·(this.mGroup.doesSupportRuntimePermissions()·?·1·:·0); |
| 165 | ················if·(mHasConfirmedRevoke·!=·0)·{ |
| 166 | ····················break·Label_0170; |
| 167 | ················} |
| 168 | ············} |
| 169 | ············mHasConfirmedRevoke·=·1; |
| 170 | ············this.mHasConfirmedRevoke·=·(mHasConfirmedRevoke·!=·0); |
| 171 | ········} |
| 172 | ········this.updateUi(); |
| 173 | ····} |
| 174 | ···· |
133 | ····private·boolean·requestChange(final·boolean·b,·final·int·n)·{ | 175 | ····private·boolean·requestChange(final·boolean·b,·final·int·n)·{ |
134 | ········if·(LocationUtils.isLocationGroupAndProvider(((Fragment)this).getContext(),·this.mGroup.getName(),·this.mGroup.getApp().packageName))·{ | 176 | ········if·(LocationUtils.isLocationGroupAndProvider(((Fragment)this).getContext(),·this.mGroup.getName(),·this.mGroup.getApp().packageName))·{ |
135 | ············LocationUtils.showLocationDialog(((Fragment)this).getContext(),·(CharSequence)Utils.getAppLabel(this.mGroup.getApp().applicationInfo,·((Fragment)this).getContext())); | 177 | ············LocationUtils.showLocationDialog(((Fragment)this).getContext(),·(CharSequence)Utils.getAppLabel(this.mGroup.getApp().applicationInfo,·((Fragment)this).requireContext())); |
136 | ············this.updateUi(); | 178 | ············this.updateUi(); |
137 | ············return·false; | 179 | ············return·false; |
138 | ········} | 180 | ········} |
139 | ········final·boolean·b2·=·true; | 181 | ········final·boolean·b2·=·true; |
140 | ········if·(b)·{ | 182 | ········if·(b)·{ |
141 | ············if·((n·&·0x1)·!=·0x0)·{ | 183 | ············if·((n·&·0x1)·!=·0x0)·{ |
142 | ················if·(!this.mGroup.areRuntimePermissionsGranted())·{ | 184 | ················if·(!this.mGroup.areRuntimePermissionsGranted())·{ |
Offset 182, 14 lines modified | Offset 224, 18 lines modified |
182 | ····} | 224 | ····} |
183 | ···· | 225 | ···· |
184 | ····private·void·setDetail(final·int·summary)·{ | 226 | ····private·void·setDetail(final·int·summary)·{ |
185 | ········((Preference)this.mDetailsPreference).setSummary(summary); | 227 | ········((Preference)this.mDetailsPreference).setSummary(summary); |
186 | ········((Preference)this.mDetailsPreference).setVisible(true); | 228 | ········((Preference)this.mDetailsPreference).setVisible(true); |
187 | ····} | 229 | ····} |
188 | ···· | 230 | ···· |
| 231 | ····private·void·setResult(final·int·n)·{ |
| 232 | ········((Activity)((Fragment)this).requireActivity()).setResult(-1,·new·Intent().putExtra("com.android.permissioncontroller.extra.RESULT_PERMISSION_INTERACTED",·((Fragment)this).requireArguments().getString("android.intent.extra.PERMISSION_GROUP_NAME")).putExtra("com.android.permissioncontroller.extra.PERMISSION_RESULT",·n)); |
| 233 | ····} |
| 234 | ···· |
189 | ····private·void·setSelectedPermissionState(final·TwoStatePreference·twoStatePreference)·{ | 235 | ····private·void·setSelectedPermissionState(final·TwoStatePreference·twoStatePreference)·{ |
190 | ········twoStatePreference.setChecked(true); | 236 | ········twoStatePreference.setChecked(true); |
191 | ········final·TwoStatePreference·mAlwaysPermissionPreference·=·this.mAlwaysPermissionPreference; | 237 | ········final·TwoStatePreference·mAlwaysPermissionPreference·=·this.mAlwaysPermissionPreference; |
192 | ········if·(twoStatePreference·!=·mAlwaysPermissionPreference)·{ | 238 | ········if·(twoStatePreference·!=·mAlwaysPermissionPreference)·{ |
193 | ············mAlwaysPermissionPreference.setChecked(false); | 239 | ············mAlwaysPermissionPreference.setChecked(false); |
194 | ········} | 240 | ········} |
195 | ········final·TwoStatePreference·mForegroundOnlyPermissionPreference·=·this.mForegroundOnlyPermissionPreference; | 241 | ········final·TwoStatePreference·mForegroundOnlyPermissionPreference·=·this.mForegroundOnlyPermissionPreference; |
Offset 200, 15 lines modified | Offset 246, 15 lines modified |
200 | ········if·(twoStatePreference·!=·mDenyPermissionPreference)·{ | 246 | ········if·(twoStatePreference·!=·mDenyPermissionPreference)·{ |
201 | ············mDenyPermissionPreference.setChecked(false); | 247 | ············mDenyPermissionPreference.setChecked(false); |
202 | ········} | 248 | ········} |
203 | ····} | 249 | ····} |
204 | ···· | 250 | ···· |
205 | ····private·void·showAllPermissions(final·String·s)·{ | 251 | ····private·void·showAllPermissions(final·String·s)·{ |
206 | ········final·AutoAllAppPermissionsFragment·instance·=·AutoAllAppPermissionsFragment.newInstance(this.mGroup.getApp().packageName,·s,·UserHandle.getUserHandleForUid(this.mGroup.getApp().applicationInfo.uid)); | 252 | ········final·AutoAllAppPermissionsFragment·instance·=·AutoAllAppPermissionsFragment.newInstance(this.mGroup.getApp().packageName,·s,·UserHandle.getUserHandleForUid(this.mGroup.getApp().applicationInfo.uid)); |
207 | ········final·FragmentTransaction·beginTransaction·=·((Fragment)this).getFragmentManager().beginTransaction(); | 253 | ········final·FragmentTransaction·beginTransaction·=·((Fragment)this).requireFragmentManager().beginTransaction(); |
208 | ········beginTransaction.replace(16908290,·(Fragment)instance); | 254 | ········beginTransaction.replace(16908290,·(Fragment)instance); |
209 | ········beginTransaction.addToBackStack("AllPerms"); | 255 | ········beginTransaction.addToBackStack("AllPerms"); |
210 | ········beginTransaction.commit(); | 256 | ········beginTransaction.commit(); |
211 | ····} | 257 | ····} |
212 | ···· | 258 | ···· |
213 | ····private·void·showDefaultDenyDialog(final·int·n)·{ | 259 | ····private·void·showDefaultDenyDialog(final·int·n)·{ |
214 | ········final·Bundle·arguments·=·new·Bundle(); | 260 | ········final·Bundle·arguments·=·new·Bundle(); |
Offset 225, 15 lines modified | Offset 271, 15 lines modified |
225 | ············n2·=·2131886359; | 271 | ············n2·=·2131886359; |
226 | ········} | 272 | ········} |
227 | ········arguments.putInt(access$000,·n2); | 273 | ········arguments.putInt(access$000,·n2); |
228 | ········arguments.putInt(AutoAppPermissionFragment$DefaultDenyDialog.access$100(),·n); | 274 | ········arguments.putInt(AutoAppPermissionFragment$DefaultDenyDialog.access$100(),·n); |
229 | ········final·AutoAppPermissionFragment$DefaultDenyDialog·autoAppPermissionFragment$DefaultDenyDialog·=·new·AutoAppPermissionFragment$DefaultDenyDialog(); | 275 | ········final·AutoAppPermissionFragment$DefaultDenyDialog·autoAppPermissionFragment$DefaultDenyDialog·=·new·AutoAppPermissionFragment$DefaultDenyDialog(); |
230 | ········((Fragment)autoAppPermissionFragment$DefaultDenyDialog).setArguments(arguments); | 276 | ········((Fragment)autoAppPermissionFragment$DefaultDenyDialog).setArguments(arguments); |
231 | ········((Fragment)autoAppPermissionFragment$DefaultDenyDialog).setTargetFragment((Fragment)this,·0); | 277 | ········((Fragment)autoAppPermissionFragment$DefaultDenyDialog).setTargetFragment((Fragment)this,·0); |
232 | ········((DialogFragment)autoAppPermissionFragment$DefaultDenyDialog).show(((Fragment)this).getFragmentManager().beginTransaction(),·AutoAppPermissionFragment$DefaultDenyDialog.class.getName()); | 278 | ········((DialogFragment)autoAppPermissionFragment$DefaultDenyDialog).show(((Fragment)this).requireFragmentManager().beginTransaction(),·AutoAppPermissionFragment$DefaultDenyDialog.class.getName()); |
233 | ····} | 279 | ····} |
234 | ···· | 280 | ···· |
235 | ····private·void·updateDetailForFixedByPolicyPermissionGroup()·{ | 281 | ····private·void·updateDetailForFixedByPolicyPermissionGroup()·{ |
236 | ········final·RestrictedLockUtils$EnforcedAdmin·admin·=·this.getAdmin(); | 282 | ········final·RestrictedLockUtils$EnforcedAdmin·admin·=·this.getAdmin(); |
237 | ········final·AppPermissionGroup·backgroundPermissions·=·this.mGroup.getBackgroundPermissions(); | 283 | ········final·AppPermissionGroup·backgroundPermissions·=·this.mGroup.getBackgroundPermissions(); |
238 | ········final·boolean·b·=·admin·!=·null; | 284 | ········final·boolean·b·=·admin·!=·null; |
239 | ········if·(this.isSystemFixed())·{ | 285 | ········if·(this.isSystemFixed())·{ |
Offset 305, 39 lines modified | Offset 351, 36 lines modified |
305 | ················} | 351 | ················} |
306 | ············} | 352 | ············} |
307 | ········} | 353 | ········} |
308 | ····} | 354 | ····} |
309 | ···· | 355 | ···· |
310 | ····private·void·updateDetailForIndividuallyControlledPermissionGroup()·{ | 356 | ····private·void·updateDetailForIndividuallyControlledPermissionGroup()·{ |
311 | ········final·ArrayList·permissions·=·this.mGroup.getPermissions(); | 357 | ········final·ArrayList·permissions·=·this.mGroup.getPermissions(); |
312 | ········final·int·size·=·permissions.size(); | 358 | ········final·Iterator<Permission>·iterator·=·(Iterator<Permission>)permissions.iterator(); |
313 | ········int·i·=·0; | 359 | ········int·i·=·0; |
314 | ········int·j·=·0; | 360 | ········while·(iterator.hasNext())·{ |
315 | ········while·(i·<·size)·{ | 361 | ············if·(!((Permission)iterator.next()).isGrantedIncludingAppOp())·{ |
316 | ············if·(!((Permission)permissions.get(i)).isGrantedIncludingAppOp())·{ | 362 | ················++i; |
317 | ················++j; | |
318 | ············} | 363 | ············} |
319 | ············++i; | |
320 | ········} | 364 | ········} |
321 | ········int·n; | 365 | ········int·n; |
322 | ········if·(j·==·0)·{ | 366 | ········if·(i·==·0)·{ |
323 | ············n·=·2131886409; | 367 | ············n·=·2131886409; |
324 | ········} | 368 | ········} |
325 | ········else·if·(j·==·size)·{ | 369 | ········else·if·(i·==·permissions.size())·{ |
326 | ············n·=·2131886407; | 370 | ············n·=·2131886407; |
327 | ········} | 371 | ········} |
328 | ········else·{ | 372 | ········else·{ |
329 | ············n·=·2131886408; | 373 | ············n·=·2131886408; |
330 | ········} | 374 | ········} |
331 | ········final·AutoTwoTargetPreference·mDetailsPreference·=·this.mDetailsPreference; | 375 | ········final·AutoTwoTargetPreference·mDetailsPreference·=·this.mDetailsPreference; |
332 | ········final·Context·context·=·((Fragment)this).getContext(); | |
333 | ········final·int·visible·=·1; | 376 | ········final·int·visible·=·1; |
334 | ········final·Object[]·array·=·new·Object[visible]; | 377 | ········final·Object[]·array·=·new·Object[visible]; |
335 | ········array[0]·=·j; | 378 | ········array[0]·=·i; |
336 | ········((Preference)mDetailsPreference).setSummary((CharSequence)context.getString(n,·array)); | 379 | ········((Preference)mDetailsPreference).setSummary((CharSequence)((Fragment)this).getString(n,·array)); |
337 | ········((Preference)this.mDetailsPreference).setVisible((boolean)(visible·!=·0)); | 380 | ········((Preference)this.mDetailsPreference).setVisible((boolean)(visible·!=·0)); |
338 | ····} | 381 | ····} |
339 | ···· | 382 | ···· |
340 | ····private·void·updateUi()·{ | 383 | ····private·void·updateUi()·{ |
341 | ········this.mDetailsPreference.setOnSecondTargetClickListener((AutoTwoTargetPreference$OnSecondTargetClickListener)null); | 384 | ········this.mDetailsPreference.setOnSecondTargetClickListener((AutoTwoTargetPreference$OnSecondTargetClickListener)null); |
342 | ········((Preference)this.mDetailsPreference).setVisible(false); | 385 | ········((Preference)this.mDetailsPreference).setVisible(false); |
343 | ········if·(this.mGroup.areRuntimePermissionsGranted())·{ | 386 | ········if·(this.mGroup.areRuntimePermissionsGranted())·{ |
Offset 364, 15 lines modified | Offset 407, 15 lines modified |
364 | ············} | 407 | ············} |
365 | ········} | 408 | ········} |
366 | ········else·{ | 409 | ········else·{ |
367 | ············((Preference)this.mForegroundOnlyPermissionPreference).setVisible(false); | 410 | ············((Preference)this.mForegroundOnlyPermissionPreference).setVisible(false); |
368 | ············((Preference)this.mAlwaysPermissionPreference).setTitle(2131886132); | 411 | ············((Preference)this.mAlwaysPermissionPreference).setTitle(2131886132); |
369 | ········} | 412 | ········} |
370 | ········if·(!this.isSystemFixed()·&&·!this.isPolicyFullyFixed()·&&·!this.isForegroundDisabledByPolicy())·{ | 413 | ········if·(!this.isSystemFixed()·&&·!this.isPolicyFullyFixed()·&&·!this.isForegroundDisabledByPolicy())·{ |
371 | ············if·(Utils.areGroupPermissionsIndividuallyControlled(((Fragment)this).getContext(),·this.mGroup.getName()))·{ | 414 | ············if·(Utils.areGroupPermissionsIndividuallyControlled(((Fragment)this).requireContext(),·this.mGroup.getName()))·{ |
372 | ················((Preference)this.mDetailsPreference).setWidgetLayoutResource(2131558640); | 415 | ················((Preference)this.mDetailsPreference).setWidgetLayoutResource(2131558640); |
373 | ················this.mDetailsPreference.setOnSecondTargetClickListener((AutoTwoTargetPreference$OnSecondTargetClickListener)new·-$$Lambda$AutoAppPermissionFragment$nz55HrALkqDnVpH1-HSRj_5nfcs(this)); | 416 | ················this.mDetailsPreference.setOnSecondTargetClickListener((AutoTwoTargetPreference$OnSecondTargetClickListener)new·-$$Lambda$AutoAppPermissionFragment$nz55HrALkqDnVpH1-HSRj_5nfcs(this)); |
374 | ················this.updateDetailForIndividuallyControlledPermissionGroup(); | 417 | ················this.updateDetailForIndividuallyControlledPermissionGroup(); |
375 | ············} | 418 | ············} |
376 | ············else·if·(this.mGroup.hasPermissionWithBackgroundMode())·{ | 419 | ············else·if·(this.mGroup.hasPermissionWithBackgroundMode())·{ |
377 | ················if·(this.mGroup.getBackgroundPermissions()·==·null)·{ | 420 | ················if·(this.mGroup.getBackgroundPermissions()·==·null)·{ |
378 | ····················((Preference)this.mAlwaysPermissionPreference).setEnabled(false); | 421 | ····················((Preference)this.mAlwaysPermissionPreference).setEnabled(false); |
Offset 411, 63 lines modified | Offset 454, 28 lines modified |
411 | ········final·AppPermissionGroup·appPermissionGroup·=·this.getAppPermissionGroup(); | 454 | ········final·AppPermissionGroup·appPermissionGroup·=·this.getAppPermissionGroup(); |
412 | ········this.mGroup·=·appPermissionGroup; | 455 | ········this.mGroup·=·appPermissionGroup; |
413 | ········if·(appPermissionGroup·==·null)·{ | 456 | ········if·(appPermissionGroup·==·null)·{ |
414 | ············((Activity)((Fragment)this).requireActivity()).setResult(0); | 457 | ············((Activity)((Fragment)this).requireActivity()).setResult(0); |
415 | ············((Activity)((Fragment)this).requireActivity()).finish(); | 458 | ············((Activity)((Fragment)this).requireActivity()).finish(); |
416 | ············return; | 459 | ············return; |
417 | ········} | 460 | ········} |
418 | ········this.setHeaderLabel((CharSequence)((Fragment)this).getContext().getString(2131886148,·new·Object[]·{·this.mGroup.getFullLabel()·})); | 461 | ········this.setHeaderLabel((CharSequence)((Fragment)this).requireContext().getString(2131886148,·new·Object[]·{·this.mGroup.getFullLabel()·})); |
419 | ····} | 462 | ····} |
420 | ···· | 463 | ···· |
421 | ····public·void·onCreatePreferences(final·Bundle·bundle,·final·String·s)·{ | 464 | ····public·void·onCreatePreferences(final·Bundle·bundle,·final·String·s)·{ |
422 | ········((PreferenceFragment)this).setPreferenceScreen(((PreferenceFragmentCompat)this).getPreferenceManager().createPreferenceScreen(((Fragment)this).getContext())); | 465 | ········((PreferenceFragment)this).setPreferenceScreen(((PreferenceFragmentCompat)this).getPreferenceManager().createPreferenceScreen(((Fragment)this).requireContext())); |
423 | ····} | |
424 | ···· | |
425 | ····void·onDenyAnyWay(int·mHasConfirmedRevoke)·{ | |
426 | ········int·hasGrantedByDefaultPermission; | |
427 | ········if·((mHasConfirmedRevoke·&·0x1)·!=·0x0)·{ | |
428 | ············if·(this.mGroup.areRuntimePermissionsGranted())·{ | |
429 | ················SafetyNetLogger.logPermissionToggled(this.mGroup); | |
430 | ············} | |
431 | ············this.mGroup.revokeRuntimePermissions(false); | |
432 | ············hasGrantedByDefaultPermission·=·(this.mGroup.hasGrantedByDefaultPermission()·?·1·:·0); | |
433 | ········} | |
434 | ········else·{ | |
435 | ············hasGrantedByDefaultPermission·=·0; | |
436 | ········} | |
437 | ········mHasConfirmedRevoke·&=·0x2; | |
438 | ········if·(mHasConfirmedRevoke·!=·0·&&·this.mGroup.getBackgroundPermissions()·!=·null)·{ | |
439 | ············mHasConfirmedRevoke·=·(this.mGroup.getBackgroundPermissions().areRuntimePermissionsGranted()·?·1·:·0); | |
440 | ············if·(mHasConfirmedRevoke·!=·0)·{ | |
441 | ················SafetyNetLogger.logPermissionToggled(this.mGroup.getBackgroundPermissions()); | |
442 | ············} | |
443 | ············this.mGroup.getBackgroundPermissions().revokeRuntimePermissions(false); | |
444 | ············mHasConfirmedRevoke·=·(this.mGroup.getBackgroundPermissions().hasGrantedByDefaultPermission()·?·1·:·0); | |
445 | ············hasGrantedByDefaultPermission·|=·mHasConfirmedRevoke; | |
446 | ········} | |
447 | ········Label_0170:·{ | |
448 | ············if·(hasGrantedByDefaultPermission·==·0)·{ | |
449 | ················mHasConfirmedRevoke·=·(this.mGroup.doesSupportRuntimePermissions()·?·1·:·0); | |
450 | ················if·(mHasConfirmedRevoke·!=·0)·{ | |
451 | ····················break·Label_0170; | |
452 | ················} | |
453 | ············} | |
454 | ············mHasConfirmedRevoke·=·1; | |
455 | ············this.mHasConfirmedRevoke·=·(mHasConfirmedRevoke·!=·0); | |
456 | ········} | |
457 | ········this.updateUi(); | |
458 | ····} | 466 | ····} |
459 | ···· | 467 | ···· |
460 | ····public·void·onStart()·{ | 468 | ····public·void·onStart()·{ |
461 | ········super.onStart(); | 469 | ········super.onStart(); |
462 | ········final·FragmentActivity·requireActivity·=·((Fragment)this).requireActivity(); | 470 | ········final·FragmentActivity·requireActivity·=·((Fragment)this).requireActivity(); |
463 | ········this.mPermissionChangeListener·=·(PackageManager$OnPermissionsChangedListener)new·AutoAppPermissionFragment$PermissionChangeListener(this,·this.mGroup.getApp().applicationInfo.uid); | 471 | ········this.mPermissionChangeListener·=·(PackageManager$OnPermissionsChangedListener)new·AutoAppPermissionFragment$PermissionChangeListener(this,·this.mGroup.getApp().applicationInfo.uid); |
464 | ········((Activity)requireActivity).getPackageManager().addOnPermissionsChangeListener(this.mPermissionChangeListener); | 472 | ········((Activity)requireActivity).getPackageManager().addOnPermissionsChangeListener(this.mPermissionChangeListener); |
465 | ········final·String·packageName·=·this.mGroup.getApp().packageName; | 473 | ········final·String·packageName·=·this.mGroup.getApp().packageName; |
466 | ········(this.mPackageRemovalMonitor·=·(PackageRemovalMonitor)new·AutoAppPermissionFragment$1(this,·((Fragment)this).getContext(),·packageName,·packageName,·(Activity)requireActivity)).register(); | 474 | ········(this.mPackageRemovalMonitor·=·(PackageRemovalMonitor)new·AutoAppPermissionFragment$1(this,·((Fragment)this).requireContext(),·packageName,·packageName,·(Activity)requireActivity)).register(); |
467 | ········try·{ | 475 | ········try·{ |
468 | ············final·AppPermissionGroup·mGroup·=·this.mGroup; | 476 | ············final·AppPermissionGroup·mGroup·=·this.mGroup; |
469 | ············try·{ | 477 | ············try·{ |
470 | ················final·Context·packageContextAsUser·=·((Activity)requireActivity).createPackageContextAsUser(packageName,·0,·mGroup.getUser()); | 478 | ················final·Context·packageContextAsUser·=·((Activity)requireActivity).createPackageContextAsUser(packageName,·0,·mGroup.getUser()); |
471 | ················try·{ | 479 | ················try·{ |
472 | ····················packageContextAsUser.getPackageManager().getPackageInfo(packageName,·0); | 480 | ····················packageContextAsUser.getPackageManager().getPackageInfo(packageName,·0); |
473 | ················} | 481 | ················} |
Offset 491, 28 lines modified | Offset 499, 28 lines modified |
491 | ········super.onStop(); | 499 | ········super.onStop(); |
492 | ········final·PackageRemovalMonitor·mPackageRemovalMonitor·=·this.mPackageRemovalMonitor; | 500 | ········final·PackageRemovalMonitor·mPackageRemovalMonitor·=·this.mPackageRemovalMonitor; |
493 | ········if·(mPackageRemovalMonitor·!=·null)·{ | 501 | ········if·(mPackageRemovalMonitor·!=·null)·{ |
494 | ············mPackageRemovalMonitor.unregister(); | 502 | ············mPackageRemovalMonitor.unregister(); |
495 | ············this.mPackageRemovalMonitor·=·null; | 503 | ············this.mPackageRemovalMonitor·=·null; |
496 | ········} | 504 | ········} |
497 | ········if·(this.mPermissionChangeListener·!=·null)·{ | 505 | ········if·(this.mPermissionChangeListener·!=·null)·{ |
498 | ············((Activity)((Fragment)this).getActivity()).getPackageManager().removeOnPermissionsChangeListener(this.mPermissionChangeListener); | 506 | ············((Activity)((Fragment)this).requireActivity()).getPackageManager().removeOnPermissionsChangeListener(this.mPermissionChangeListener); |
499 | ············this.mPermissionChangeListener·=·null; | 507 | ············this.mPermissionChangeListener·=·null; |
500 | ········} | 508 | ········} |
501 | ····} | 509 | ····} |
502 | ···· | 510 | ···· |
503 | ····public·void·onViewCreated(final·View·view,·final·Bundle·bundle)·{ | 511 | ····public·void·onViewCreated(final·View·view,·final·Bundle·bundle)·{ |
504 | ········super.onViewCreated(view,·bundle); | 512 | ········super.onViewCreated(view,·bundle); |
505 | ········final·PreferenceScreen·preferenceScreen·=·((PreferenceFragmentCompat)this).getPreferenceScreen(); | 513 | ········final·PreferenceScreen·preferenceScreen·=·((PreferenceFragmentCompat)this).getPreferenceScreen(); |
506 | ········((PreferenceGroup)preferenceScreen).addPreference(AutoPermissionsUtils.createHeaderPreference(((Fragment)this).getContext(),·this.mGroup.getApp().applicationInfo)); | 514 | ········((PreferenceGroup)preferenceScreen).addPreference(AutoPermissionsUtils.createHeaderPreference(((Fragment)this).requireContext(),·this.mGroup.getApp().applicationInfo)); |
507 | ········final·PreferenceCategory·preferenceCategory·=·new·PreferenceCategory(((Fragment)this).getContext()); | 515 | ········final·PreferenceCategory·preferenceCategory·=·new·PreferenceCategory(((Fragment)this).requireContext()); |
508 | ········((Preference)preferenceCategory).setTitle((CharSequence)((Fragment)this).getContext().getString(2131886142,·new·Object[]·{·this.mGroup.getFullLabel()·})); | 516 | ········((Preference)preferenceCategory).setTitle((CharSequence)((Fragment)this).getString(2131886142,·new·Object[]·{·this.mGroup.getFullLabel()·})); |
509 | ········((PreferenceGroup)preferenceScreen).addPreference((Preference)preferenceCategory); | 517 | ········((PreferenceGroup)preferenceScreen).addPreference((Preference)preferenceCategory); |
510 | ········((Preference)(this.mAlwaysPermissionPreference·=·(TwoStatePreference)new·AutoAppPermissionFragment$SelectedPermissionPreference(((Fragment)this).getContext()))).setTitle(2131886134); | 518 | ········((Preference)(this.mAlwaysPermissionPreference·=·(TwoStatePreference)new·AutoAppPermissionFragment$SelectedPermissionPreference(((Fragment)this).requireContext()))).setTitle(2131886134); |
511 | ········((PreferenceGroup)preferenceCategory).addPreference((Preference)this.mAlwaysPermissionPreference); | 519 | ········((PreferenceGroup)preferenceCategory).addPreference((Preference)this.mAlwaysPermissionPreference); |
512 | ········((Preference)(this.mForegroundOnlyPermissionPreference·=·(TwoStatePreference)new·AutoAppPermissionFragment$SelectedPermissionPreference(((Fragment)this).getContext()))).setTitle(2131886135); | 520 | ········((Preference)(this.mForegroundOnlyPermissionPreference·=·(TwoStatePreference)new·AutoAppPermissionFragment$SelectedPermissionPreference(((Fragment)this).requireContext()))).setTitle(2131886135); |
513 | ········((PreferenceGroup)preferenceCategory).addPreference((Preference)this.mForegroundOnlyPermissionPreference); | 521 | ········((PreferenceGroup)preferenceCategory).addPreference((Preference)this.mForegroundOnlyPermissionPreference); |
514 | ········((Preference)(this.mDenyPermissionPreference·=·(TwoStatePreference)new·AutoAppPermissionFragment$SelectedPermissionPreference(((Fragment)this).getContext()))).setTitle(2131886138); | 522 | ········((Preference)(this.mDenyPermissionPreference·=·(TwoStatePreference)new·AutoAppPermissionFragment$SelectedPermissionPreference(((Fragment)this).requireContext()))).setTitle(2131886138); |
515 | ········((PreferenceGroup)preferenceCategory).addPreference((Preference)this.mDenyPermissionPreference); | 523 | ········((PreferenceGroup)preferenceCategory).addPreference((Preference)this.mDenyPermissionPreference); |
516 | ········((PreferenceGroup)preferenceScreen).addPreference((Preference)(this.mDetailsPreference·=·new·AutoTwoTargetPreference(((Fragment)this).getContext()))); | 524 | ········((PreferenceGroup)preferenceScreen).addPreference((Preference)(this.mDetailsPreference·=·new·AutoTwoTargetPreference(((Fragment)this).requireContext()))); |
517 | ····} | 525 | ····} |
518 | } | 526 | } |