ImojiModule.java 8.5 KB
package com.bitstrips.imoji;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build.VERSION;
import com.bitstrips.imoji.abv3.AvatarBuilderActivityV3;
import com.bitstrips.imoji.abv3.AvatarBuilderFragment;
import com.bitstrips.imoji.abv3.camera.AvatarBuilderCameraFragment;
import com.bitstrips.imoji.abv3.category.AvatarCategoryContainerView;
import com.bitstrips.imoji.abv3.option.AvatarOptionThumbnailViewHolder;
import com.bitstrips.imoji.abv3.style.AvatarStyleFragment;
import com.bitstrips.imoji.analytics.BitstripsAnalyticsService;
import com.bitstrips.imoji.analytics.KeyboardAnalyticsService;
import com.bitstrips.imoji.analytics.LegacyAnalyticsService;
import com.bitstrips.imoji.api.BitmojiApi;
import com.bitstrips.imoji.api.BitmojiApiResponseInterceptor;
import com.bitstrips.imoji.behaviour.BehaviourHelper;
import com.bitstrips.imoji.behaviour.BehaviourPreferenceFragment;
import com.bitstrips.imoji.behaviour.SecretBehaviourActivity;
import com.bitstrips.imoji.browser.ImojiBrowserActivity;
import com.bitstrips.imoji.browser.fragments.ImojiBrowserFragment;
import com.bitstrips.imoji.browser.fragments.ShareImageDialogFragment;
import com.bitstrips.imoji.deserializers.AvatarInfoDeserializer;
import com.bitstrips.imoji.experiments.Experiments;
import com.bitstrips.imoji.firebase.AppIndexingJobService;
import com.bitstrips.imoji.firebase.AppIndexingLegacyWrapperService;
import com.bitstrips.imoji.firebase.AppIndexingService;
import com.bitstrips.imoji.keyboard.BitmojiKeyboard;
import com.bitstrips.imoji.keyboard.BitmojisView;
import com.bitstrips.imoji.keyboard.BitmojisViewTags;
import com.bitstrips.imoji.manager.StickerPacksManager;
import com.bitstrips.imoji.models.AvatarInfo;
import com.bitstrips.imoji.models.StickerPacks;
import com.bitstrips.imoji.monouser.oauth2.OAuth2Manager;
import com.bitstrips.imoji.onboarding.gboard.GboardOnboardingFinishFragment;
import com.bitstrips.imoji.onboarding.gboard.GboardOnboardingInstructionsFragment;
import com.bitstrips.imoji.onboarding.gboard.GboardOnboardingIntroFragment;
import com.bitstrips.imoji.onboarding.gboard.GboardOnboardingLowStorageFragment;
import com.bitstrips.imoji.receivers.BaseAppIndexingUpdateReceiver;
import com.bitstrips.imoji.receivers.FirebaseAppIndexingUpdateReceiver;
import com.bitstrips.imoji.receivers.GboardAppIndexingUpdateReceiver;
import com.bitstrips.imoji.receivers.GboardDevAppIndexingUpdateReceiver;
import com.bitstrips.imoji.receivers.LocaleChangedReceiver;
import com.bitstrips.imoji.receivers.SnapchatAppIndexingUpdateReceiver;
import com.bitstrips.imoji.receivers.SnapchatDebugAppIndexingUpdateReceiver;
import com.bitstrips.imoji.receivers.SnapchatMasterAppIndexingUpdateReceiver;
import com.bitstrips.imoji.search.SearchIndex;
import com.bitstrips.imoji.ui.BSLoginActivity;
import com.bitstrips.imoji.ui.BSPasswordRecoveryActivity;
import com.bitstrips.imoji.ui.ImojiWebViewActivity;
import com.bitstrips.imoji.ui.LoginActivity;
import com.bitstrips.imoji.ui.SettingsFragment;
import com.bitstrips.imoji.ui.activities.ConnectSnapchatActivity;
import com.bitstrips.imoji.ui.activities.DeepLinkActivity;
import com.bitstrips.imoji.ui.activities.SignUpActivity;
import com.bitstrips.imoji.ui.activities.TermsChangedActivity;
import com.bitstrips.imoji.ui.fragments.BirthdaySignUpFragment;
import com.bitstrips.imoji.ui.fragments.FavouriteFragment;
import com.bitstrips.imoji.ui.fragments.SearchContainerFragment;
import com.bitstrips.imoji.ui.fragments.SearchResultFragment;
import com.bitstrips.imoji.ui.views.AccountsEndpointPickerDialog;
import com.bitstrips.imoji.ui.views.EndpointPickerDialog;
import com.bitstrips.imoji.util.PreferenceUtils;
import com.bitstrips.imoji.util.WebUtils;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.squareup.okhttp.Cache;
import com.squareup.okhttp.OkHttpClient;
import dagger.Module;
import dagger.Provides;
import java.util.List;
import javax.inject.Named;
import javax.inject.Singleton;
import retrofit.Endpoint;
import retrofit.RequestInterceptor;
import retrofit.RequestInterceptor.RequestFacade;
import retrofit.converter.GsonConverter;

