package com.ikea.kompis.scan;

import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Point;
import android.hardware.Camera.Parameters;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewPropertyAnimator;
import android.view.WindowManager;
import android.widget.Toast;
import com.ikea.kompis.WelcomeActivity;
import com.ikea.kompis.extendedcontent.LoadingDialogEvent;
import com.ikea.kompis.products.ProductDetailsActivity;
import com.ikea.kompis.util.CustomPopUp;
import com.ikea.kompis.util.CustomPopUp.CustomPopupClickListener;
import com.ikea.kompis.util.UiUtil;
import com.ikea.kompis.view.EllipsisTextView;
import com.ikea.kompis.view.ScanCircleView;
import com.ikea.shared.AppError;
import com.ikea.shared.analytics.UsageTracker;
import com.ikea.shared.browse.model.ProductListing;
import com.ikea.shared.browse.service.CatalogService;
import com.ikea.shared.cart.ShoppingCart;
import com.ikea.shared.products.model.RetailItemCommunication;
import com.ikea.shared.util.Constant;
import com.ikea.shared.util.L;
import com.ikea.shared.util.ServiceCallback;
import com.metaio.sdk.CameraView;
import com.metaio.sdk.MetaioDebug;
import com.metaio.sdk.jni.CameraVector;
import com.metaio.sdk.jni.IGeometry;
import com.metaio.sdk.jni.IMetaioSDKAndroid;
import com.metaio.sdk.jni.IMetaioSDKCallback;
import com.metaio.sdk.jni.TrackingValues;
import com.metaio.sdk.jni.TrackingValuesVector;
import com.metaio.sdk.jni.Vector2di;
import com.metaio.tools.io.AssetsManager;
import java.util.List;

public class BarcodeOCRReader extends ARViewActivity
{
  private static final String KEY_POP_UP_VISIBLE = "KEY_POP_UP_VISIBLE";
  private static final String KEY_VALIDATION_GOING_ON = "KEY_VALIDATION_GOING_ON";
  public static final int REQUEST_CODE = 3338;
  public static final int REQUEST_FOR_PIP_OR_MINI_PIP = 5656;
  protected boolean ecEnabled = false;
  protected int lastScanCoorSystemID;
  private MetaioSDKCallbackHandler mCallbackHandler;
  protected View mCircleView;
  protected Context mContext;
  private int mFirstDotIndex = 0;
  private View mFlashIcon;
  protected final Handler mHandler = new Handler();
  private final int mNoOfDots = 3;
  private final View.OnClickListener mOnClickListener = new View.OnClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      switch (paramAnonymousView.getId())
      {
      default:
      case 2131624017:
      case 2131624040:
      case 2131624041:
      }
      do
      {
        return;
        BarcodeOCRReader.this.closeActivity();
        return;
        BarcodeOCRReader.this.toggleFlash();
        return;
      }
      while (BarcodeOCRReader.this.mShowScanHelpDialog.isShowing());
      BarcodeOCRReader.this.showHelpPopUp();
    }
  };
  protected boolean mPopUpVisible = false;
  protected RetailItemCommunication mRetailItemCommunication;
  protected EllipsisTextView mScanStatusText;
  private String mScanValue = "";
  protected String mSearchString;
  private final ServiceCallback<ProductListing> mServiceCallback = new ServiceCallback()
  {
    public void done(ProductListing paramAnonymousProductListing, AppError paramAnonymousAppError, Exception paramAnonymousException)
    {
      L.I("Barcode Scan result : " + paramAnonymousProductListing);
      BarcodeOCRReader.this.dismisLoadingContentDialog();
      BarcodeOCRReader.this.mValidationGoingOn = true;
      if (paramAnonymousProductListing != null)
      {
        if ((paramAnonymousProductListing.isSuccessful()) && (paramAnonymousProductListing.getRetailItemComm() != null) && (!paramAnonymousProductListing.getRetailItemComm().isEmpty()))
        {
          BarcodeOCRReader.this.mRetailItemCommunication = ((RetailItemCommunication)paramAnonymousProductListing.getRetailItemComm().get(0));
          UsageTracker localUsageTracker = UsageTracker.i();
          Context localContext = BarcodeOCRReader.this.mContext;
          int i = BarcodeOCRReader.this.noOfFrames;
          String str5;
          if (BarcodeOCRReader.this.lastScanCoorSystemID == 2)
          {
            str5 = "article";
            if (!UiUtil.isLandscape(BarcodeOCRReader.this.mContext))
              break label208;
          }
          label208: for (String str6 = "landscape"; ; str6 = "portrait")
          {
            localUsageTracker.scanCompleted(localContext, i, str5, str6, BarcodeOCRReader.this.mRetailItemCommunication);
            if (!ShoppingCart.i(BarcodeOCRReader.this.mContext).isProductCollected(BarcodeOCRReader.this.mRetailItemCommunication.getItemNo()))
              break label215;
            L.I("Item already collected");
            BarcodeOCRReader.this.showCollectedPopUp();
            return;
            str5 = "barcode";
            break;
          }
          label215: BarcodeOCRReader.this.moveToNext();
          return;
        }
        String str3 = BarcodeOCRReader.this.getString(2131165667);
        String str4 = BarcodeOCRReader.this.getString(2131165592);
        BarcodeOCRReader.this.showMessage(str4, str3);
        return;
      }
      String str1 = BarcodeOCRReader.this.getString(2131165474);
      String str2 = BarcodeOCRReader.this.getString(2131165713);
      BarcodeOCRReader.this.showMessage(str2, str1);
    }
  };
  private AlertDialog mShowScanHelpDialog;
  protected boolean mValidationGoingOn = false;
  private boolean needFlash = false;
  protected int noOfFrames = 0;

  private void closeActivity()
  {
    UsageTracker.i().setBackPressed();
    finish();
  }

  private boolean hasFlash()
  {
    android.hardware.Camera localCamera = IMetaioSDKAndroid.getCamera(this);
    if (localCamera == null)
      return false;
    Camera.Parameters localParameters = localCamera.getParameters();
    if ((localParameters != null) && (localParameters.getFlashMode() == null))
      return false;
    if (localParameters != null)
    {
      List localList = localParameters.getSupportedFlashModes();
      if ((localList == null) || (localList.isEmpty()) || ((localList.size() == 1) && (((String)localList.get(0)).equals("off"))))
        return false;
    }
    else
    {
      return false;
    }
    return true;
  }

  @SuppressLint({"InflateParams"})
  private void initHelpPopup()
  {
    View localView = LayoutInflater.from(this.mContext).inflate(2130903134, null, false);
    localView.findViewById(2131624347).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        BarcodeOCRReader.this.mShowScanHelpDialog.dismiss();
        BarcodeOCRReader.this.startCamera();
        BarcodeOCRReader.this.mPopUpVisible = false;
      }
    });
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this.mContext);
    localBuilder.setView(localView);
    localBuilder.setCancelable(true);
    this.mShowScanHelpDialog = localBuilder.create();
    this.mShowScanHelpDialog.setOnCancelListener(new DialogInterface.OnCancelListener()
    {
      public void onCancel(DialogInterface paramAnonymousDialogInterface)
      {
        L.I("Help Cancel");
        BarcodeOCRReader.this.startCamera();
        BarcodeOCRReader.this.mPopUpVisible = false;
      }
    });
  }

  private void searchForItem(final String paramString, int paramInt)
  {
    L.I("Barcode Scan scanningValue : " + paramString);
    showECContentLoadingDialog(new LoadingDialogEvent()
    {
      public void onEvent()
      {
        BarcodeOCRReader.this.dismisLoadingContentDialog();
        BarcodeOCRReader.this.mServiceCallback.markInvalid();
        if (BarcodeOCRReader.this.ecEnabled);
        for (BarcodeOCRReader.this.mSearchString = BarcodeOCRReader.this.getString(2131165769); ; BarcodeOCRReader.this.mSearchString = BarcodeOCRReader.this.getString(2131165631))
        {
          BarcodeOCRReader.this.mScanStatusText.setTextWithOutAnimation(BarcodeOCRReader.this.mSearchString);
          BarcodeOCRReader.this.startCamera();
          return;
        }
      }
    });
    this.lastScanCoorSystemID = paramInt;
    this.mHandler.postDelayed(new Runnable()
    {
      public void run()
      {
        CatalogService.i(BarcodeOCRReader.this.getApplicationContext()).searchItemAsync(paramString, null, BarcodeOCRReader.this.mServiceCallback);
      }
    }
    , 1000L);
  }

  private void showHelpPopUp()
  {
    this.mHandler.post(new Runnable()
    {
      public void run()
      {
        BarcodeOCRReader.this.metaioSDK.stopCamera();
        BarcodeOCRReader.this.mShowScanHelpDialog.show();
        BarcodeOCRReader.this.mPopUpVisible = true;
      }
    });
  }

  private void toggleFlash()
  {
    boolean bool = true;
    L.I(this, "has camera flash new  " + hasFlash());
    if (hasFlash());
    while (true)
    {
      try
      {
        if (this.needFlash)
          break label207;
        this.needFlash = bool;
        android.hardware.Camera localCamera = IMetaioSDKAndroid.getCamera(this);
        CameraView localCameraView = (CameraView)IMetaioSDKAndroid.getCameraView(this);
        Camera.Parameters localParameters = localCamera.getParameters();
        if (localParameters.getSupportedFocusModes().contains("continuous-picture"))
        {
          MetaioDebug.log("Setting camera focus mode: continuous-picture");
          localParameters.setFocusMode("continuous-picture");
          if (Build.MODEL.matches("SM-G900F"))
          {
            MetaioDebug.log("Enabling phase detection auto focus on this device!");
            localParameters.set("phase-af", "on");
          }
        }
        localCamera.setParameters(localParameters);
        if (this.needFlash)
        {
          localParameters.setFlashMode("torch");
          localCameraView.enablePreviewCallback(true);
          localCamera.setParameters(localParameters);
          localCameraView.startPreview();
          return;
        }
        localParameters.setFlashMode("off");
        continue;
      }
      catch (Exception localException)
      {
        MetaioDebug.log(6, "Error setting camera auto focus: " + localException.getMessage());
      }
      return;
      label207: bool = false;
    }
  }

  protected void enableAutoFocus()
  {
    try
    {
      android.hardware.Camera localCamera = IMetaioSDKAndroid.getCamera(this);
      CameraView localCameraView = (CameraView)IMetaioSDKAndroid.getCameraView(this);
      Camera.Parameters localParameters = localCamera.getParameters();
      localCameraView.enablePreviewCallback(false);
      localCameraView.stopPreview();
      if (localParameters.getSupportedFocusModes().contains("continuous-picture"))
      {
        MetaioDebug.log("Setting camera focus mode: continuous-picture");
        localParameters.setFocusMode("continuous-picture");
        if (Build.MODEL.matches("SM-G900F"))
        {
          MetaioDebug.log("Enabling phase detection auto focus on this device!");
          localParameters.set("phase-af", "on");
        }
      }
      localCamera.setParameters(localParameters);
      localCameraView.enablePreviewCallback(true);
      localCameraView.startPreview();
      this.mHandler.post(new Runnable()
      {
        public void run()
        {
          if (!BarcodeOCRReader.this.hasFlash())
            BarcodeOCRReader.this.mFlashIcon.animate().alpha(0.0F);
        }
      });
      return;
    }
    catch (Exception localException)
    {
      MetaioDebug.log(6, "Error setting camera auto focus: " + localException.getMessage());
    }
  }

  protected int getGUILayout()
  {
    return 2130903056;
  }

  protected IMetaioSDKCallback getMetaioSDKCallbackHandler()
  {
    return this.mCallbackHandler;
  }

  protected Intent getProductDetailIntent()
  {
    return new Intent(this, ProductDetailsActivity.class);
  }

  protected Intent getWelcomeIntent()
  {
    return new Intent(this, WelcomeActivity.class);
  }

  protected void initializemCircleView()
  {
    this.mCircleView = ((ScanCircleView)this.mGUIView.findViewById(2131624034));
  }

  protected void loadContents()
  {
  }

  protected void moveToNext()
  {
    String str1 = this.mRetailItemCommunication.getItemNo().trim();
    String str2 = this.mRetailItemCommunication.getItemType().trim();
    String str3 = this.mRetailItemCommunication.getGPRItemOrigin();
    boolean bool = ShoppingCart.i(this).isExits(str1);
    L.I("is exits scan item in SC " + bool);
    Intent localIntent;
    if (bool)
    {
      Toast.makeText(this, getString(2131165693), 1).show();
      localIntent = getProductDetailIntent();
      if (localIntent != null)
      {
        localIntent.putExtra("PRODUCT_ID", str1);
        localIntent.putExtra("FROM_SCAN", true);
        localIntent.putExtra("PRODUCT_NAME", str2);
        localIntent.putExtra("GPR_ORIGIN", str3);
        localIntent.putExtra("FOR_MINI_PIP", bool);
      }
      if (!TextUtils.isEmpty(str1))
      {
        if (!bool)
          break label194;
        Constant.i().setOfflineToastNeedToShow(false);
        startActivityForResult(localIntent, 5656);
      }
    }
    while (true)
    {
      overridePendingTransition(2130968587, 2130968584);
      return;
      localIntent = getIntent();
      break;
      label194: setResult(-1, localIntent);
      finish();
    }
  }

  public void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    super.onActivityResult(paramInt1, paramInt2, paramIntent);
    this.mScanStatusText.setTextWithAnimation(this.mSearchString, this.mFirstDotIndex, 500L);
    startCamera();
  }

  public void onBackPressed()
  {
    closeActivity();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    UiUtil.applyLocaleString(this, false);
    this.mScanValue = "";
    this.mContext = this;
    if (!UiUtil.isTablet(this))
      setRequestedOrientation(1);
    getActionBar().hide();
    if (paramBundle != null)
    {
      if (paramBundle.containsKey("KEY_VALIDATION_GOING_ON"))
        this.mValidationGoingOn = paramBundle.getBoolean("KEY_VALIDATION_GOING_ON");
      if (paramBundle.containsKey("KEY_POP_UP_VISIBLE"))
        this.mPopUpVisible = paramBundle.getBoolean("KEY_POP_UP_VISIBLE");
    }
    if (this.metaioSDK != null)
      this.metaioSDK.disableBackgroundProcessing();
    this.mCallbackHandler = new MetaioSDKCallbackHandler();
    initializemCircleView();
    this.mGUIView.findViewById(2131624017).setOnClickListener(this.mOnClickListener);
    this.mFlashIcon = this.mGUIView.findViewById(2131624040);
    this.mFlashIcon.setOnClickListener(this.mOnClickListener);
    this.mGUIView.findViewById(2131624041).setOnClickListener(this.mOnClickListener);
    this.mScanStatusText = ((EllipsisTextView)this.mGUIView.findViewById(2131624038));
    setAnimatedDots();
    initHelpPopup();
    try
    {
      AssetsManager.extractAllAssets(getApplicationContext(), false);
      String str = AssetsManager.getAssetPath(this, "TrackingData_IKEA.xml");
      boolean bool = this.metaioSDK.setTrackingConfiguration(str);
      MetaioDebug.log("Tracking data loaded: " + bool);
      return;
    }
    catch (Exception localException)
    {
      MetaioDebug.log(6, "Error loading tracking configuration");
    }
  }

  protected void onDestroy()
  {
    super.onDestroy();
    this.mCallbackHandler.delete();
    this.mCallbackHandler = null;
  }

  public void onDrawFrame()
  {
    super.onDrawFrame();
    this.noOfFrames = (1 + this.noOfFrames);
  }

  protected void onGeometryTouched(IGeometry paramIGeometry)
  {
  }

  protected void onPause()
  {
    super.onPause();
    this.mServiceCallback.markInvalid();
    stopAnimation();
  }

  protected void onResume()
  {
    super.onResume();
    this.mServiceCallback.markValid();
    if (UsageTracker.i().isBackPressed())
      UsageTracker.i().viewScan(this, false, false);
    if ((this.mValidationGoingOn) && (!this.mPopUpVisible))
    {
      resumeAnimation();
      stopAnimation();
      startCamera();
    }
  }

  protected void onSaveInstanceState(Bundle paramBundle)
  {
    super.onSaveInstanceState(paramBundle);
    paramBundle.putBoolean("KEY_VALIDATION_GOING_ON", this.mValidationGoingOn);
    paramBundle.putBoolean("KEY_POP_UP_VISIBLE", this.mPopUpVisible);
  }

  public void onSurfaceChanged(int paramInt1, int paramInt2)
  {
    super.onSurfaceChanged(paramInt1, paramInt2);
    enableAutoFocus();
  }

  protected void onValidTrackingEvent(ScanningServices.ScanningResult paramScanningResult, String paramString, int paramInt)
  {
    ScanningResultType localScanningResultType = paramScanningResult.getScanResultType();
    if (localScanningResultType == ScanningResultType.BARCODE)
      searchForItem(paramScanningResult.getScanningValue(), paramInt);
    do
    {
      return;
      if ((localScanningResultType == ScanningResultType.QR_CODE_GENERAL_VALUE) || (localScanningResultType == ScanningResultType.QR_CODE_UNSAFE_URL))
      {
        String str1 = "Scanned type: " + paramScanningResult.getScanResultType().toString() + "\n Value: " + paramScanningResult.getScanningValue() + "\n Tracking value: " + paramString.replaceAll("\r?\n", "\\\\n");
        L.I("Scan Value : " + str1);
        String str2 = getResources().getString(2131165729);
        showMessage(getString(2131165592), str2);
        return;
      }
    }
    while (localScanningResultType != ScanningResultType.QR_CODE_SAFE_URL);
    Uri localUri = Uri.parse(paramScanningResult.getScanningValue());
    this.mValidationGoingOn = true;
    Intent localIntent = new Intent("android.intent.action.VIEW", localUri);
    localIntent.addFlags(268435456);
    startActivityForResult(localIntent, 99);
  }

  protected void openShoppingList()
  {
    String str = this.mRetailItemCommunication.getItemNo().trim();
    Intent localIntent = getWelcomeIntent();
    localIntent.putExtra("SCAN_PRODUCT_ID", str);
    startActivity(localIntent);
    overridePendingTransition(2130968587, 2130968584);
  }

  protected void resumeAnimation()
  {
    this.mScanStatusText.setTextWithAnimation(this.mSearchString, this.mFirstDotIndex, 500L);
  }

  protected void setAnimatedDots()
  {
    this.mSearchString = getString(2131165631);
    this.mFirstDotIndex = (-3 + this.mSearchString.length());
    this.mScanStatusText.setTextWithAnimation(this.mSearchString, this.mFirstDotIndex, 500L);
  }

  protected void showCollectedPopUp()
  {
    CustomPopUp localCustomPopUp = new CustomPopUp(this, getString(2131165724), getString(2131165282), getString(2131165312), "", "");
    this.mPopUpVisible = true;
    localCustomPopUp.show(new CustomPopUp.CustomPopupClickListener()
    {
      public boolean onBackKeyPressed()
      {
        return false;
      }

      public void onCancel()
      {
        BarcodeOCRReader.this.mScanStatusText.setTextWithAnimation(BarcodeOCRReader.this.mSearchString, BarcodeOCRReader.this.mFirstDotIndex, 500L);
        BarcodeOCRReader.this.startCamera();
        BarcodeOCRReader.this.mPopUpVisible = false;
      }

      public void onLinkClick()
      {
        L.I("");
      }

      public void onPrimaryBtnClick()
      {
        BarcodeOCRReader.this.mHandler.post(new Runnable()
        {
          public void run()
          {
            BarcodeOCRReader.this.openShoppingList();
          }
        });
        BarcodeOCRReader.this.mPopUpVisible = false;
      }

      public void onSecondaryBtnClick()
      {
        BarcodeOCRReader.this.mScanStatusText.setTextWithAnimation(BarcodeOCRReader.this.mSearchString, BarcodeOCRReader.this.mFirstDotIndex, 500L);
        BarcodeOCRReader.this.startCamera();
        BarcodeOCRReader.this.mPopUpVisible = false;
      }
    });
  }

  protected void showMessage(String paramString1, String paramString2)
  {
    UsageTracker.i().scanFailed(this, paramString2);
    CustomPopUp localCustomPopUp = new CustomPopUp(this, paramString1, paramString2);
    this.mPopUpVisible = true;
    localCustomPopUp.show(new CustomPopUp.CustomPopupClickListener()
    {
      public boolean onBackKeyPressed()
      {
        return false;
      }

      public void onCancel()
      {
        L.I(this, " IkeaPopUp onCancel ");
        BarcodeOCRReader.this.mScanStatusText.setTextWithAnimation(BarcodeOCRReader.this.mSearchString, BarcodeOCRReader.this.mFirstDotIndex, 500L);
        BarcodeOCRReader.this.startCamera();
        BarcodeOCRReader.this.mValidationGoingOn = true;
        BarcodeOCRReader.this.mPopUpVisible = false;
      }

      public void onLinkClick()
      {
        L.I(this, " IkeaPopUp onLickClick ");
        BarcodeOCRReader.this.mScanStatusText.setTextWithAnimation(BarcodeOCRReader.this.mSearchString, BarcodeOCRReader.this.mFirstDotIndex, 500L);
        BarcodeOCRReader.this.startCamera();
        BarcodeOCRReader.this.mValidationGoingOn = true;
        BarcodeOCRReader.this.mPopUpVisible = false;
      }

      public void onPrimaryBtnClick()
      {
        BarcodeOCRReader.this.mScanStatusText.setTextWithAnimation(BarcodeOCRReader.this.mSearchString, BarcodeOCRReader.this.mFirstDotIndex, 500L);
        BarcodeOCRReader.this.startCamera();
        BarcodeOCRReader.this.mValidationGoingOn = true;
        BarcodeOCRReader.this.mPopUpVisible = false;
      }

      public void onSecondaryBtnClick()
      {
        L.I("");
      }
    });
  }

  protected void startAnimation()
  {
    ((ScanCircleView)this.mCircleView).startAnimation();
  }

  protected void startCamera()
  {
    CameraVector localCameraVector = this.metaioSDK.getCameraList();
    if (!localCameraVector.isEmpty())
    {
      com.metaio.sdk.jni.Camera localCamera = localCameraVector.get(0);
      for (int i = 0; ; i++)
        if (i < localCameraVector.size())
        {
          if (localCameraVector.get(i).getFacing() == com.metaio.sdk.jni.Camera.FACE_BACK)
            localCamera = localCameraVector.get(i);
        }
        else
        {
          getWindowManager().getDefaultDisplay().getSize(new Point());
          localCamera.setResolution(new Vector2di(640, 480));
          localCamera.setDownsample(1);
          this.noOfFrames = 0;
          this.metaioSDK.startCamera(localCamera);
          return;
        }
    }
    MetaioDebug.log(5, "No camera found on the device!");
  }

  protected void stopAnimation()
  {
    ((ScanCircleView)this.mCircleView).stopAnimation();
  }

  final class MetaioSDKCallbackHandler extends IMetaioSDKCallback
  {
    MetaioSDKCallbackHandler()
    {
    }

    public void onTrackingEvent(TrackingValuesVector paramTrackingValuesVector)
    {
      for (int i = 0; ; i++)
      {
        final String str;
        final int j;
        int k;
        if (i < paramTrackingValuesVector.size())
        {
          TrackingValues localTrackingValues = paramTrackingValuesVector.get(i);
          MetaioDebug.log("Tracking state for COS " + localTrackingValues.getCoordinateSystemID() + " is " + localTrackingValues.getState());
          str = paramTrackingValuesVector.get(0).getAdditionalValues();
          j = paramTrackingValuesVector.get(0).getCoordinateSystemID();
          L.I(this, "Scan tracking value " + str);
          if ((TextUtils.isEmpty(str)) || (!str.equalsIgnoreCase(BarcodeOCRReader.this.mScanValue)))
            break label237;
          k = 1;
        }
        while (k != 0)
        {
          BarcodeOCRReader.access$702(BarcodeOCRReader.this, "");
          final ScanningServices.ScanningResult localScanningResult = new ScanningServicesImpl().validateTrackingValue(str, BarcodeOCRReader.this.mContext);
          L.I("Scanned type: " + localScanningResult.getScanResultType().toString() + ", value: " + localScanningResult.getScanningValue() + " (tracking value: " + str.replaceAll("\r?\n", "\\\\n") + ")");
          if (localScanningResult.getScanResultType() == ScanningResultType.INVALID)
          {
            return;
            label237: boolean bool = TextUtils.isEmpty(str);
            k = 0;
            if (!bool)
            {
              BarcodeOCRReader.access$702(BarcodeOCRReader.this, str);
              k = 0;
            }
          }
          else
          {
            BarcodeOCRReader.this.mHandler.post(new Runnable()
            {
              public void run()
              {
                BarcodeOCRReader.this.mValidationGoingOn = true;
                BarcodeOCRReader.this.metaioSDK.stopCamera();
                BarcodeOCRReader.this.mScanStatusText.setTextWithOutAnimation(BarcodeOCRReader.this.getString(2131165603));
                BarcodeOCRReader.this.onValidTrackingEvent(localScanningResult, str, j);
              }
            });
          }
        }
      }
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.ikea.kompis.scan.BarcodeOCRReader
 * JD-Core Version:    0.6.2
 */