package o; import android.content.Context; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.embedding.engine.plugins.activity.ActivityAware; import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; import io.flutter.plugin.common.MethodChannel; /* loaded from: classes5.dex */ public final class fPW implements FlutterPlugin, ActivityAware { private fPR a; private MethodChannel d; private C13087fQa e; @Override // io.flutter.embedding.engine.plugins.FlutterPlugin public final void onAttachedToEngine(FlutterPlugin.FlutterPluginBinding flutterPluginBinding) { C14957gcv.e(flutterPluginBinding, ""); this.d = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "dev.fluttercommunity.plus/share"); Context applicationContext = flutterPluginBinding.getApplicationContext(); C14957gcv.c(applicationContext, ""); this.e = new C13087fQa(applicationContext); Context applicationContext2 = flutterPluginBinding.getApplicationContext(); C14957gcv.c(applicationContext2, ""); C13087fQa c13087fQa = this.e; MethodChannel methodChannel = null; if (c13087fQa == null) { C14957gcv.a(""); c13087fQa = null; } fPR fpr = new fPR(applicationContext2, c13087fQa); this.a = fpr; C13087fQa c13087fQa2 = this.e; if (c13087fQa2 == null) { C14957gcv.a(""); c13087fQa2 = null; } C13053fPV c13053fPV = new C13053fPV(fpr, c13087fQa2); MethodChannel methodChannel2 = this.d; if (methodChannel2 == null) { C14957gcv.a(""); } else { methodChannel = methodChannel2; } methodChannel.setMethodCallHandler(c13053fPV); } @Override // io.flutter.embedding.engine.plugins.FlutterPlugin public final void onDetachedFromEngine(FlutterPlugin.FlutterPluginBinding flutterPluginBinding) { C14957gcv.e(flutterPluginBinding, ""); MethodChannel methodChannel = this.d; if (methodChannel == null) { C14957gcv.a(""); methodChannel = null; } methodChannel.setMethodCallHandler(null); } @Override // io.flutter.embedding.engine.plugins.activity.ActivityAware public final void onAttachedToActivity(ActivityPluginBinding activityPluginBinding) { C14957gcv.e(activityPluginBinding, ""); C13087fQa c13087fQa = this.e; fPR fpr = null; if (c13087fQa == null) { C14957gcv.a(""); c13087fQa = null; } activityPluginBinding.addActivityResultListener(c13087fQa); fPR fpr2 = this.a; if (fpr2 == null) { C14957gcv.a(""); } else { fpr = fpr2; } fpr.d = activityPluginBinding.getActivity(); } @Override // io.flutter.embedding.engine.plugins.activity.ActivityAware public final void onDetachedFromActivity() { fPR fpr = this.a; if (fpr == null) { C14957gcv.a(""); fpr = null; } fpr.d = null; } @Override // io.flutter.embedding.engine.plugins.activity.ActivityAware public final void onReattachedToActivityForConfigChanges(ActivityPluginBinding activityPluginBinding) { C14957gcv.e(activityPluginBinding, ""); onAttachedToActivity(activityPluginBinding); } @Override // io.flutter.embedding.engine.plugins.activity.ActivityAware public final void onDetachedFromActivityForConfigChanges() { onDetachedFromActivity(); } /* loaded from: classes5.dex */ public static final class IeS { private IeS() { } public /* synthetic */ IeS(byte b) { this(); } } static { new IeS((byte) 0); } }