@Module(injects={ImojiApplication.class, LoginActivity.class, ImojiBrowserActivity.class, ImojiWebViewActivity.class, SignUpActivity.class, BSPasswordRecoveryActivity.class, BSLoginActivity.class, AvatarBuilderActivityV3.class, TermsChangedActivity.class, ConnectSnapchatActivity.class, SecretBehaviourActivity.class, DeepLinkActivity.class, ImojiBrowserFragment.class, BehaviourPreferenceFragment.class, SettingsFragment.class, GboardOnboardingIntroFragment.class, GboardOnboardingInstructionsFragment.class, GboardOnboardingFinishFragment.class, GboardOnboardingLowStorageFragment.class, AvatarStyleFragment.class, BirthdaySignUpFragment.class, ShareImageDialogFragment.class, FavouriteFragment.class, SearchResultFragment.class, SearchContainerFragment.class, BitmojiKeyboard.class, AvatarBuilderFragment.class, AvatarBuilderCameraFragment.class, AppIndexingLegacyWrapperService.class, AppIndexingService.class, AppIndexingJobService.class, BaseAppIndexingUpdateReceiver.class, FirebaseAppIndexingUpdateReceiver.class, GboardAppIndexingUpdateReceiver.class, GboardDevAppIndexingUpdateReceiver.class, SnapchatAppIndexingUpdateReceiver.class, SnapchatMasterAppIndexingUpdateReceiver.class, SnapchatDebugAppIndexingUpdateReceiver.class, LocaleChangedReceiver.class, BitmojisView.class, BitmojisViewTags.class, EndpointPickerDialog.class, AccountsEndpointPickerDialog.class, AvatarOptionThumbnailViewHolder.class, AvatarCategoryContainerView.class})
public class ImojiModule
{
  Application a;
  
  public ImojiModule(Application paramApplication)
  {
    this.a = paramApplication;
  }
  
  @Provides
  @Singleton
  static BitstripsAnalyticsService a(BitmojiApi paramBitmojiApi, PreferenceUtils paramPreferenceUtils, @Named("persisted") SharedPreferences paramSharedPreferences, Context paramContext, BehaviourHelper paramBehaviourHelper, Experiments paramExperiments)
  {
    paramBitmojiApi = new BitstripsAnalyticsService(paramBitmojiApi, paramPreferenceUtils, paramSharedPreferences, paramContext, paramBehaviourHelper, paramExperiments);
    paramBitmojiApi.init();
    return paramBitmojiApi;
  }
  
  @Provides
  static LegacyAnalyticsService a(BitstripsAnalyticsService paramBitstripsAnalyticsService)
  {
    return paramBitstripsAnalyticsService;
  }
  
  @Provides
  @Singleton
  static SearchIndex a(StickerPacksManager paramStickerPacksManager)
  {
    SearchIndex localSearchIndex = new SearchIndex();
    StickerPacks localStickerPacks = paramStickerPacksManager.getStickerPacks();
    paramStickerPacksManager.addOnStickerPacksChangedListener(localSearchIndex);
    if (localStickerPacks != null) {
      localSearchIndex.index(localStickerPacks);
    }
    return localSearchIndex;
  }
  
  @Provides
  @Singleton
  static Gson a()
  {
    return new Gson();
  }
  
  @Provides
  @Singleton
  static Cache a(Context paramContext)
  {
    return new Cache(paramContext.getCacheDir(), 1048576L);
  }
  
  @Provides
  static OkHttpClient a(BitmojiApiResponseInterceptor paramBitmojiApiResponseInterceptor)
  {
    OkHttpClient localOkHttpClient = new OkHttpClient();
    localOkHttpClient.interceptors().add(paramBitmojiApiResponseInterceptor);
    return localOkHttpClient;
  }
  
  @Provides
  @Singleton
  static GsonConverter a(PreferenceUtils paramPreferenceUtils)
  {
    return new GsonConverter(new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.IDENTITY).registerTypeAdapter(AvatarInfo.class, new AvatarInfoDeserializer(paramPreferenceUtils)).create());
  }
  
  @Provides
  @Singleton
  static KeyboardAnalyticsService b(BitmojiApi paramBitmojiApi, PreferenceUtils paramPreferenceUtils, @Named("persisted") SharedPreferences paramSharedPreferences, Context paramContext, BehaviourHelper paramBehaviourHelper, Experiments paramExperiments)
  {
    paramBitmojiApi = new KeyboardAnalyticsService(paramBitmojiApi, paramPreferenceUtils, paramSharedPreferences, paramContext, paramBehaviourHelper, paramExperiments);
    paramBitmojiApi.init();
    return paramBitmojiApi;
  }
  
  @Provides
  @Named("sdkVersion")
  static Integer b()
  {
    return Integer.valueOf(Build.VERSION.SDK_INT);
  }
  
  @Provides
  @Named("avatarId")
  static String b(PreferenceUtils paramPreferenceUtils)
  {
    return paramPreferenceUtils.getString(2131231175, null);
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/ImojiModule.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */