chore: reorganize analysis/ by SDK lineage (linux/win/android) with README index, move legacy notes to history/, refresh root README, ignore .zcode/

This commit is contained in:
ZXCLI
2026-09-10 03:09:13 +08:00
parent 4ba98f62cd
commit e69a97436b
137 changed files with 123 additions and 62 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,252 @@
package cn.com.magnity.magnitycx;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.ContextMenu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import cn.com.magnity.magnitycx.sdk.MagParameter;
import cn.com.magnity.magnitycx.sdk.UsbConnection;
import com.baidu.mobstat.StatService;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.ChecksumException;
import com.google.zxing.FormatException;
import com.google.zxing.NotFoundException;
import com.google.zxing.RGBLuminanceSource;
import com.google.zxing.Result;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.qrcode.QRCodeReader;
import java.io.File;
import java.io.FileOutputStream;
/* loaded from: classes.dex */
public class AboutAboutActivity extends AppCompatActivity {
private ImageView imageView_;
private PackageInfo packInfo_;
private TextView tvCompanyCaption_;
private TextView tvCompany_;
private TextView tvFWVersionCaption_;
private TextView tvFWVersion_;
private TextView tvHWVersionCaption_;
private TextView tvHWVersion_;
private TextView tvProductTypeCaption_;
private TextView tvProductType_;
private TextView tvRightCaption_;
private TextView tvRight_;
private TextView tvSWVersionCaption_;
private TextView tvSWVersion_;
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.support.v4.app.BaseFragmentActivityGingerbread, android.app.Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about_about);
ActionBar actionBar = getSupportActionBar();
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
setTitle(R.string.settingsAboutAbout);
PackageManager packageManager = getPackageManager();
try {
this.packInfo_ = packageManager.getPackageInfo(getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
this.packInfo_ = null;
}
this.tvProductTypeCaption_ = (TextView) findViewById(R.id.id_text1);
this.tvProductTypeCaption_.setText(R.string.productType);
this.tvProductType_ = (TextView) findViewById(R.id.id_text2);
if (UsbConnection.getInstance().isConnected()) {
switch (MagApplication.magParameter.basePara1.devType) {
case 0:
this.tvProductType_.setText(R.string.c1);
break;
case 1:
this.tvProductType_.setText(R.string.c3);
break;
case 2:
this.tvProductType_.setText(R.string.c3p);
break;
case 3:
this.tvProductType_.setText(R.string.core160);
break;
case 4:
default:
this.tvProductType_.setText("");
break;
case 5:
this.tvProductType_.setText(R.string.c1pro);
break;
case 6:
this.tvProductType_.setText(R.string.c1prolite);
break;
}
} else {
this.tvProductType_.setText("");
}
View view = findViewById(R.id.id_swVersion);
this.tvSWVersionCaption_ = (TextView) view.findViewById(R.id.id_text1);
this.tvSWVersionCaption_.setText(R.string.swVersion);
this.tvSWVersion_ = (TextView) view.findViewById(R.id.id_text2);
if (this.packInfo_ != null) {
this.tvSWVersion_.setText(this.packInfo_.versionName);
}
View view2 = findViewById(R.id.id_right);
this.tvRightCaption_ = (TextView) view2.findViewById(R.id.id_text1);
this.tvRightCaption_.setText(R.string.right);
this.tvRight_ = (TextView) view2.findViewById(R.id.id_text2);
this.tvRight_.setText(R.string.juge);
View view3 = findViewById(R.id.id_fwVersion);
this.tvFWVersionCaption_ = (TextView) view3.findViewById(R.id.id_text1);
this.tvFWVersionCaption_.setText(R.string.fwVersion);
this.tvFWVersion_ = (TextView) view3.findViewById(R.id.id_text2);
if (UsbConnection.getInstance().isConnected()) {
this.tvFWVersion_.setText(Integer.toString(MagApplication.magParameter.basePara1.swVersion));
} else {
this.tvFWVersion_.setText("");
}
View view4 = findViewById(R.id.id_hwVersion);
this.tvHWVersionCaption_ = (TextView) view4.findViewById(R.id.id_text1);
this.tvHWVersionCaption_.setText(R.string.hwVersion);
this.tvHWVersion_ = (TextView) view4.findViewById(R.id.id_text2);
if (UsbConnection.getInstance().isConnected()) {
this.tvHWVersion_.setText(Integer.toString(MagApplication.magParameter.basePara1.hwVersion));
} else {
this.tvHWVersion_.setText("");
}
View view5 = findViewById(R.id.id_company);
this.tvCompanyCaption_ = (TextView) view5.findViewById(R.id.id_text1);
this.tvCompanyCaption_.setText(R.string.company);
this.tvCompany_ = (TextView) view5.findViewById(R.id.id_text2);
this.tvCompany_.setText("http://www.magnity.com.cn");
this.tvCompany_.setTextColor(-12211576);
this.tvCompany_.setPaintFlags(8);
view5.setOnClickListener(new MagClickListener());
this.imageView_ = (ImageView) findViewById(R.id.id_barcodeView);
registerForContextMenu(this.imageView_);
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onDestroy() {
unregisterForContextMenu(this.imageView_);
super.onDestroy();
}
@Override // android.app.Activity, android.view.View.OnCreateContextMenuListener
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.add(0, 2, 1, R.string.menu_read_barcode);
}
@Override // android.app.Activity
public boolean onContextItemSelected(MenuItem item) {
switch (item.getItemId()) {
case 1:
shareOnlineImage(this.imageView_);
break;
case 2:
StatService.onEvent(getApplicationContext(), MagParameter.EVENT_ENTER_WECHAT_STORE_ID, MagParameter.EVENT_ENTER_WECHAT_STORE);
readBarcode(this.imageView_);
break;
}
return super.onContextItemSelected(item);
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPause() {
super.onPause();
StatService.onPause(this);
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPostResume() {
super.onPostResume();
StatService.onResume(this);
}
private void shareOnlineImage(ImageView v) {
Bitmap bmp = ((BitmapDrawable) v.getDrawable()).getBitmap();
try {
File file = new File(getExternalFilesDir("temp"), "barcode.jpg");
try {
FileOutputStream out = new FileOutputStream(file);
bmp.compress(Bitmap.CompressFormat.JPEG, 100, out);
out.close();
if (file.exists()) {
Intent intent = new Intent("android.intent.action.SEND");
intent.putExtra("android.intent.extra.STREAM", Uri.fromFile(file));
intent.addFlags(1);
intent.setType("image/*");
startActivity(Intent.createChooser(intent, getResources().getString(R.string.menu_share_barcode)));
}
} catch (Exception e) {
}
} catch (Exception e2) {
}
}
private void readBarcode(ImageView v) {
Result re = null;
try {
Bitmap bmp = ((BitmapDrawable) v.getDrawable()).getBitmap();
int width = bmp.getWidth();
int height = bmp.getHeight();
int[] data = new int[width * height];
bmp.getPixels(data, 0, width, 0, 0, width, height);
RGBLuminanceSource source = new RGBLuminanceSource(width, height, data);
BinaryBitmap bitmap1 = new BinaryBitmap(new HybridBinarizer(source));
QRCodeReader reader = new QRCodeReader();
try {
try {
re = reader.decode(bitmap1);
} catch (NotFoundException e) {
e.printStackTrace();
}
} catch (ChecksumException e2) {
e2.printStackTrace();
} catch (FormatException e3) {
e3.printStackTrace();
}
if (re == null) {
Toast.makeText(this, R.string.tip_barcode_fail, 0).show();
} else {
Toast.makeText(this, String.format(getResources().getString(R.string.tip_goto_store), re.getText()), 0).show();
StoreActivity.actionStart(this, re.getText());
}
} catch (Exception e4) {
}
}
@Override // android.app.Activity
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
super.onBackPressed();
break;
}
return super.onOptionsItemSelected(item);
}
private class MagClickListener implements View.OnClickListener {
private MagClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
switch (v.getId()) {
case R.id.id_company /* 2131624064 */:
Uri uri = Uri.parse("http://www.magnity.com.cn");
Intent intent = new Intent("android.intent.action.VIEW", uri);
AboutAboutActivity.this.startActivity(intent);
break;
}
}
}
}
@@ -0,0 +1,42 @@
package cn.com.magnity.magnitycx;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.baidu.mobstat.StatService;
/* loaded from: classes.dex */
public class AboutProductActivity extends AppCompatActivity {
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.support.v4.app.BaseFragmentActivityGingerbread, android.app.Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about_product);
ActionBar actionBar = getSupportActionBar();
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
setTitle(R.string.settingsAboutProduct);
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPause() {
super.onPause();
StatService.onPause(this);
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPostResume() {
super.onPostResume();
StatService.onResume(this);
}
@Override // android.app.Activity
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
super.onBackPressed();
break;
}
return super.onOptionsItemSelected(item);
}
}
@@ -0,0 +1,11 @@
package cn.com.magnity.magnitycx;
/* loaded from: classes.dex */
public final class BuildConfig {
public static final String APPLICATION_ID = "cn.com.magnity.magnitycx";
public static final String BUILD_TYPE = "release";
public static final boolean DEBUG = false;
public static final String FLAVOR = "";
public static final int VERSION_CODE = 114;
public static final String VERSION_NAME = "1.1.4";
}
@@ -0,0 +1,101 @@
package cn.com.magnity.magnitycx;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import cn.com.magnity.magnitycx.log.Logging;
import java.util.ArrayList;
/* loaded from: classes.dex */
public class DialogFragmentMediaInfo extends DialogFragment {
private static final String MEDIAFILEINFO = "mediaFileInfo";
private MagOnClickListener magOnClickListener_;
private ArrayList<String> mediaInfos_;
public static DialogFragmentMediaInfo newInstance(ArrayList<String> info) {
Bundle bundle = new Bundle();
bundle.putStringArrayList(MEDIAFILEINFO, info);
DialogFragmentMediaInfo dlg = new DialogFragmentMediaInfo();
dlg.setArguments(bundle);
return dlg;
}
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bundle = getArguments();
if (bundle != null) {
this.mediaInfos_ = bundle.getStringArrayList(MEDIAFILEINFO);
}
this.magOnClickListener_ = new MagOnClickListener();
}
private void fillCatigory(View rootView, int viewId, int stringId, String name) {
View item = rootView.findViewById(viewId);
TextView text = (TextView) item.findViewById(R.id.id_text_item_left);
text.setText(stringId);
TextView text2 = (TextView) item.findViewById(R.id.id_text_item_right);
text2.setText(name);
}
@Override // android.support.v4.app.DialogFragment
public Dialog onCreateDialog(Bundle savedInstanceState) {
int i;
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_fragment_media_info, (ViewGroup) null);
Button btnOk = (Button) view.findViewById(R.id.id_btn_ok);
btnOk.setOnClickListener(this.magOnClickListener_);
try {
int i2 = 0 + 1;
try {
boolean isVideo = Integer.parseInt(this.mediaInfos_.get(0)) != 0;
int i3 = i2 + 1;
fillCatigory(view, R.id.id_media_info_name, R.string.mediaInfoName, this.mediaInfos_.get(i2));
int i4 = i3 + 1;
fillCatigory(view, R.id.id_media_info_time, R.string.mediaInfoTime, this.mediaInfos_.get(i3));
int i5 = i4 + 1;
fillCatigory(view, R.id.id_media_info_size, R.string.mediaInfoSize, this.mediaInfos_.get(i4));
if (isVideo) {
i = i5 + 1;
fillCatigory(view, R.id.id_media_info_duration, R.string.mediaInfoDuration, this.mediaInfos_.get(i5));
} else {
View item = view.findViewById(R.id.id_media_info_duration);
item.setVisibility(8);
i = i5 + 1;
}
int i6 = i + 1;
fillCatigory(view, R.id.id_media_info_resolution, R.string.mediaInfoResolution, this.mediaInfos_.get(i));
i2 = i6 + 1;
fillCatigory(view, R.id.id_media_info_path, R.string.mediaInfoPath, this.mediaInfos_.get(i6));
} catch (Exception e) {
Logging.trace("Fail to get media info");
builder.setView(view);
return builder.create();
}
} catch (Exception e2) {
}
builder.setView(view);
return builder.create();
}
private class MagOnClickListener implements View.OnClickListener {
private MagOnClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
switch (v.getId()) {
case R.id.id_btn_ok /* 2131624096 */:
DialogFragmentMediaInfo.this.dismiss();
break;
}
}
}
}
@@ -0,0 +1,76 @@
package cn.com.magnity.magnitycx;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
/* loaded from: classes.dex */
public class DialogFragmentMode extends DialogFragment {
private ImageButton btnGoBack_;
private ImageButton btnModeIr_;
private ImageButton btnModePip_;
private ModeClickListener modeClickListener_;
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(0, android.R.style.Theme.Black.NoTitleBar.Fullscreen);
this.modeClickListener_ = new ModeClickListener();
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.dialog_fragment_mode, container);
this.btnGoBack_ = (ImageButton) rootView.findViewById(R.id.id_goback);
this.btnModeIr_ = (ImageButton) rootView.findViewById(R.id.id_mode_ir);
this.btnModePip_ = (ImageButton) rootView.findViewById(R.id.id_mode_pip);
this.btnGoBack_.setOnClickListener(this.modeClickListener_);
this.btnModeIr_.setOnClickListener(this.modeClickListener_);
this.btnModePip_.setOnClickListener(this.modeClickListener_);
setDialogProperty();
return rootView;
}
private void setDialogProperty() {
getDialog().requestWindowFeature(1);
getDialog().setCanceledOnTouchOutside(true);
Window window = getDialog().getWindow();
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.width = -1;
windowParams.height = -2;
window.setAttributes(windowParams);
window.setGravity(48);
window.setWindowAnimations(R.style.ThemeDialog);
}
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.dimAmount = 0.4f;
windowParams.alpha = 1.0f;
window.setAttributes(windowParams);
}
private class ModeClickListener implements View.OnClickListener {
private ModeClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
switch (v.getId()) {
case R.id.id_goback /* 2131624058 */:
DialogFragmentMode.this.dismiss();
break;
}
}
}
}
@@ -0,0 +1,130 @@
package cn.com.magnity.magnitycx;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.TextView;
import cn.com.magnity.magnitycx.sdk.DeviceController;
import cn.com.magnity.magnitycx.sdk.SharedPreferencesManager;
import java.util.HashMap;
/* loaded from: classes.dex */
public class DialogFragmentPalette extends DialogFragment implements View.OnClickListener {
private View rootView_;
private HashMap<Object, Object> mapIndex2Id_ = new HashMap<Object, Object>() { // from class: cn.com.magnity.magnitycx.DialogFragmentPalette.1
{
put(0, Integer.valueOf(R.id.id_palette_white_hot));
put(1, Integer.valueOf(R.id.id_palette_black_hot));
put(2, Integer.valueOf(R.id.id_palette_iron_bow));
put(3, Integer.valueOf(R.id.id_palette_rain_bow));
put(4, Integer.valueOf(R.id.id_palette_glow_bow));
put(5, Integer.valueOf(R.id.id_palette_autumn));
put(6, Integer.valueOf(R.id.id_palette_winter));
put(7, Integer.valueOf(R.id.id_palette_hot_metal));
put(8, Integer.valueOf(R.id.id_palette_jet));
put(9, Integer.valueOf(R.id.id_palette_red_saturation));
put(10, Integer.valueOf(R.id.id_palette_high_contrast));
put(11, Integer.valueOf(R.id.id_palette_ret_hot));
}
};
private HashMap<Object, Object> mapId2Index_ = new HashMap<Object, Object>() { // from class: cn.com.magnity.magnitycx.DialogFragmentPalette.2
{
put(Integer.valueOf(R.id.id_palette_white_hot), 0);
put(Integer.valueOf(R.id.id_palette_black_hot), 1);
put(Integer.valueOf(R.id.id_palette_iron_bow), 2);
put(Integer.valueOf(R.id.id_palette_rain_bow), 3);
put(Integer.valueOf(R.id.id_palette_glow_bow), 4);
put(Integer.valueOf(R.id.id_palette_autumn), 5);
put(Integer.valueOf(R.id.id_palette_winter), 6);
put(Integer.valueOf(R.id.id_palette_hot_metal), 7);
put(Integer.valueOf(R.id.id_palette_jet), 8);
put(Integer.valueOf(R.id.id_palette_red_saturation), 9);
put(Integer.valueOf(R.id.id_palette_high_contrast), 10);
put(Integer.valueOf(R.id.id_palette_ret_hot), 11);
}
};
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
this.rootView_ = inflater.inflate(R.layout.dialog_fragment_palette, container);
initPalette(this.rootView_);
getDialog().requestWindowFeature(1);
getDialog().setCanceledOnTouchOutside(true);
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.liveBackground)));
return this.rootView_;
}
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.dimAmount = 0.0f;
windowParams.alpha = 0.7f;
window.setAttributes(windowParams);
}
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onDestroyView() {
super.onDestroyView();
}
private void initPalette(View rootView) {
fillPalette(rootView, R.id.id_palette_white_hot, R.mipmap.palette_white_hot, R.string.paletteWhiteHot);
fillPalette(rootView, R.id.id_palette_black_hot, R.mipmap.palette_black_hot, R.string.paletteBlackHot);
fillPalette(rootView, R.id.id_palette_iron_bow, R.mipmap.palette_iron_bow, R.string.paletteIronBow);
fillPalette(rootView, R.id.id_palette_rain_bow, R.mipmap.palette_rain_bow, R.string.paletteRainBow);
fillPalette(rootView, R.id.id_palette_glow_bow, R.mipmap.palette_glow_bow, R.string.paletteGlowBow);
fillPalette(rootView, R.id.id_palette_autumn, R.mipmap.palette_autumn, R.string.paletteAutumn);
fillPalette(rootView, R.id.id_palette_winter, R.mipmap.palette_winter, R.string.paletteWinter);
fillPalette(rootView, R.id.id_palette_hot_metal, R.mipmap.palette_hot_metal, R.string.paletteHotMetal);
fillPalette(rootView, R.id.id_palette_jet, R.mipmap.palette_jet, R.string.paletteJet);
fillPalette(rootView, R.id.id_palette_red_saturation, R.mipmap.palette_red_saturation, R.string.paletteRedSaturation);
fillPalette(rootView, R.id.id_palette_high_contrast, R.mipmap.palette_high_contrast, R.string.paletteHighContrast);
fillPalette(rootView, R.id.id_palette_ret_hot, R.mipmap.palette_red_hot, R.string.paletteRedhot);
updateSelectionUi(0, SharedPreferencesManager.getInt("paletteIndex", 2));
}
private void fillPalette(View rootView, int viewId, int imgId, int tvId) {
View v = rootView.findViewById(viewId);
v.setBackgroundColor(0);
ImageButton viewer = (ImageButton) v.findViewById(R.id.id_palette_image);
viewer.setImageResource(imgId);
viewer.setOnClickListener(this);
TextView tv = (TextView) v.findViewById(R.id.id_palette_label);
tv.setText(tvId);
}
void updateSelectionUi(int formerSelected, int currentSelected) {
View v = this.rootView_.findViewById(((Integer) this.mapIndex2Id_.get(Integer.valueOf(formerSelected))).intValue());
v.setBackgroundColor(0);
View v2 = this.rootView_.findViewById(((Integer) this.mapIndex2Id_.get(Integer.valueOf(currentSelected))).intValue());
v2.setBackgroundColor(1073741823);
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
ViewGroup parent;
if (v.getId() == R.id.id_palette_image && (parent = (ViewGroup) v.getParent().getParent()) != null) {
int index = ((Integer) this.mapId2Index_.get(Integer.valueOf(parent.getId()))).intValue();
updateSelectionUi(SharedPreferencesManager.getInt("paletteIndex", 2), index);
DeviceController.Lock();
DeviceController.setColorPalette(index);
DeviceController.Unlock();
SharedPreferencesManager.putIntWithCommit("paletteIndex", index);
}
}
}
@@ -0,0 +1,79 @@
package cn.com.magnity.magnitycx;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
/* loaded from: classes.dex */
public class DialogFragmentSetting extends DialogFragment {
private ImageButton btnGoBack_;
private ImageButton btnSettingInText_;
private SettingClickListener settingClickListener_;
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(0, android.R.style.Theme.Black.NoTitleBar.Fullscreen);
this.settingClickListener_ = new SettingClickListener();
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.dialog_fragment_setting, container);
this.btnGoBack_ = (ImageButton) rootView.findViewById(R.id.id_goback);
this.btnSettingInText_ = (ImageButton) rootView.findViewById(R.id.id_setting_in_text);
this.btnGoBack_.setOnClickListener(this.settingClickListener_);
this.btnSettingInText_.setOnClickListener(this.settingClickListener_);
setDialogProperty();
return rootView;
}
void setDialogProperty() {
getDialog().requestWindowFeature(1);
getDialog().setCanceledOnTouchOutside(true);
Window window = getDialog().getWindow();
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.width = -1;
windowParams.height = -2;
window.setAttributes(windowParams);
window.setGravity(48);
window.setWindowAnimations(R.style.ThemeDialog);
}
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.dimAmount = 0.4f;
windowParams.alpha = 1.0f;
window.setAttributes(windowParams);
}
private class SettingClickListener implements View.OnClickListener {
private SettingClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
switch (v.getId()) {
case R.id.id_goback /* 2131624058 */:
DialogFragmentSetting.this.dismiss();
break;
case R.id.id_setting_in_text /* 2131624119 */:
Intent intent = new Intent(DialogFragmentSetting.this.getActivity(), (Class<?>) SupportActivity.class);
DialogFragmentSetting.this.startActivity(intent);
DialogFragmentSetting.this.dismiss();
break;
}
}
}
}
@@ -0,0 +1,149 @@
package cn.com.magnity.magnitycx;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import cn.com.magnity.magnitycx.sdk.DelegateOptionSelected;
import java.util.ArrayList;
/* loaded from: classes.dex */
public class DialogOption extends DialogFragment {
private static final String ARGUMENT_LIST = "ARGUMENT_LIST";
private static final int[] LIST_ITEMS = {R.id.id_option_sel1, R.id.id_option_sel2, R.id.id_option_sel3, R.id.id_option_sel4, R.id.id_option_sel5};
private int initSel_;
private DelegateOptionSelected intf_;
private int itemId_;
private int[] listNames_;
private int tipId_;
private int titleId_;
public static DialogOption newInstance(int titleId, int itemId, int[] listNames, int initSel, DelegateOptionSelected intf, int tipId) {
Bundle bundle = new Bundle();
ArrayList bundlelist = new ArrayList();
bundlelist.add(Integer.valueOf(titleId));
bundlelist.add(Integer.valueOf(itemId));
bundlelist.add(listNames);
bundlelist.add(Integer.valueOf(initSel));
bundlelist.add(intf);
bundlelist.add(Integer.valueOf(tipId));
bundle.putParcelableArrayList(ARGUMENT_LIST, bundlelist);
DialogOption dlg = new DialogOption();
dlg.setArguments(bundle);
return dlg;
}
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bundle = getArguments();
if (bundle != null) {
ArrayList list = bundle.getParcelableArrayList(ARGUMENT_LIST);
int i = 0 + 1;
this.titleId_ = ((Integer) list.get(0)).intValue();
int i2 = i + 1;
this.itemId_ = ((Integer) list.get(i)).intValue();
int i3 = i2 + 1;
this.listNames_ = (int[]) list.get(i2);
int i4 = i3 + 1;
this.initSel_ = ((Integer) list.get(i3)).intValue();
int i5 = i4 + 1;
this.intf_ = (DelegateOptionSelected) list.get(i4);
int i6 = i5 + 1;
this.tipId_ = ((Integer) list.get(i5)).intValue();
}
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
getDialog().requestWindowFeature(1);
getDialog().setCanceledOnTouchOutside(true);
return super.onCreateView(inflater, container, savedInstanceState);
}
@Override // android.support.v4.app.DialogFragment
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
View rootView = inflater.inflate(R.layout.dialog_fragment_option, (ViewGroup) null);
MagClickListner magClickListner = new MagClickListner();
int i = 0;
View v = rootView.findViewById(R.id.id_option_title);
((TextView) v).setText(this.titleId_);
for (int id : this.listNames_) {
View v2 = setText_(rootView, LIST_ITEMS[i], id, this.initSel_ == i);
v2.setOnClickListener(magClickListner);
i++;
}
for (int j = i; j < LIST_ITEMS.length; j++) {
View v3 = rootView.findViewById(LIST_ITEMS[j]);
v3.setVisibility(8);
}
if (this.tipId_ != 0) {
View v4 = rootView.findViewById(R.id.id_text);
v4.setVisibility(0);
((TextView) v4).setText(this.tipId_);
}
View v5 = rootView.findViewById(R.id.id_btn_cancel);
v5.setOnClickListener(magClickListner);
builder.setView(rootView);
return builder.create();
}
private View setText_(View rootView, int itemId, int stringId, boolean isSelected) {
View item = rootView.findViewById(itemId);
TextView txtView = (TextView) item.findViewById(R.id.id_setting_item_text);
txtView.setText(stringId);
ImageView imgView = (ImageView) item.findViewById(R.id.id_setting_icon);
if (isSelected) {
imgView.setImageResource(R.mipmap.item_selected);
} else {
imgView.setImageResource(R.mipmap.item_unselected);
}
return item;
}
private class MagClickListner implements View.OnClickListener {
private MagClickListner() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
int id = v.getId();
switch (id) {
case R.id.id_option_sel1 /* 2131624100 */:
DialogOption.this.intf_.onOptionSelected(DialogOption.this.itemId_, 0);
DialogOption.this.dismiss();
break;
case R.id.id_option_sel2 /* 2131624101 */:
DialogOption.this.intf_.onOptionSelected(DialogOption.this.itemId_, 1);
DialogOption.this.dismiss();
break;
case R.id.id_option_sel3 /* 2131624102 */:
DialogOption.this.intf_.onOptionSelected(DialogOption.this.itemId_, 2);
DialogOption.this.dismiss();
break;
case R.id.id_option_sel4 /* 2131624103 */:
DialogOption.this.intf_.onOptionSelected(DialogOption.this.itemId_, 3);
DialogOption.this.dismiss();
break;
case R.id.id_option_sel5 /* 2131624104 */:
DialogOption.this.intf_.onOptionSelected(DialogOption.this.itemId_, 4);
DialogOption.this.dismiss();
break;
case R.id.id_btn_cancel /* 2131624106 */:
DialogOption.this.dismiss();
break;
}
}
}
}
@@ -0,0 +1,409 @@
package cn.com.magnity.magnitycx;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import cn.com.magnity.magnitycx.FragmentMainCenter;
import cn.com.magnity.magnitycx.MainActivity;
import cn.com.magnity.magnitycx.sdk.BitmapUtilities;
import cn.com.magnity.magnitycx.sdk.DelegateDeviceConnected;
import cn.com.magnity.magnitycx.sdk.DeviceController;
import cn.com.magnity.magnitycx.sdk.GlobalFunc;
import cn.com.magnity.magnitycx.sdk.MagParameter;
import cn.com.magnity.magnitycx.sdk.SharedPreferencesManager;
import cn.com.magnity.magnitycx.sdk.TimerHelper;
import cn.com.magnity.magnitycx.sdk.UsbCommunication;
import com.baidu.mobstat.Config;
import com.baidu.mobstat.StatService;
import java.io.File;
import java.util.ArrayList;
/* loaded from: classes.dex */
public class FragmentMainBottom extends Fragment implements MainActivity.DelegateFling, DelegateDeviceConnected, FragmentMainCenter.DelegateCapture {
static final int PHOTO_MARGIN_MARGIN = 0;
private ImageButton btnCapture_;
private ImageButton btnPalette_;
private Handler handler_;
private RelativeLayout layoutSelection_;
private MagClickListener magClickListener_;
private int modeSelection_;
private int screenHeight_;
private int screenWidth_;
private TimerHelper timerHelper_;
private TextView tvPhoto_;
private TextView tvRecord_;
private ImageButton viewBrowse_;
private View viewRecordingPoint_;
private ImageView viewSelectPointer_;
@Override // android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main_bottom, container, false);
init(rootView);
return rootView;
}
@Override // android.support.v4.app.Fragment
public void onResume() {
ArrayList<String> fileNames = new ArrayList<>();
GlobalFunc globalFunc = MagApplication.globalFunc;
GlobalFunc.updateFileList(fileNames);
if (fileNames.size() == 0) {
this.viewBrowse_.setScaleType(ImageView.ScaleType.CENTER);
this.viewBrowse_.setImageResource(R.mipmap.empty_photo);
} else {
String pathName = MagApplication.magParameter.mediaDir + File.separator + fileNames.get(0);
int w = getResources().getDimensionPixelSize(R.dimen.mainBottomButtonSize);
BitmapUtilities.getBitmapThumbnail(pathName, w, w);
this.viewBrowse_.setScaleType(ImageView.ScaleType.CENTER_CROP);
this.viewBrowse_.setImageBitmap(BitmapUtilities.getBitmapThumbnail(pathName, getResources().getDimensionPixelSize(R.dimen.mainBottomButtonSize), getResources().getDimensionPixelSize(R.dimen.mainBottomButtonSize)));
}
super.onResume();
}
@Override // android.support.v4.app.Fragment
public void onStop() {
if (DeviceController.isRecording()) {
this.btnCapture_.performClick();
}
super.onStop();
}
private void init(View v) {
this.magClickListener_ = new MagClickListener();
this.tvPhoto_ = (TextView) v.findViewById(R.id.id_photo);
this.tvRecord_ = (TextView) v.findViewById(R.id.id_record);
this.btnCapture_ = (ImageButton) v.findViewById(R.id.id_capture);
this.btnPalette_ = (ImageButton) v.findViewById(R.id.id_palette);
this.viewBrowse_ = (ImageButton) v.findViewById(R.id.id_browse);
this.viewSelectPointer_ = (ImageView) v.findViewById(R.id.id_selector_point);
this.layoutSelection_ = (RelativeLayout) v.findViewById(R.id.id_selection);
this.viewRecordingPoint_ = v.findViewById(R.id.id_recording_point);
this.tvPhoto_.setOnClickListener(this.magClickListener_);
this.tvRecord_.setOnClickListener(this.magClickListener_);
this.btnCapture_.setOnClickListener(this.magClickListener_);
this.btnPalette_.setOnClickListener(this.magClickListener_);
this.viewBrowse_.setOnClickListener(this.magClickListener_);
DisplayMetrics outMetrics = new DisplayMetrics();
getActivity().getWindow().getWindowManager().getDefaultDisplay().getMetrics(outMetrics);
this.screenWidth_ = outMetrics.widthPixels;
this.screenHeight_ = outMetrics.heightPixels;
initModeSelection();
onDeviceDisconnected();
}
public void initModeSelection() {
this.modeSelection_ = SharedPreferencesManager.getInt("modeSelection", 0);
int orientation = getActivity().getResources().getConfiguration().orientation;
RelativeLayout.LayoutParams layoutPhoto = (RelativeLayout.LayoutParams) this.tvPhoto_.getLayoutParams();
RelativeLayout.LayoutParams layoutRecord = (RelativeLayout.LayoutParams) this.tvRecord_.getLayoutParams();
if (layoutPhoto.getRules()[13] != 0) {
layoutPhoto.addRule(13, 0);
}
if (layoutPhoto.getRules()[0] != 0) {
layoutPhoto.addRule(0, 0);
}
if (layoutPhoto.getRules()[3] != 0) {
layoutPhoto.addRule(3, 0);
}
if (layoutRecord.getRules()[13] != 0) {
layoutRecord.addRule(13, 0);
}
if (layoutRecord.getRules()[1] != 0) {
layoutRecord.addRule(1, 0);
}
if (layoutRecord.getRules()[2] != 0) {
layoutRecord.addRule(2, 0);
}
if (this.modeSelection_ == 0) {
this.btnCapture_.setImageResource(R.drawable.button_capture_photo_select);
} else {
this.btnCapture_.setImageResource(R.mipmap.recording_finished);
}
if (orientation == 1) {
if (this.modeSelection_ == 0) {
if (layoutPhoto.getRules()[13] == 0) {
layoutPhoto.addRule(13);
}
if (layoutRecord.getRules()[1] == 0) {
layoutRecord.addRule(1, R.id.id_photo);
}
this.tvPhoto_.setTextColor(getResources().getColor(R.color.selectedModeText));
this.tvRecord_.setTextColor(getResources().getColor(R.color.textColor));
return;
}
if (this.modeSelection_ == 1) {
if (layoutRecord.getRules()[13] == 0) {
layoutRecord.addRule(13);
}
if (layoutPhoto.getRules()[0] == 0) {
layoutPhoto.addRule(0, R.id.id_record);
}
this.tvPhoto_.setTextColor(getResources().getColor(R.color.textColor));
this.tvRecord_.setTextColor(getResources().getColor(R.color.selectedModeText));
return;
}
return;
}
if (this.modeSelection_ == 0) {
if (layoutPhoto.getRules()[13] == 0) {
layoutPhoto.addRule(13);
}
if (layoutRecord.getRules()[2] == 0) {
layoutRecord.addRule(2, R.id.id_photo);
}
this.tvPhoto_.setTextColor(getResources().getColor(R.color.selectedModeText));
this.tvRecord_.setTextColor(getResources().getColor(R.color.textColor));
return;
}
if (this.modeSelection_ == 1) {
if (layoutRecord.getRules()[13] == 0) {
layoutRecord.addRule(13);
}
if (layoutPhoto.getRules()[3] == 0) {
layoutPhoto.addRule(3, R.id.id_record);
}
this.tvPhoto_.setTextColor(getResources().getColor(R.color.textColor));
this.tvRecord_.setTextColor(getResources().getColor(R.color.selectedModeText));
}
}
@Override // cn.com.magnity.magnitycx.sdk.DelegateDeviceConnected
public void onDeviceConnected(UsbCommunication usbComm) {
if (this.btnPalette_ != null) {
this.btnPalette_.setVisibility(0);
}
if (this.btnCapture_ != null) {
this.btnCapture_.setVisibility(0);
}
if (this.viewSelectPointer_ != null) {
this.viewSelectPointer_.setVisibility(0);
}
if (this.layoutSelection_ != null) {
this.layoutSelection_.setVisibility(0);
}
}
@Override // cn.com.magnity.magnitycx.sdk.DelegateDeviceConnected
public void onDeviceDisconnected() {
if (DeviceController.isRecording()) {
((MainActivity) getActivity()).getFragmentMainCenter().stopRecording();
updateButtonsWhenRecordingStatusChanged(true);
blinkWhenRecordingStatusChanged(false);
getActivity().setRequestedOrientation(10);
}
if (this.btnPalette_ != null) {
this.btnPalette_.setVisibility(4);
}
if (this.btnCapture_ != null) {
if (this.modeSelection_ == 0) {
this.btnCapture_.setImageResource(R.drawable.button_capture_photo_select);
} else {
this.btnCapture_.setImageResource(R.mipmap.recording_finished);
}
this.btnCapture_.setVisibility(4);
}
if (this.viewSelectPointer_ != null) {
this.viewSelectPointer_.setVisibility(8);
}
if (this.layoutSelection_ != null) {
this.layoutSelection_.setVisibility(8);
}
}
@Override // cn.com.magnity.magnitycx.FragmentMainCenter.DelegateCapture
public Bitmap onCapture() {
return null;
}
@Override // cn.com.magnity.magnitycx.FragmentMainCenter.DelegateCapture
public void onCaptureFinished(String pathName) {
this.viewBrowse_.setScaleType(ImageView.ScaleType.CENTER_CROP);
this.viewBrowse_.setImageBitmap(BitmapUtilities.getBitmapThumbnail(pathName, getResources().getDimensionPixelSize(R.dimen.mainBottomButtonSize), getResources().getDimensionPixelSize(R.dimen.mainBottomButtonSize)));
}
@Override // cn.com.magnity.magnitycx.FragmentMainCenter.DelegateCapture
public boolean onStartRecording(String pathName) {
return false;
}
@Override // cn.com.magnity.magnitycx.FragmentMainCenter.DelegateCapture
public void onStopRecording() {
}
@Override // cn.com.magnity.magnitycx.MainActivity.DelegateFling
public void afterFling(int index) {
setNewSelection(index);
}
void setNewSelection(int index) {
String sProperty;
if (this.modeSelection_ != index && !DeviceController.isRecording()) {
float posPhoto = 0.0f;
float posRecord = 0.0f;
int orientation = getActivity().getResources().getConfiguration().orientation;
if (orientation == 1) {
sProperty = "x";
if (index == 0) {
posPhoto = (this.screenWidth_ - this.tvPhoto_.getWidth()) / 2;
posRecord = posPhoto + 0.0f + this.tvPhoto_.getWidth();
} else if (index == 1) {
posRecord = (this.screenWidth_ - this.tvRecord_.getWidth()) / 2;
posPhoto = (posRecord - 0.0f) - this.tvPhoto_.getWidth();
}
} else {
sProperty = Config.EXCEPTION_TYPE;
if (index == 0) {
posPhoto = (this.screenHeight_ - this.tvPhoto_.getHeight()) / 2;
posRecord = (posPhoto - 0.0f) - this.tvRecord_.getHeight();
} else if (index == 1) {
posRecord = (this.screenHeight_ - this.tvRecord_.getHeight()) / 2;
posPhoto = posRecord + 0.0f + this.tvRecord_.getHeight();
}
}
ObjectAnimator oaPhoto = ObjectAnimator.ofFloat(this.tvPhoto_, sProperty, posPhoto);
oaPhoto.setDuration(300L);
ObjectAnimator oaRecord = ObjectAnimator.ofFloat(this.tvRecord_, sProperty, posRecord);
oaRecord.setDuration(300L);
switch (index) {
case 0:
oaPhoto.setStartDelay(30L);
this.tvPhoto_.setTextColor(getResources().getColor(R.color.selectedModeText));
this.tvRecord_.setTextColor(getResources().getColor(R.color.textColor));
this.btnCapture_.setImageResource(R.drawable.button_capture_photo_select);
break;
case 1:
oaRecord.setStartDelay(30L);
this.tvPhoto_.setTextColor(getResources().getColor(R.color.textColor));
this.tvRecord_.setTextColor(getResources().getColor(R.color.selectedModeText));
this.btnCapture_.setImageResource(R.mipmap.recording_finished);
break;
}
oaPhoto.start();
oaRecord.start();
this.modeSelection_ = index;
SharedPreferencesManager.putIntWithCommit("modeSelection", this.modeSelection_);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void updateButtonsWhenRecordingStatusChanged(boolean visible) {
FragmentMainTop fragmentMainTop = ((MainActivity) getActivity()).getFragmentMainTop();
if (visible) {
this.viewSelectPointer_.setVisibility(0);
this.viewBrowse_.setVisibility(0);
this.layoutSelection_.setVisibility(0);
fragmentMainTop.showButtonsWhenRecordingFinish();
return;
}
this.viewSelectPointer_.setVisibility(8);
this.viewBrowse_.setVisibility(4);
this.layoutSelection_.setVisibility(8);
fragmentMainTop.hideButtonsWhenRecordingStart();
}
/* JADX INFO: Access modifiers changed from: private */
public void blinkWhenRecordingStatusChanged(boolean blink) {
if (blink) {
this.viewRecordingPoint_.setVisibility(0);
this.handler_ = new Handler() { // from class: cn.com.magnity.magnitycx.FragmentMainBottom.1
@Override // android.os.Handler
public void handleMessage(Message msg) {
if (DeviceController.isRecording()) {
if (FragmentMainBottom.this.viewRecordingPoint_.getVisibility() == 0) {
FragmentMainBottom.this.viewRecordingPoint_.setVisibility(4);
} else {
FragmentMainBottom.this.viewRecordingPoint_.setVisibility(0);
}
}
}
};
this.timerHelper_ = new TimerHelper() { // from class: cn.com.magnity.magnitycx.FragmentMainBottom.2
@Override // cn.com.magnity.magnitycx.sdk.TimerHelper
public void run() {
FragmentMainBottom.this.handler_.sendEmptyMessage(0);
}
};
this.timerHelper_.start(0L, 500L);
return;
}
this.timerHelper_.stop();
this.viewRecordingPoint_.setVisibility(4);
}
private class MagClickListener implements View.OnClickListener {
private MagClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
switch (v.getId()) {
case R.id.id_photo /* 2131624122 */:
FragmentMainBottom.this.setNewSelection(0);
break;
case R.id.id_record /* 2131624123 */:
FragmentMainBottom.this.setNewSelection(1);
break;
case R.id.id_browse /* 2131624124 */:
ArrayList<String> fileNames = new ArrayList<>();
GlobalFunc globalFunc = MagApplication.globalFunc;
GlobalFunc.updateFileList(fileNames);
if (!fileNames.isEmpty()) {
Intent intent = new Intent(FragmentMainBottom.this.getActivity(), (Class<?>) MediaSingleActivity.class);
intent.putExtra(MediaSingleActivity.MEDIAWINDOWFLAG, 0);
intent.putExtra(MediaSingleActivity.MEDIAINDEX, 0);
intent.putStringArrayListExtra(MediaSingleActivity.MEDIANAMELIST, fileNames);
FragmentMainBottom.this.startActivity(intent);
break;
}
break;
case R.id.id_capture /* 2131624126 */:
FragmentMainCenter fragmentMainCenter = ((MainActivity) FragmentMainBottom.this.getActivity()).getFragmentMainCenter();
if (FragmentMainBottom.this.modeSelection_ == 0) {
StatService.onEvent(FragmentMainBottom.this.getContext(), MagParameter.EVENT_PHOTO_ID, MagParameter.EVENT_PHOTO);
fragmentMainCenter.capturePhoto();
break;
} else if (DeviceController.isRecording()) {
fragmentMainCenter.stopRecording();
FragmentMainBottom.this.updateButtonsWhenRecordingStatusChanged(true);
FragmentMainBottom.this.blinkWhenRecordingStatusChanged(false);
FragmentMainBottom.this.btnCapture_.setImageResource(R.mipmap.recording_finished);
FragmentMainBottom.this.getActivity().setRequestedOrientation(10);
break;
} else if (fragmentMainCenter.startRecording()) {
StatService.onEvent(FragmentMainBottom.this.getContext(), MagParameter.EVENT_VIDEO_ID, MagParameter.EVENT_VIDEO);
FragmentMainBottom.this.updateButtonsWhenRecordingStatusChanged(false);
FragmentMainBottom.this.blinkWhenRecordingStatusChanged(true);
FragmentMainBottom.this.btnCapture_.setImageResource(R.mipmap.recording_normal);
FragmentMainBottom.this.getActivity().setRequestedOrientation(14);
break;
}
break;
case R.id.id_palette /* 2131624128 */:
DialogFragmentPalette fragmentPalette = new DialogFragmentPalette();
StatService.onEvent(FragmentMainBottom.this.getContext(), MagParameter.EVENT_COLOR_PALETTE_ID, MagParameter.EVENT_COLOR_PALETTE);
fragmentPalette.show(FragmentMainBottom.this.getFragmentManager(), "FragmentPalette");
break;
}
}
}
}
@@ -0,0 +1,345 @@
package cn.com.magnity.magnitycx;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import cn.com.magnity.magnitycx.FragmentMainTop;
import cn.com.magnity.magnitycx.log.Logging;
import cn.com.magnity.magnitycx.sdk.DelegateDeviceConnected;
import cn.com.magnity.magnitycx.sdk.DeviceController;
import cn.com.magnity.magnitycx.sdk.GlobalFunc;
import cn.com.magnity.magnitycx.sdk.UsbCommunication;
import cn.com.magnity.magnitycx.sdk.UsbConnection;
import cn.com.magnity.magnitycx.sdk.VisibleCamera;
import com.baidu.mobstat.StatService;
import com.github.lzyzsd.circleprogress.DonutProgress;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/* loaded from: classes.dex */
public class FragmentMainCenter extends Fragment implements DelegateDeviceConnected, FragmentMainTop.DelegateDisplayModeChanged, UsbCommunication.IProgressCallback {
public static ImageViewerVisible imgViewerVisible_;
private Bitmap bmpCaptured_;
private ImageView imgViewAnim_;
private ImageViewer imgViewer_;
private LinearLayout layout_;
private DonutProgress progBarLoading_;
private String recordingFileName_ = "";
private TextView tvTipInfo_;
public interface DelegateCapture {
Bitmap onCapture();
void onCaptureFinished(String str);
boolean onStartRecording(String str);
void onStopRecording();
}
@Override // android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootViewer = inflater.inflate(R.layout.fragment_main_center, container, false);
this.imgViewAnim_ = (ImageView) rootViewer.findViewById(R.id.id_imgViewAnim);
this.imgViewer_ = (ImageViewer) rootViewer.findViewById(R.id.id_imgviewer);
this.progBarLoading_ = (DonutProgress) rootViewer.findViewById(R.id.id_loading);
this.tvTipInfo_ = (TextView) rootViewer.findViewById(R.id.id_text);
imgViewerVisible_ = (ImageViewerVisible) rootViewer.findViewById(R.id.id_imgViewerVisible);
this.layout_ = (LinearLayout) rootViewer.findViewById(R.id.id_layoutDevUnconn);
onDeviceDisconnected();
return rootViewer;
}
@Override // android.support.v4.app.Fragment
public void onDestroyView() {
super.onDestroyView();
}
@Override // android.support.v4.app.Fragment
public void onDestroy() {
super.onDestroy();
}
@Override // cn.com.magnity.magnitycx.sdk.DelegateDeviceConnected
public void onDeviceConnected(UsbCommunication comm) {
if (this.imgViewer_ != null) {
this.imgViewer_.setVisibility(0);
}
if (imgViewerVisible_ != null) {
boolean hasPermission = VisibleCamera.isCameraPermission();
if (MagApplication.magParameter.dispMode == 1) {
imgViewerVisible_.setVisibility(4);
} else if (hasPermission) {
imgViewerVisible_.setVisibility(0);
}
}
if (this.layout_ != null) {
this.layout_.setVisibility(4);
}
if (comm != null && this.imgViewer_ != null) {
this.imgViewer_.initData(MagApplication.magParameter.basePara1.fpaWidth, MagApplication.magParameter.basePara1.fpaHeight);
comm.setImageViewer(this.imgViewer_);
}
}
public void startLoading() {
this.layout_.setVisibility(4);
this.progBarLoading_.setVisibility(0);
this.progBarLoading_.setProgress(0.0f);
this.tvTipInfo_.setVisibility(0);
this.tvTipInfo_.setText("");
}
@Override // android.support.v4.app.Fragment
public void onResume() {
super.onResume();
StatService.onPageStart(getActivity(), "主页面中");
}
@Override // android.support.v4.app.Fragment
public void onPause() {
super.onPause();
StatService.onPageEnd(getActivity(), "主页面中");
}
public void stopLoading(boolean succ) {
this.progBarLoading_.setVisibility(8);
this.tvTipInfo_.setVisibility(8);
if (!succ) {
this.layout_.setVisibility(0);
}
}
@Override // cn.com.magnity.magnitycx.sdk.DelegateDeviceConnected
public void onDeviceDisconnected() {
getResources();
if (this.layout_ != null) {
this.layout_.setVisibility(0);
}
if (this.imgViewAnim_ != null) {
this.imgViewAnim_.clearAnimation();
this.imgViewAnim_.invalidate();
this.imgViewAnim_.setVisibility(4);
}
if (this.imgViewer_ != null) {
this.imgViewer_.setVisibility(4);
}
if (imgViewerVisible_ != null) {
imgViewerVisible_.setVisibility(4);
}
if (this.progBarLoading_ != null) {
this.progBarLoading_.setVisibility(8);
}
if (this.tvTipInfo_ != null) {
this.tvTipInfo_.setVisibility(8);
}
}
@Override // cn.com.magnity.magnitycx.sdk.UsbCommunication.IProgressCallback
public void progressCancel(int id) {
getActivity().setRequestedOrientation(10);
switch (id) {
case 0:
stopLoading(false);
UsbConnection.getInstance().notifyObervers(0);
break;
}
Toast.makeText(getContext(), R.string.tipForFail, 1).show();
}
@Override // cn.com.magnity.magnitycx.sdk.UsbCommunication.IProgressCallback
public void progressFinished(int id) {
switch (id) {
case 0:
stopLoading(true);
UsbConnection.getInstance().notifyObervers(1);
getActivity().setRequestedOrientation(10);
break;
case 1:
stopLoading(true);
getActivity().setRequestedOrientation(10);
break;
}
}
@Override // cn.com.magnity.magnitycx.sdk.UsbCommunication.IProgressCallback
public void progressChanged(int id, int progress) {
switch (id) {
case 0:
case 1:
this.progBarLoading_.setProgress(progress);
break;
}
}
@Override // cn.com.magnity.magnitycx.sdk.UsbCommunication.IProgressCallback
public void progressStart(int id) {
getActivity().setRequestedOrientation(14);
switch (id) {
case 0:
startLoading();
this.tvTipInfo_.setText(R.string.tipForNewMobile);
break;
case 1:
startLoading();
this.tvTipInfo_.setText(R.string.tipForDeviceInit);
break;
}
}
@Override // cn.com.magnity.magnitycx.FragmentMainTop.DelegateDisplayModeChanged
public boolean onDisplayModeChanged(int oldMode, int newMode) {
boolean hasPermission = VisibleCamera.isCameraPermission();
if (newMode == 0 && hasPermission) {
imgViewerVisible_.setVisibility(0);
} else {
imgViewerVisible_.setVisibility(8);
if (!hasPermission) {
return false;
}
}
return true;
}
public ImageViewer getImageViewer() {
return this.imgViewer_;
}
public boolean startRecording() {
this.imgViewAnim_.clearAnimation();
this.imgViewAnim_.invalidate();
this.imgViewAnim_.setVisibility(4);
if (!(this.imgViewer_ instanceof DelegateCapture) || this.imgViewer_.getVisibility() != 0) {
return false;
}
String type = "";
switch (MagApplication.magParameter.basePara1.devType) {
case 0:
type = getResources().getString(R.string.c1);
break;
case 1:
type = getResources().getString(R.string.c3);
break;
case 2:
type = getResources().getString(R.string.c3p);
break;
case 3:
type = getResources().getString(R.string.core160);
break;
case 5:
type = getResources().getString(R.string.c1pro);
break;
case 6:
type = getResources().getString(R.string.c1prolite);
break;
}
this.recordingFileName_ = MagApplication.magParameter.mediaDir + File.separator + type + new SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.US).format(new Date()) + ".mp4";
if (!this.imgViewer_.onStartRecording(this.recordingFileName_)) {
Logging.warn("Fail to start recording");
return false;
}
return true;
}
public void stopRecording() {
this.imgViewer_.onStopRecording();
FragmentMainBottom fragmentMainBottom = ((MainActivity) getActivity()).getFragmentMainBottom();
if (fragmentMainBottom instanceof DelegateCapture) {
fragmentMainBottom.onCaptureFinished(this.recordingFileName_);
GlobalFunc.notifyMediaSync(getContext(), new File(this.recordingFileName_));
}
this.recordingFileName_ = "";
}
public boolean capturePhoto() {
if (MagApplication.magParameter.mediaDir.isEmpty()) {
Logging.error("Media not mounted");
return false;
}
String type = "";
switch (MagApplication.magParameter.basePara1.devType) {
case 0:
type = getResources().getString(R.string.c1);
break;
case 1:
type = getResources().getString(R.string.c3);
break;
case 2:
type = getResources().getString(R.string.c3p);
break;
case 3:
type = getResources().getString(R.string.core160);
break;
case 5:
type = getResources().getString(R.string.c1pro);
break;
case 6:
type = getResources().getString(R.string.c1prolite);
break;
}
String pathName = MagApplication.magParameter.mediaDir + File.separator + type + new SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.US).format(new Date()) + ".jpg";
if ((this.imgViewer_ instanceof DelegateCapture) && this.imgViewer_.getVisibility() == 0) {
this.bmpCaptured_ = this.imgViewer_.onCapture();
if (MagApplication.magParameter.basePara1.devType == 2) {
DeviceController.Lock();
DeviceController.saveDDT(pathName.replace(".jpg", ".ddt"));
DeviceController.Unlock();
}
}
if (this.bmpCaptured_ == null) {
Logging.error("Capture photo fail because of ir bmp is null");
return false;
}
try {
FileOutputStream out = new FileOutputStream(pathName);
this.bmpCaptured_.compress(Bitmap.CompressFormat.JPEG, 100, out);
out.close();
GlobalFunc.notifyMediaSync(getContext(), new File(pathName));
FragmentMainBottom fragmentMainBottom = ((MainActivity) getActivity()).getFragmentMainBottom();
if (fragmentMainBottom instanceof DelegateCapture) {
fragmentMainBottom.onCaptureFinished(pathName);
}
Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.photo_capture);
anim.setFillAfter(true);
anim.setAnimationListener(new Animation.AnimationListener() { // from class: cn.com.magnity.magnitycx.FragmentMainCenter.1
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(Animation animation) {
FragmentMainCenter.this.imgViewAnim_.clearAnimation();
FragmentMainCenter.this.imgViewAnim_.invalidate();
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
});
this.imgViewAnim_.startAnimation(anim);
return true;
} catch (Exception e) {
Logging.error("Capture photo fail (" + e.getMessage() + ")");
return false;
}
}
}
@@ -0,0 +1,383 @@
package cn.com.magnity.magnitycx;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.PopupMenu;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import cn.com.magnity.magnitycx.log.Logging;
import cn.com.magnity.magnitycx.sdk.DelegateDeviceConnected;
import cn.com.magnity.magnitycx.sdk.DeviceController;
import cn.com.magnity.magnitycx.sdk.MagParameter;
import cn.com.magnity.magnitycx.sdk.SharedPreferencesManager;
import cn.com.magnity.magnitycx.sdk.UsbCommunication;
import com.baidu.mobstat.StatService;
import java.lang.reflect.Method;
/* loaded from: classes.dex */
public class FragmentMainTop extends Fragment implements DelegateDeviceConnected, PopupMenu.OnMenuItemClickListener, ActivityCompat.OnRequestPermissionsResultCallback {
private ImageButton btnCross_;
private ImageButton btnLaserOn_;
private ImageButton btnMode_;
private ImageButton btnMore_;
private ImageButton btnTraceMaxMin_;
private ImageButton btnZoom_;
private MainTopClickListener clickListener_;
private PopupWindow popupWindowMore_;
private UsbCommunication usbComm_;
public interface DelegateDisplayModeChanged {
boolean onDisplayModeChanged(int i, int i2);
}
@Override // android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.clickListener_ = new MainTopClickListener();
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main_top, container, false);
this.btnMode_ = (ImageButton) rootView.findViewById(R.id.id_mode);
this.btnCross_ = (ImageButton) rootView.findViewById(R.id.id_cross);
this.btnLaserOn_ = (ImageButton) rootView.findViewById(R.id.id_laser);
this.btnMore_ = (ImageButton) rootView.findViewById(R.id.id_more);
this.btnTraceMaxMin_ = (ImageButton) rootView.findViewById(R.id.id_trace_max_min);
this.btnZoom_ = (ImageButton) rootView.findViewById(R.id.id_zoom);
this.btnMode_.setOnClickListener(this.clickListener_);
this.btnCross_.setOnClickListener(this.clickListener_);
this.btnLaserOn_.setOnClickListener(this.clickListener_);
this.btnMore_.setOnClickListener(this.clickListener_);
this.btnTraceMaxMin_.setOnClickListener(this.clickListener_);
this.btnZoom_.setOnClickListener(this.clickListener_);
if (MagApplication.magParameter.dispMode == 1) {
this.btnMode_.setImageResource(R.mipmap.disp_mode_ironly);
} else {
this.btnMode_.setImageResource(R.mipmap.disp_mode_pip);
}
if (MagApplication.magParameter.isShowCross) {
this.btnCross_.setImageResource(R.mipmap.center_cross_on);
} else {
this.btnCross_.setImageResource(R.mipmap.center_cross_off);
}
if (MagApplication.magParameter.isTraceMaxMin) {
this.btnTraceMaxMin_.setImageResource(R.mipmap.trace_max_min_on);
} else {
this.btnTraceMaxMin_.setImageResource(R.mipmap.trace_max_min_off);
}
int ratio = MagApplication.magParameter.imageEX;
if (ratio == 0) {
this.btnZoom_.setImageResource(R.mipmap.zoom_1x);
} else if (ratio == 1) {
this.btnZoom_.setImageResource(R.mipmap.zoom_2x);
} else if (ratio == 2) {
this.btnZoom_.setImageResource(R.mipmap.zoom_4x);
}
initPopupWindowMore();
onDeviceDisconnected();
return rootView;
}
private void initPopupWindowMore() {
View moreView = LayoutInflater.from(getActivity()).inflate(R.layout.popup_window_more, (ViewGroup) null);
View viewItem = moreView.findViewById(R.id.id_menu_item_setting);
viewItem.setOnClickListener(this.clickListener_);
ImageView viewLogo = (ImageView) viewItem.findViewById(R.id.id_item_menu_logo);
viewLogo.setImageResource(R.mipmap.settings);
TextView txtView = (TextView) viewItem.findViewById(R.id.id_item_menu_text);
txtView.setText(R.string.labelSetting);
View viewItem2 = moreView.findViewById(R.id.id_menu_item_help);
viewItem2.setOnClickListener(this.clickListener_);
ImageView viewLogo2 = (ImageView) viewItem2.findViewById(R.id.id_item_menu_logo);
viewLogo2.setImageResource(R.mipmap.help);
TextView txtView2 = (TextView) viewItem2.findViewById(R.id.id_item_menu_text);
txtView2.setText(R.string.labelHelp);
this.popupWindowMore_ = new PopupWindow(moreView, -2, -2);
this.popupWindowMore_.setOutsideTouchable(true);
this.popupWindowMore_.setFocusable(true);
this.popupWindowMore_.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.liveBackground)));
}
@Override // cn.com.magnity.magnitycx.sdk.DelegateDeviceConnected
public void onDeviceConnected(UsbCommunication comm) {
this.usbComm_ = comm;
if (this.btnMode_ != null) {
this.btnMode_.setVisibility(0);
}
if (this.btnZoom_ != null) {
this.btnZoom_.setVisibility(0);
}
switch (MagApplication.magParameter.basePara1.devType) {
case 0:
case 3:
case 5:
case 6:
if (this.btnCross_ != null) {
this.btnCross_.setVisibility(0);
}
if (this.btnTraceMaxMin_ != null) {
this.btnTraceMaxMin_.setVisibility(0);
}
if (this.btnZoom_ != null) {
this.btnZoom_.setVisibility(8);
break;
}
break;
case 1:
if (this.btnCross_ != null) {
this.btnCross_.setVisibility(8);
}
if (this.btnTraceMaxMin_ != null) {
this.btnTraceMaxMin_.setVisibility(8);
}
if (this.btnLaserOn_ != null) {
this.btnLaserOn_.setImageResource(R.mipmap.laser_off);
this.btnLaserOn_.setVisibility(0);
}
if (this.btnZoom_ != null) {
this.btnZoom_.setVisibility(0);
break;
}
break;
case 2:
if (this.btnCross_ != null) {
this.btnCross_.setVisibility(0);
}
if (this.btnTraceMaxMin_ != null) {
this.btnTraceMaxMin_.setVisibility(8);
}
if (this.btnLaserOn_ != null) {
this.btnLaserOn_.setVisibility(0);
}
if (this.btnZoom_ != null) {
this.btnZoom_.setVisibility(0);
break;
}
break;
}
}
@Override // cn.com.magnity.magnitycx.sdk.DelegateDeviceConnected
public void onDeviceDisconnected() {
this.usbComm_ = null;
if (this.btnMode_ != null) {
this.btnMode_.setVisibility(4);
}
if (this.btnCross_ != null) {
this.btnCross_.setVisibility(4);
}
if (this.btnTraceMaxMin_ != null) {
this.btnTraceMaxMin_.setVisibility(8);
}
if (this.btnLaserOn_ != null) {
this.btnLaserOn_.setVisibility(8);
}
if (this.btnZoom_ != null) {
this.btnZoom_.setVisibility(8);
}
}
public void hideButtonsWhenRecordingStart() {
this.btnMode_.setVisibility(4);
this.btnMore_.setVisibility(4);
}
public void showButtonsWhenRecordingFinish() {
this.btnMode_.setVisibility(0);
this.btnMore_.setVisibility(0);
}
@Override // android.widget.PopupMenu.OnMenuItemClickListener
public boolean onMenuItemClick(MenuItem item) {
return false;
}
private void setIconsVisible(Menu menu, boolean flag) {
if (menu != null) {
try {
Method method = menu.getClass().getDeclaredMethod("setOptionalIconsVisible", Boolean.TYPE);
if (method != null) {
method.setAccessible(true);
method.invoke(menu, Boolean.valueOf(flag));
}
} catch (Exception e) {
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public void exchangeLogo(final ImageButton btn, final int resIdOn, final int resIdOff, final boolean on) {
Animation anim;
if (getResources().getConfiguration().orientation == 2) {
anim = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_right_out);
} else {
anim = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_bottom_out);
}
anim.setDuration(200L);
anim.setAnimationListener(new Animation.AnimationListener() { // from class: cn.com.magnity.magnitycx.FragmentMainTop.1
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(Animation animation) {
Animation anim2;
if (on) {
btn.setImageResource(resIdOn);
} else {
btn.setImageResource(resIdOff);
}
if (FragmentMainTop.this.getResources().getConfiguration().orientation == 2) {
anim2 = AnimationUtils.loadAnimation(FragmentMainTop.this.getActivity(), R.anim.slide_left_in);
} else {
anim2 = AnimationUtils.loadAnimation(FragmentMainTop.this.getActivity(), R.anim.slide_top_in);
}
anim2.setDuration(200L);
btn.startAnimation(anim2);
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
});
btn.startAnimation(anim);
}
public void openLaser() {
if (!this.usbComm_.setLaserState(1)) {
Logging.error("Fail to set laser off");
} else {
exchangeLogo(this.btnLaserOn_, R.mipmap.laser_on, R.mipmap.laser_off, true);
MagApplication.magParameter.isLaserOn = true;
}
}
public void closeLaser() {
if (!this.usbComm_.setLaserState(0)) {
Logging.error("Fail to set laser off");
} else {
exchangeLogo(this.btnLaserOn_, R.mipmap.laser_on, R.mipmap.laser_off, false);
MagApplication.magParameter.isLaserOn = false;
}
}
private class MainTopClickListener implements View.OnClickListener {
private MainTopClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
int dispMode;
switch (v.getId()) {
case R.id.id_mode /* 2131624136 */:
int dispMode2 = MagApplication.magParameter.dispMode;
if (dispMode2 == 0) {
dispMode = 1;
StatService.onEvent(FragmentMainTop.this.getContext(), MagParameter.EVENT_DISABLE_VISWND_ID, MagParameter.EVENT_DISABLE_VISWND);
} else {
dispMode = 0;
StatService.onEvent(FragmentMainTop.this.getContext(), MagParameter.EVENT_ENABLE_VISWND_ID, MagParameter.EVENT_ENABLE_VISWND);
}
FragmentMainTop.this.exchangeLogo(FragmentMainTop.this.btnMode_, R.mipmap.disp_mode_pip, R.mipmap.disp_mode_ironly, dispMode == 0);
FragmentMainCenter fragment = ((MainActivity) FragmentMainTop.this.getActivity()).getFragmentMainCenter();
if (fragment instanceof DelegateDisplayModeChanged) {
boolean ret = fragment.onDisplayModeChanged(0, dispMode);
if (!ret) {
FragmentMainTop.this.exchangeLogo(FragmentMainTop.this.btnMode_, R.mipmap.disp_mode_pip, R.mipmap.disp_mode_ironly, dispMode != 0);
break;
}
}
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_DISPMODE, dispMode);
MagApplication.magParameter.dispMode = dispMode;
int num = MagApplication.magParameter.onceTipVisibleMove;
if (dispMode == 0) {
int num2 = num - 1;
if (num != 0) {
MagApplication.magParameter.onceTipVisibleMove = num2;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_ONCETIPVISIBLEMOVE, num2);
Toast.makeText(FragmentMainTop.this.getContext(), R.string.onceTipVisibleMove, 1).show();
break;
}
}
break;
case R.id.id_cross /* 2131624137 */:
MagApplication.magParameter.isShowCross = !MagApplication.magParameter.isShowCross;
if (MagApplication.magParameter.isShowCross) {
StatService.onEvent(FragmentMainTop.this.getContext(), MagParameter.EVENT_ENABLE_CENTER_TEMP_ID, MagParameter.EVENT_ENABLE_CENTER_TEMP);
} else {
StatService.onEvent(FragmentMainTop.this.getContext(), MagParameter.EVENT_DISABLE_CENTER_TEMP_ID, MagParameter.EVENT_DISABLE_CENTER_TEMP);
}
SharedPreferencesManager.putBooleanWithCommit(MagParameter.KEY_SHOWCROSS, MagApplication.magParameter.isShowCross);
FragmentMainTop.this.exchangeLogo(FragmentMainTop.this.btnCross_, R.mipmap.center_cross_on, R.mipmap.center_cross_off, MagApplication.magParameter.isShowCross);
break;
case R.id.id_zoom /* 2131624138 */:
int ratio = MagApplication.magParameter.imageEX;
if (ratio == 0) {
MagApplication.magParameter.imageEX = 1;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_EXMODE, MagApplication.magParameter.imageEX);
FragmentMainTop.this.exchangeLogo(FragmentMainTop.this.btnZoom_, R.mipmap.zoom_2x, R.mipmap.zoom_1x, true);
} else if (ratio == 1) {
MagApplication.magParameter.imageEX = 2;
FragmentMainTop.this.exchangeLogo(FragmentMainTop.this.btnZoom_, R.mipmap.zoom_4x, R.mipmap.zoom_2x, true);
} else if (ratio == 2) {
MagApplication.magParameter.imageEX = 0;
FragmentMainTop.this.exchangeLogo(FragmentMainTop.this.btnZoom_, R.mipmap.zoom_1x, R.mipmap.zoom_4x, true);
}
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_EXMODE, MagApplication.magParameter.imageEX);
DeviceController.setEX(MagApplication.magParameter.imageEX, MagApplication.magParameter.basePara1.fpaWidth / 2, MagApplication.magParameter.basePara1.fpaHeight / 2);
break;
case R.id.id_trace_max_min /* 2131624139 */:
MagApplication.magParameter.isTraceMaxMin = !MagApplication.magParameter.isTraceMaxMin;
SharedPreferencesManager.putBooleanWithCommit(MagParameter.KEY_TRACEMAXMIN, MagApplication.magParameter.isTraceMaxMin);
FragmentMainTop.this.exchangeLogo(FragmentMainTop.this.btnTraceMaxMin_, R.mipmap.trace_max_min_on, R.mipmap.trace_max_min_off, MagApplication.magParameter.isTraceMaxMin);
if ((MagApplication.magParameter.basePara1.devType == 0 || MagApplication.magParameter.basePara1.devType == 5 || MagApplication.magParameter.basePara1.devType == 6 || MagApplication.magParameter.basePara1.devType == 3) && MagApplication.magParameter.maxMinTrace == -1 && MagApplication.magParameter.isTraceMaxMin) {
MagApplication.magParameter.maxMinTrace = 0;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_MAXMINTRACE, MagApplication.magParameter.maxMinTrace);
break;
}
break;
case R.id.id_laser /* 2131624140 */:
if (MagApplication.magParameter.isLaserOn) {
StatService.onEvent(FragmentMainTop.this.getContext(), MagParameter.EVENT_DISABLE_LASER_ID, MagParameter.EVENT_DISABLE_LASER);
FragmentMainTop.this.closeLaser();
break;
} else {
QueryDialogFragment dlgMediaDel = QueryDialogFragment.newInstance(R.layout.dialog_fragment_query_open_laser);
StatService.onEvent(FragmentMainTop.this.getContext(), MagParameter.EVENT_ENABLE_LASER_ID, MagParameter.EVENT_ENABLE_LASER);
dlgMediaDel.show(FragmentMainTop.this.getActivity().getSupportFragmentManager(), "openLaser");
break;
}
case R.id.id_more /* 2131624141 */:
Intent intent = new Intent(FragmentMainTop.this.getActivity(), (Class<?>) SettingActivity.class);
FragmentMainTop.this.startActivity(intent);
break;
case R.id.id_menu_item_setting /* 2131624220 */:
Intent intent2 = new Intent(FragmentMainTop.this.getActivity(), (Class<?>) SettingActivity.class);
FragmentMainTop.this.startActivity(intent2);
FragmentMainTop.this.popupWindowMore_.dismiss();
break;
case R.id.id_menu_item_help /* 2131624221 */:
Intent intent3 = new Intent(FragmentMainTop.this.getActivity(), (Class<?>) SupportActivity.class);
FragmentMainTop.this.startActivity(intent3);
FragmentMainTop.this.popupWindowMore_.dismiss();
break;
}
}
}
}
@@ -0,0 +1,411 @@
package cn.com.magnity.magnitycx;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.content.FileProvider;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.Toast;
import cn.com.magnity.magnitycx.MediaActivity;
import cn.com.magnity.magnitycx.QueryDialogFragment;
import cn.com.magnity.magnitycx.sdk.DelegateMediaStatusChanged;
import cn.com.magnity.magnitycx.sdk.GlobalFunc;
import cn.com.magnity.magnitycx.sdk.MagParameter;
import cn.com.magnity.magnitycx.sdk.SharedPreferencesManager;
import com.baidu.mobstat.StatService;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/* loaded from: classes.dex */
public class FragmentMedia extends Fragment implements MediaActivity.DelegateBackPressed, QueryDialogFragment.DelegateQueryResult, AbsListView.OnScrollListener {
private static final int MODE_NORMAL = 0;
private static final int MODE_SELECTION = 1;
private Button btnDelete_;
private Button btnSelectAll_;
private Button btnSocialShare_;
private ArrayList<String> fileNames_;
private int firstVisiblePos_;
private GridView gridView_;
private int index_;
private Map mapSelStatus_;
private MediaGridViewAdapter mediaGridViewAdapter_;
private MediaItemClickListener mediaItemClickListener_;
private MediaItemLongClickListener mediaItemLongClickListener_;
private MediaMenuClickListener mediaMenuClickListener_;
private ViewGroup menu_;
private int mode_ = 0;
private int visibleItemCount_;
@Override // android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
this.fileNames_ = new ArrayList<>();
this.mediaMenuClickListener_ = new MediaMenuClickListener();
this.mediaItemClickListener_ = new MediaItemClickListener();
this.mediaItemLongClickListener_ = new MediaItemLongClickListener();
this.mapSelStatus_ = new HashMap();
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_media, (ViewGroup) null);
initViews(rootView);
return rootView;
}
private void initViews(View rootView) {
this.menu_ = (ViewGroup) rootView.findViewById(R.id.id_media_menu);
if (this.mode_ == 0) {
this.menu_.setVisibility(8);
} else if (this.mode_ == 1) {
this.menu_.setVisibility(0);
}
this.btnSocialShare_ = (Button) rootView.findViewById(R.id.id_btn_social_share);
this.btnSocialShare_.setOnClickListener(this.mediaMenuClickListener_);
this.btnDelete_ = (Button) rootView.findViewById(R.id.id_btn_delete);
this.btnDelete_.setOnClickListener(this.mediaMenuClickListener_);
this.btnSelectAll_ = (Button) rootView.findViewById(R.id.id_btn_select_all);
this.btnSelectAll_.setOnClickListener(this.mediaMenuClickListener_);
this.gridView_ = (GridView) rootView.findViewById(R.id.id_photowall);
this.gridView_.setOnScrollListener(this);
this.gridView_.setOnItemClickListener(this.mediaItemClickListener_);
this.gridView_.setOnItemLongClickListener(this.mediaItemLongClickListener_);
setAdapter();
}
private void setAdapter() {
updateFileList();
this.mediaGridViewAdapter_ = new MediaGridViewAdapter(getActivity(), this.gridView_, this.fileNames_, this.mapSelStatus_);
this.mediaGridViewAdapter_.setMode(this.mode_);
this.gridView_.setAdapter((ListAdapter) this.mediaGridViewAdapter_);
}
private void updateFileList() {
GlobalFunc globalFunc = MagApplication.globalFunc;
GlobalFunc.updateFileList(this.fileNames_);
}
/* JADX INFO: Access modifiers changed from: private */
public void updateGridView() {
this.mediaGridViewAdapter_.notifyDataSetChanged();
this.gridView_.setSelection(this.index_);
this.gridView_.invalidateViews();
}
@Override // android.support.v4.app.Fragment
public void onResume() {
super.onResume();
updateFileList();
updateGridView();
StatService.onPageStart(getActivity(), "媒体");
if (this.mode_ == 0) {
getActivity().setTitle(String.format(getResources().getString(R.string.mediaTitle), Integer.valueOf(this.fileNames_.size())));
} else {
getActivity().setTitle(String.format(getResources().getString(R.string.mediaSelectedNum), Integer.valueOf(getSelectedItemCount())));
}
int num = MagApplication.magParameter.onceTipMediaLongClick;
int num2 = num - 1;
if (num != 0) {
MagApplication.magParameter.onceTipMediaLongClick = num2;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_ONCETIPMEDIALONGCLICK, num2);
Toast.makeText(getContext(), R.string.onceTipMediaLongClick, 1).show();
}
}
/* JADX INFO: Access modifiers changed from: private */
public int getSelectedItemCount() {
int num = 0;
for (Object value : this.mapSelStatus_.values()) {
if (((Boolean) value).booleanValue()) {
num++;
}
}
return num;
}
@Override // android.support.v4.app.Fragment
public void onPause() {
this.index_ = this.gridView_.getFirstVisiblePosition();
StatService.onPageEnd(getActivity(), "媒体");
super.onPause();
}
@Override // android.support.v4.app.Fragment
public void onDestroy() {
super.onDestroy();
this.mediaGridViewAdapter_.cancelAllTasks();
}
@Override // android.widget.AbsListView.OnScrollListener
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
@Override // android.widget.AbsListView.OnScrollListener
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
this.firstVisiblePos_ = firstVisibleItem;
this.visibleItemCount_ = visibleItemCount;
if (this.visibleItemCount_ > 0) {
this.mediaGridViewAdapter_.loadBitmap(this.firstVisiblePos_, this.visibleItemCount_);
}
}
@Override // cn.com.magnity.magnitycx.MediaActivity.DelegateBackPressed
public boolean onActivityBackPressed() {
if (this.mode_ == 0) {
return true;
}
this.mode_ = 0;
unselectAllFiles();
this.mediaGridViewAdapter_.cancelAllTasks();
this.menu_.setVisibility(8);
if (!this.mapSelStatus_.isEmpty()) {
this.mapSelStatus_.clear();
}
if (getActivity() instanceof DelegateMediaStatusChanged) {
((DelegateMediaStatusChanged) getActivity()).onModeChanged(1, 0, this.fileNames_.size());
}
this.mediaGridViewAdapter_.setMode(0);
return false;
}
@Override // android.support.v4.app.Fragment
public void onActivityResult(int requestCode, int resultCode, Intent data) {
getActivity().setTitle(Integer.toString(this.fileNames_.size()) + getResources().getString(R.string.mediaTitle));
updateGridView();
}
@Override // cn.com.magnity.magnitycx.QueryDialogFragment.DelegateQueryResult
public void onQueryResult(int result) {
if (result == 1) {
deleteSelectedFiles();
updateButtons();
}
}
private void deleteSelectedFiles() {
Iterator iter = this.mapSelStatus_.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
boolean val = ((Boolean) entry.getValue()).booleanValue();
if (val) {
String pathName = MagApplication.magParameter.mediaDir + File.separator + ((String) entry.getKey());
File file = new File(pathName);
if (file != null && file.isFile()) {
if (file.delete()) {
iter.remove();
}
File file2 = new File(pathName.replace(".jpg", ".ddt"));
if (file2 != null && file2.isFile()) {
file2.delete();
}
}
}
}
updateFileList();
updateGridView();
if (this.fileNames_.isEmpty()) {
onActivityBackPressed();
} else if (getActivity() instanceof DelegateMediaStatusChanged) {
((DelegateMediaStatusChanged) getActivity()).onSelChanged(0, this.fileNames_.size());
}
}
/* JADX INFO: Access modifiers changed from: private */
public void socialShare() {
Intent intent;
boolean hasVideo = false;
ArrayList<Uri> lst = new ArrayList<>();
for (Map.Entry entry : this.mapSelStatus_.entrySet()) {
boolean val = ((Boolean) entry.getValue()).booleanValue();
if (val) {
String pathName = MagApplication.magParameter.mediaDir + File.separator + ((String) entry.getKey());
File f = new File(pathName);
if (f != null && f.isFile()) {
GlobalFunc globalFunc = MagApplication.globalFunc;
int type = GlobalFunc.guessMediaTypeBySuffix(pathName);
if (type == 0) {
lst.add(FileProvider.getUriForFile(getContext(), "cn.com.magnity.magnitycx.fileprovider", f));
} else if (type == 1) {
lst.add(FileProvider.getUriForFile(getContext(), "cn.com.magnity.magnitycx.fileprovider", f));
hasVideo = true;
}
}
}
}
if (lst.size() > 1) {
intent = new Intent("android.intent.action.SEND_MULTIPLE");
intent.putParcelableArrayListExtra("android.intent.extra.STREAM", lst);
} else if (lst.size() == 1) {
intent = new Intent("android.intent.action.SEND");
intent.putExtra("android.intent.extra.STREAM", lst.get(0));
} else {
return;
}
intent.setType(hasVideo ? "video/*" : "image/*");
intent.addFlags(1);
startActivity(Intent.createChooser(intent, getResources().getString(R.string.mediaSocialShare)));
}
/* JADX INFO: Access modifiers changed from: private */
public void selectAllFiles() {
Iterator<String> it = this.fileNames_.iterator();
while (it.hasNext()) {
String name = it.next();
this.mapSelStatus_.put(name, true);
}
if (getActivity() instanceof DelegateMediaStatusChanged) {
int num = this.fileNames_.size();
((DelegateMediaStatusChanged) getActivity()).onSelChanged(num, num);
}
updateGridView();
}
/* JADX INFO: Access modifiers changed from: private */
public void unselectAllFiles() {
Iterator<String> it = this.fileNames_.iterator();
while (it.hasNext()) {
String name = it.next();
this.mapSelStatus_.put(name, false);
}
if (getActivity() instanceof DelegateMediaStatusChanged) {
((DelegateMediaStatusChanged) getActivity()).onSelChanged(0, this.fileNames_.size());
}
updateGridView();
}
/* JADX INFO: Access modifiers changed from: private */
public boolean isAllItemSelected() {
return this.fileNames_.size() == this.mapSelStatus_.size() && !this.mapSelStatus_.containsValue(false);
}
private boolean isNoItemSelected() {
return !this.mapSelStatus_.containsValue(true);
}
/* JADX INFO: Access modifiers changed from: private */
public void updateButtons() {
if (isNoItemSelected()) {
this.btnSocialShare_.setEnabled(false);
this.btnDelete_.setEnabled(false);
this.btnSelectAll_.setText(R.string.mediaSelectAll);
Drawable drawable = getResources().getDrawable(R.drawable.button_unselect_all_select);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
this.btnSelectAll_.setCompoundDrawables(null, drawable, null, null);
return;
}
this.btnSocialShare_.setEnabled(true);
this.btnDelete_.setEnabled(true);
if (isAllItemSelected()) {
this.btnSelectAll_.setText(R.string.mediaUnselectAll);
Drawable drawable2 = getResources().getDrawable(R.drawable.button_select_all_select);
drawable2.setBounds(0, 0, drawable2.getMinimumWidth(), drawable2.getMinimumHeight());
this.btnSelectAll_.setCompoundDrawables(null, drawable2, null, null);
return;
}
this.btnSelectAll_.setText(R.string.mediaSelectAll);
Drawable drawable3 = getResources().getDrawable(R.drawable.button_unselect_all_select);
drawable3.setBounds(0, 0, drawable3.getMinimumWidth(), drawable3.getMinimumHeight());
this.btnSelectAll_.setCompoundDrawables(null, drawable3, null, null);
}
private class MediaMenuClickListener implements View.OnClickListener {
private MediaMenuClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
switch (v.getId()) {
case R.id.id_btn_social_share /* 2131624072 */:
FragmentMedia.this.socialShare();
break;
case R.id.id_btn_delete /* 2131624143 */:
QueryDialogFragment dlg = QueryDialogFragment.newInstance(R.layout.dialog_fragment_query_delete_media);
if (dlg != null) {
dlg.show(FragmentMedia.this.getActivity().getSupportFragmentManager(), "deleteMedia");
break;
}
break;
case R.id.id_btn_select_all /* 2131624144 */:
if (FragmentMedia.this.isAllItemSelected()) {
FragmentMedia.this.unselectAllFiles();
} else {
FragmentMedia.this.selectAllFiles();
}
FragmentMedia.this.updateButtons();
break;
}
}
}
private class MediaItemClickListener implements AdapterView.OnItemClickListener {
private MediaItemClickListener() {
}
@Override // android.widget.AdapterView.OnItemClickListener
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (FragmentMedia.this.mode_ != 0) {
String name = (String) FragmentMedia.this.fileNames_.get(position);
ImageView v = (ImageView) view.findViewById(R.id.id_photo_selected);
ImageView vimg = (ImageView) view.findViewById(R.id.id_wallphoto);
Object val = FragmentMedia.this.mapSelStatus_.get(name);
if (val == null || !((Boolean) val).booleanValue()) {
v.setImageResource(R.mipmap.media_selected);
vimg.setAlpha(0.6f);
FragmentMedia.this.mapSelStatus_.put(name, true);
} else {
v.setImageResource(R.mipmap.media_unselected);
vimg.setAlpha(1.0f);
FragmentMedia.this.mapSelStatus_.put(name, false);
}
if (FragmentMedia.this.getActivity() instanceof DelegateMediaStatusChanged) {
((DelegateMediaStatusChanged) FragmentMedia.this.getActivity()).onSelChanged(FragmentMedia.this.getSelectedItemCount(), FragmentMedia.this.fileNames_.size());
}
FragmentMedia.this.updateButtons();
return;
}
Intent intent = new Intent(FragmentMedia.this.getActivity(), (Class<?>) MediaSingleActivity.class);
intent.putExtra(MediaSingleActivity.MEDIAWINDOWFLAG, 1);
intent.putExtra(MediaSingleActivity.MEDIAINDEX, position);
intent.putStringArrayListExtra(MediaSingleActivity.MEDIANAMELIST, FragmentMedia.this.fileNames_);
FragmentMedia.this.startActivityForResult(intent, 0);
}
}
private class MediaItemLongClickListener implements AdapterView.OnItemLongClickListener {
private MediaItemLongClickListener() {
}
@Override // android.widget.AdapterView.OnItemLongClickListener
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
if (FragmentMedia.this.mode_ != 1) {
String name = (String) FragmentMedia.this.fileNames_.get(position);
FragmentMedia.this.mapSelStatus_.put(name, true);
FragmentMedia.this.updateButtons();
FragmentMedia.this.menu_.setVisibility(0);
FragmentMedia.this.mode_ = 1;
if (FragmentMedia.this.getActivity() instanceof DelegateMediaStatusChanged) {
((DelegateMediaStatusChanged) FragmentMedia.this.getActivity()).onModeChanged(0, 1, FragmentMedia.this.fileNames_.size());
}
FragmentMedia.this.mediaGridViewAdapter_.setMode(1);
FragmentMedia.this.updateGridView();
}
return true;
}
}
}
@@ -0,0 +1,559 @@
package cn.com.magnity.magnitycx;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import cn.com.magnity.magnitycx.sdk.DelegateOptionSelected;
import cn.com.magnity.magnitycx.sdk.DeviceController;
import cn.com.magnity.magnitycx.sdk.ExtPara;
import cn.com.magnity.magnitycx.sdk.MagParameter;
import cn.com.magnity.magnitycx.sdk.MsgBus;
import cn.com.magnity.magnitycx.sdk.SharedPreferencesManager;
import cn.com.magnity.magnitycx.sdk.UsbCommunication;
import cn.com.magnity.magnitycx.sdk.UsbConnection;
import com.baidu.mobstat.StatService;
/* loaded from: classes.dex */
public class FragmentSetting extends Fragment implements DelegateOptionSelected {
private View rootView_;
private SettingClickListner settingClickListner_;
@Override // android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.settingClickListner_ = new SettingClickListner();
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
this.rootView_ = inflater.inflate(R.layout.fragment_setting, (ViewGroup) null);
initUi(this.rootView_);
return this.rootView_;
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
private void initUi(View rootView) {
int id;
int id2;
int id3;
int id4;
int id5;
int devType = MagApplication.magParameter.basePara1.devType;
setText1_(rootView, R.id.id_setting_subheader_visible, R.string.settingsVisible);
switch (MagApplication.magParameter.visWndSize) {
case 0:
id = R.string.settingsVisibleSizeSmall;
break;
case 1:
id = R.string.settingsVisibleSizeMedium;
break;
case 2:
id = R.string.settingsVisibleSizeLarge;
break;
default:
id = R.string.settingsVisibleSizeSmall;
break;
}
setTextIcon(rootView, R.id.id_setting_item_visiblesize, R.string.settingsVisibleSize, id, R.mipmap.expand_more).setOnClickListener(this.settingClickListner_);
setText1_(rootView, R.id.id_setting_subheader_maxmintrace, R.string.settingsTempTrace);
switch (MagApplication.magParameter.maxMinTrace) {
case -1:
id2 = R.string.settingsNoneTrace;
break;
case 0:
id2 = R.string.settingsMaxTrace;
break;
case 1:
id2 = R.string.settingsMinTrace;
break;
case 2:
id2 = R.string.settingsMaxMinTrace;
break;
default:
id2 = R.string.settingsMaxTrace;
break;
}
setTextIcon(rootView, R.id.id_setting_item_maxmintrace, R.string.settingsTraceTarget, id2, R.mipmap.expand_more).setOnClickListener(this.settingClickListner_);
if (UsbConnection.getInstance().isConnected()) {
switch (devType) {
case 0:
case 5:
case 6:
StatService.onEvent(getContext(), MagParameter.EVENT_C1_ID, MagParameter.EVENT_C1);
rootView.findViewById(R.id.trace_divider3).setVisibility(8);
rootView.findViewById(R.id.trace_divider4).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_roitrace).setVisibility(8);
break;
case 1:
StatService.onEvent(getContext(), MagParameter.EVENT_C3_ID, MagParameter.EVENT_C3);
rootView.findViewById(R.id.trace_divider1).setVisibility(8);
rootView.findViewById(R.id.trace_divider2).setVisibility(8);
rootView.findViewById(R.id.trace_divider3).setVisibility(8);
rootView.findViewById(R.id.trace_divider4).setVisibility(8);
rootView.findViewById(R.id.id_setting_subheader_maxmintrace).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_maxmintrace).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_roitrace).setVisibility(8);
break;
case 2:
StatService.onEvent(getContext(), MagParameter.EVENT_C3_ID, MagParameter.EVENT_C3);
setTextIcon(rootView, R.id.id_setting_item_roitrace, R.string.settingsTraceROI, "", MagApplication.magParameter.isTraceRoi ? R.mipmap.media_selected : R.mipmap.media_unselected).setOnClickListener(this.settingClickListner_);
break;
case 3:
case 4:
default:
rootView.findViewById(R.id.trace_divider3).setVisibility(8);
rootView.findViewById(R.id.trace_divider4).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_roitrace).setVisibility(8);
break;
}
} else {
rootView.findViewById(R.id.trace_divider1).setVisibility(8);
rootView.findViewById(R.id.trace_divider2).setVisibility(8);
rootView.findViewById(R.id.trace_divider3).setVisibility(8);
rootView.findViewById(R.id.trace_divider4).setVisibility(8);
rootView.findViewById(R.id.id_setting_subheader_maxmintrace).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_maxmintrace).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_roitrace).setVisibility(8);
}
setText1_(rootView, R.id.id_setting_subheader_imageflip, R.string.settingsImageFlip);
int imageFlip = MagApplication.magParameter.imageFlip;
setTextIcon(rootView, R.id.id_setting_item_imageHorflip, R.string.settingsImageFlipHor, "", (imageFlip & 1) != 0 ? R.mipmap.media_selected : R.mipmap.media_unselected).setOnClickListener(this.settingClickListner_);
setTextIcon(rootView, R.id.id_setting_item_imageVerflip, R.string.settingsImageFlipVer, "", (imageFlip & 2) != 0 ? R.mipmap.media_selected : R.mipmap.media_unselected).setOnClickListener(this.settingClickListner_);
if ((UsbConnection.getInstance().isConnected() && devType == 2) || devType == 1) {
switch (MagApplication.magParameter.imageEX) {
case 1:
id5 = R.string.settingsEX2;
break;
case 2:
id5 = R.string.settingsEX4;
break;
case 3:
id5 = R.string.settingsEX8;
break;
case 4:
id5 = R.string.settingsEX16;
break;
default:
id5 = R.string.settingsEX1;
break;
}
setTextIcon(rootView, R.id.id_setting_item_imageEX, R.string.settingsImageEX, id5, R.mipmap.expand_more).setOnClickListener(this.settingClickListner_);
} else {
rootView.findViewById(R.id.id_imageEX_divider).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_imageEX).setVisibility(8);
}
if (UsbConnection.getInstance().isConnected() && devType == 2) {
setText1_(rootView, R.id.id_setting_subheader_emissivity, R.string.settingsTemperature);
switch (MagApplication.magParameter.emissivity) {
case 70:
id4 = R.string.settingsEM4;
break;
case 80:
id4 = R.string.settingsEM3;
break;
case 90:
id4 = R.string.settingsEM2;
break;
case 100:
id4 = R.string.settingsEM1;
break;
default:
id4 = R.string.settingsEM1;
break;
}
setTextIcon(rootView, R.id.id_setting_item_emissivity, R.string.settingsEmissivity, id4, R.mipmap.expand_more).setOnClickListener(this.settingClickListner_);
} else {
rootView.findViewById(R.id.id_emissivity_divider1).setVisibility(8);
rootView.findViewById(R.id.id_setting_subheader_emissivity).setVisibility(8);
rootView.findViewById(R.id.id_emissivity_divider2).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_emissivity).setVisibility(8);
rootView.findViewById(R.id.id_emissivity_divider3).setVisibility(8);
}
if (UsbConnection.getInstance().isConnected() && (devType == 1 || devType == 2)) {
setText1_(rootView, R.id.id_setting_subheader_fps, R.string.settingsFps);
switch (MagApplication.magParameter.fpsMode) {
case 1:
id3 = R.string.settingsFpsLow;
break;
default:
id3 = R.string.settingsFpsHigh;
break;
}
setTextIcon(rootView, R.id.id_setting_item_fps, R.string.settingsFps, id3, R.mipmap.expand_more).setOnClickListener(this.settingClickListner_);
} else {
rootView.findViewById(R.id.id_fps_divider1).setVisibility(8);
rootView.findViewById(R.id.id_setting_subheader_fps).setVisibility(8);
rootView.findViewById(R.id.id_fps_divider2).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_fps).setVisibility(8);
rootView.findViewById(R.id.id_fps_divider3).setVisibility(8);
}
if (UsbConnection.getInstance().isConnected() && devType == 1) {
setText1_(rootView, R.id.id_setting_subheader_moving_cross, R.string.settingsMovingCross);
setTextIcon(rootView, R.id.id_setting_item_moving_cross, R.string.settingsMovingCrossOn, "", MagApplication.magParameter.isShowMovingCross ? R.mipmap.media_selected : R.mipmap.media_unselected).setOnClickListener(this.settingClickListner_);
} else {
rootView.findViewById(R.id.id_moving_cross_divider1).setVisibility(8);
rootView.findViewById(R.id.id_setting_subheader_moving_cross).setVisibility(8);
rootView.findViewById(R.id.id_moving_cross_divider2).setVisibility(8);
rootView.findViewById(R.id.id_setting_item_moving_cross).setVisibility(8);
rootView.findViewById(R.id.id_moving_cross_divider3).setVisibility(8);
}
setText1_(rootView, R.id.id_setting_subheader_about, R.string.settingsAbout);
setTextIcon(rootView, R.id.id_setting_item_aboutProduct, R.string.settingsAboutProduct, "", R.mipmap.expand_more).setOnClickListener(this.settingClickListner_);
setTextIcon(rootView, R.id.id_setting_item_aboutAbout, R.string.settingsAboutAbout, "", R.mipmap.expand_more).setOnClickListener(this.settingClickListner_);
}
private void updateVisibleUi(int opt) {
int id;
switch (opt) {
case 0:
MagApplication.magParameter.visWndSize = 0;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_VISWNDSIZE, 0);
id = R.string.settingsVisibleSizeSmall;
break;
case 1:
default:
MagApplication.magParameter.visWndSize = 1;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_VISWNDSIZE, 1);
id = R.string.settingsVisibleSizeMedium;
break;
case 2:
MagApplication.magParameter.visWndSize = 2;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_VISWNDSIZE, 2);
id = R.string.settingsVisibleSizeLarge;
break;
}
View item = this.rootView_.findViewById(R.id.id_setting_item_visiblesize);
TextView txtView = (TextView) item.findViewById(R.id.id_setting_item_text2);
txtView.setText(id);
if (MagApplication.magParameter.dispMode == 0) {
FragmentMainCenter.imgViewerVisible_.setVisibility(4);
FragmentMainCenter.imgViewerVisible_.setVisibility(0);
}
}
private void updateTempTraceUi(int opt) {
int id;
switch (opt) {
case 0:
MagApplication.magParameter.maxMinTrace = -1;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_MAXMINTRACE, -1);
id = R.string.settingsNoneTrace;
break;
case 1:
default:
MagApplication.magParameter.maxMinTrace = 0;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_MAXMINTRACE, 0);
id = R.string.settingsMaxTrace;
break;
case 2:
MagApplication.magParameter.maxMinTrace = 1;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_MAXMINTRACE, 1);
id = R.string.settingsMinTrace;
break;
case 3:
MagApplication.magParameter.maxMinTrace = 2;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_MAXMINTRACE, 2);
id = R.string.settingsMaxMinTrace;
break;
}
View item = this.rootView_.findViewById(R.id.id_setting_item_maxmintrace);
TextView txtView = (TextView) item.findViewById(R.id.id_setting_item_text2);
txtView.setText(id);
}
private void updateImageEX(int opt) {
int id;
switch (opt) {
case 1:
id = R.string.settingsEX2;
break;
case 2:
id = R.string.settingsEX4;
break;
case 3:
id = R.string.settingsEX8;
break;
case 4:
id = R.string.settingsEX16;
break;
default:
id = R.string.settingsEX1;
break;
}
if (DeviceController.isProcessImage()) {
View item = this.rootView_.findViewById(R.id.id_setting_item_imageEX);
TextView txtView = (TextView) item.findViewById(R.id.id_setting_item_text2);
txtView.setText(id);
MagApplication.magParameter.imageEX = opt;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_EXMODE, 0);
DeviceController.setEX(opt, MagApplication.magParameter.basePara1.fpaWidth / 2, MagApplication.magParameter.basePara1.fpaHeight / 2);
}
}
private void updateEmissivity(int opt) {
int id;
switch (opt) {
case 1:
MagApplication.magParameter.emissivity = 90;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_EMISSIVITY, 90);
id = R.string.settingsEM2;
break;
case 2:
MagApplication.magParameter.emissivity = 80;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_EMISSIVITY, 80);
id = R.string.settingsEM3;
break;
case 3:
MagApplication.magParameter.emissivity = 70;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_EMISSIVITY, 70);
id = R.string.settingsEM4;
break;
default:
MagApplication.magParameter.emissivity = 100;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_EMISSIVITY, 100);
id = R.string.settingsEM1;
break;
}
DeviceController.Lock();
ExtPara param = new ExtPara();
DeviceController.getExtParameter(param);
DeviceController.setEmissivity(MagApplication.magParameter.emissivity, param.intCurrentEnvTemperature);
DeviceController.Unlock();
View item = this.rootView_.findViewById(R.id.id_setting_item_emissivity);
TextView txtView = (TextView) item.findViewById(R.id.id_setting_item_text2);
txtView.setText(id);
}
private void updateFpsUi(int opt) {
int id;
switch (opt) {
case 1:
MagApplication.magParameter.fpsMode = 1;
id = R.string.settingsFpsLow;
StatService.onEvent(getContext(), MagParameter.EVENT_FRAME_RATE_LOW_ID, MagParameter.EVENT_FRAME_RATE_LOW);
break;
default:
MagApplication.magParameter.fpsMode = 0;
id = R.string.settingsFpsHigh;
StatService.onEvent(getContext(), MagParameter.EVENT_FRAME_RATE_HIGH_ID, MagParameter.EVENT_FRAME_RATE_HIGH);
break;
}
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_FPSMODE, MagApplication.magParameter.fpsMode);
View item = this.rootView_.findViewById(R.id.id_setting_item_fps);
TextView txtView = (TextView) item.findViewById(R.id.id_setting_item_text2);
txtView.setText(id);
MsgBus.getInstance().postEmptytMsg(UsbCommunication.MSG_SET_BASEPARAMETER);
}
/* JADX INFO: Access modifiers changed from: private */
public void updateRoiTraceParameter(int itemId, int stringId) {
boolean isTraceRoi = !MagApplication.magParameter.isTraceRoi;
MagApplication.magParameter.isTraceRoi = isTraceRoi;
SharedPreferencesManager.putBooleanWithCommit(MagParameter.KEY_TRACEROI, isTraceRoi);
setTextIcon(this.rootView_, itemId, stringId, "", isTraceRoi ? R.mipmap.media_selected : R.mipmap.media_unselected);
if (isTraceRoi) {
Toast.makeText(getContext(), R.string.tipTraceRoi, 1).show();
StatService.onEvent(getContext(), MagParameter.EVENT_ROIT_TRACE_ID, MagParameter.EVENT_ROIT_TRACE);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void updateFlipParameter(int mode, int itemId, int stringId) {
int imageFlip;
boolean selected;
int imageFlip2 = MagApplication.magParameter.imageFlip;
if ((imageFlip2 & mode) == 0) {
imageFlip = imageFlip2 | mode;
selected = true;
} else {
imageFlip = imageFlip2 & (mode ^ (-1));
selected = false;
}
MagApplication.magParameter.imageFlip = imageFlip;
SharedPreferencesManager.putIntWithCommit(MagParameter.KEY_FLIPMODE, imageFlip);
setTextIcon(this.rootView_, itemId, stringId, "", selected ? R.mipmap.media_selected : R.mipmap.media_unselected);
ExtPara param = new ExtPara();
DeviceController.Lock();
DeviceController.getExtParameter(param);
param.dwFlip = imageFlip;
DeviceController.setExtParameter(param);
DeviceController.Unlock();
}
/* JADX INFO: Access modifiers changed from: private */
public void updateMovingCrossValue(int itemId, int stringId) {
boolean selected = !MagApplication.magParameter.isShowMovingCross;
MagApplication.magParameter.isShowMovingCross = selected;
SharedPreferencesManager.putBooleanWithCommit(MagParameter.KEY_SHOWMOVINGCROSS, selected);
setTextIcon(this.rootView_, itemId, stringId, "", selected ? R.mipmap.media_selected : R.mipmap.media_unselected);
}
private View setText1_(View rootView, int itemId, int stringId) {
View item = rootView.findViewById(itemId);
TextView txtView = (TextView) item.findViewById(R.id.id_setting_item_text);
txtView.setText(stringId);
return item;
}
private View setTextIcon(View rootView, int itemId, int stringId1, int stringId2, int iconId) {
View item = rootView.findViewById(itemId);
TextView txtView = (TextView) item.findViewById(R.id.id_setting_item_text);
txtView.setText(stringId1);
TextView txtView2 = (TextView) item.findViewById(R.id.id_setting_item_text2);
txtView2.setText(stringId2);
ImageView iv = (ImageView) item.findViewById(R.id.id_setting_icon);
iv.setImageResource(iconId);
return item;
}
private View setTextIcon(View rootView, int itemId, int stringId1, String text, int iconId) {
View item = rootView.findViewById(itemId);
TextView txtView = (TextView) item.findViewById(R.id.id_setting_item_text);
txtView.setText(stringId1);
TextView txtView2 = (TextView) item.findViewById(R.id.id_setting_item_text2);
txtView2.setText(text);
ImageView iv = (ImageView) item.findViewById(R.id.id_setting_icon);
iv.setImageResource(iconId);
return item;
}
@Override // cn.com.magnity.magnitycx.sdk.DelegateOptionSelected
public void onOptionSelected(int itemId, int opt) {
switch (itemId) {
case R.id.id_setting_item_visiblesize /* 2131624149 */:
updateVisibleUi(opt);
break;
case R.id.id_setting_item_maxmintrace /* 2131624153 */:
updateTempTraceUi(opt);
break;
case R.id.id_setting_item_imageEX /* 2131624160 */:
updateImageEX(opt);
break;
case R.id.id_setting_item_emissivity /* 2131624165 */:
updateEmissivity(opt);
break;
case R.id.id_setting_item_fps /* 2131624170 */:
updateFpsUi(opt);
break;
}
}
private class SettingClickListner implements View.OnClickListener {
private SettingClickListner() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
int index;
int index2;
int index3;
switch (v.getId()) {
case R.id.id_setting_item_aboutProduct /* 2131624146 */:
Intent intent = new Intent(FragmentSetting.this.getActivity(), (Class<?>) AboutProductActivity.class);
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_CLICK_PRODUCT_ID, MagParameter.EVENT_CLICK_PRODUCT);
FragmentSetting.this.startActivity(intent);
break;
case R.id.id_setting_item_aboutAbout /* 2131624147 */:
Intent intent2 = new Intent(FragmentSetting.this.getActivity(), (Class<?>) AboutAboutActivity.class);
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_CLICK_ABOUT_ID, MagParameter.EVENT_CLICK_ABOUT);
FragmentSetting.this.startActivity(intent2);
break;
case R.id.id_setting_item_visiblesize /* 2131624149 */:
switch (MagApplication.magParameter.visWndSize) {
case 0:
index3 = 0;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_VISWND_SMALL_ID, MagParameter.EVENT_VISWND_SMALL);
break;
case 1:
default:
index3 = 1;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_VISWND_MIDDLE_ID, MagParameter.EVENT_VISWND_MIDDLE);
break;
case 2:
index3 = 2;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_VISWND_LARGE_ID, MagParameter.EVENT_VISWND_LARGE);
break;
}
DialogFragment dlg = DialogOption.newInstance(R.string.visibleSizeOptionText, R.id.id_setting_item_visiblesize, new int[]{R.string.settingsVisibleSizeSmall, R.string.settingsVisibleSizeMedium, R.string.settingsVisibleSizeLarge}, index3, FragmentSetting.this, 0);
dlg.show(FragmentSetting.this.getActivity().getSupportFragmentManager(), "dialogOptionVisible");
break;
case R.id.id_setting_item_maxmintrace /* 2131624153 */:
switch (MagApplication.magParameter.maxMinTrace) {
case -1:
index2 = 0;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_TRACE_NONE_ID, MagParameter.EVENT_TRACE_NONE);
break;
case 0:
default:
index2 = 1;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_TRACE_MAX_ID, MagParameter.EVENT_TRACE_MAX);
break;
case 1:
index2 = 2;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_TRACE_MIN_ID, MagParameter.EVENT_TRACE_MIN);
break;
case 2:
index2 = 3;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_TRACE_MAXMIN_ID, MagParameter.EVENT_TRACE_MAXMIN);
break;
}
DialogFragment dlg2 = DialogOption.newInstance(R.string.settingsTraceTarget, R.id.id_setting_item_maxmintrace, new int[]{R.string.settingsNoneTrace, R.string.settingsMaxTrace, R.string.settingsMinTrace, R.string.settingsMaxMinTrace}, index2, FragmentSetting.this, 0);
dlg2.show(FragmentSetting.this.getActivity().getSupportFragmentManager(), "dialogOptionMaxMinTrace");
break;
case R.id.id_setting_item_roitrace /* 2131624155 */:
FragmentSetting.this.updateRoiTraceParameter(R.id.id_setting_item_roitrace, R.string.settingsTraceROI);
break;
case R.id.id_setting_item_imageHorflip /* 2131624158 */:
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_FLIP_HORIZONTAL_ID, MagParameter.EVENT_FLIP_HORIZONTAL);
FragmentSetting.this.updateFlipParameter(1, R.id.id_setting_item_imageHorflip, R.string.settingsImageFlipHor);
break;
case R.id.id_setting_item_imageVerflip /* 2131624159 */:
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_FLIP_VERTICAL_ID, MagParameter.EVENT_FLIP_VERTICAL);
FragmentSetting.this.updateFlipParameter(2, R.id.id_setting_item_imageVerflip, R.string.settingsImageFlipVer);
break;
case R.id.id_setting_item_imageEX /* 2131624160 */:
DialogFragment dlg3 = DialogOption.newInstance(R.string.settingsImageEX, R.id.id_setting_item_imageEX, new int[]{R.string.settingsEX1, R.string.settingsEX2, R.string.settingsEX4, R.string.settingsEX8, R.string.settingsEX16}, DeviceController.getEX(), FragmentSetting.this, 0);
dlg3.show(FragmentSetting.this.getActivity().getSupportFragmentManager(), "dialogOptionImageEx");
break;
case R.id.id_setting_item_emissivity /* 2131624165 */:
switch (MagApplication.magParameter.emissivity) {
case 70:
index = 3;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_EMISSIVITY_LIGHT_ID, MagParameter.EVENT_EMISSIVITY_LIGHT);
break;
case 80:
index = 2;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_EMISSIVITY_HALF_ID, MagParameter.EVENT_EMISSIVITY_HALF);
break;
case 90:
index = 1;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_EMISSIVITY_DARK_ID, MagParameter.EVENT_EMISSIVITY_DARK);
break;
default:
index = 0;
StatService.onEvent(FragmentSetting.this.getContext(), MagParameter.EVENT_EMISSIVITY_NONE_ID, MagParameter.EVENT_EMISSIVITY_NONE);
break;
}
DialogFragment dlg4 = DialogOption.newInstance(R.string.settingsEmissivity, R.id.id_setting_item_emissivity, new int[]{R.string.settingsEM1, R.string.settingsEM2, R.string.settingsEM3, R.string.settingsEM4}, index, FragmentSetting.this, 0);
dlg4.show(FragmentSetting.this.getActivity().getSupportFragmentManager(), "dialogOptionEmissivity");
break;
case R.id.id_setting_item_fps /* 2131624170 */:
DialogFragment dlg5 = DialogOption.newInstance(R.string.settingsFps, R.id.id_setting_item_fps, new int[]{R.string.settingsFpsHigh, R.string.settingsFpsLow}, MagApplication.magParameter.fpsMode, FragmentSetting.this, R.string.settingsFpsTip);
dlg5.show(FragmentSetting.this.getActivity().getSupportFragmentManager(), "dialogOptionFps");
break;
case R.id.id_setting_item_moving_cross /* 2131624175 */:
FragmentSetting.this.updateMovingCrossValue(R.id.id_setting_item_moving_cross, R.string.settingsMovingCrossOn);
break;
}
}
}
}
@@ -0,0 +1,63 @@
package cn.com.magnity.magnitycx;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
/* loaded from: classes.dex */
public class FragmentSupport extends Fragment {
private SupportClickListener settingClickListener_;
@Override // android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.settingClickListener_ = new SupportClickListener();
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_support, (ViewGroup) null);
View view = rootView.findViewById(R.id.id_product);
view.setOnClickListener(this.settingClickListener_);
ImageView icon = (ImageView) view.findViewById(R.id.id_icon);
icon.setImageResource(R.mipmap.help);
TextView text = (TextView) view.findViewById(R.id.id_text);
text.setText(R.string.labelProductInfo);
View view2 = rootView.findViewById(R.id.id_about);
view2.setOnClickListener(this.settingClickListener_);
ImageView icon2 = (ImageView) view2.findViewById(R.id.id_icon);
icon2.setImageResource(R.mipmap.about);
TextView text2 = (TextView) view2.findViewById(R.id.id_text);
text2.setText(R.string.labelAbout);
return rootView;
}
@Override // android.support.v4.app.Fragment
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getActivity().setTitle(R.string.labelHelp);
}
private class SupportClickListener implements View.OnClickListener {
private SupportClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
switch (v.getId()) {
case R.id.id_product /* 2131624177 */:
((SupportActivity) FragmentSupport.this.getActivity()).showHelp();
break;
case R.id.id_about /* 2131624178 */:
((SupportActivity) FragmentSupport.this.getActivity()).showAbout();
break;
}
}
}
}
@@ -0,0 +1,124 @@
package cn.com.magnity.magnitycx;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import cn.com.magnity.magnitycx.sdk.UsbConnection;
/* loaded from: classes.dex */
public class FragmentSupportAbout extends Fragment {
private PackageInfo packInfo_;
private SettingClickListener settingClickListener_;
private TextView tvCompanyCaption_;
private TextView tvCompany_;
private TextView tvHWVersionCaption_;
private TextView tvHWVersion_;
private TextView tvProductTypeCaption_;
private TextView tvProductType_;
private TextView tvRightCaption_;
private TextView tvRight_;
private TextView tvSWVersionCaption_;
private TextView tvSWVersion_;
@Override // android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.settingClickListener_ = new SettingClickListener();
PackageManager packageManager = getActivity().getPackageManager();
try {
this.packInfo_ = packageManager.getPackageInfo(getActivity().getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
this.packInfo_ = null;
}
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_support_about, container, false);
View view = rootView.findViewById(R.id.id_productType);
this.tvProductTypeCaption_ = (TextView) view.findViewById(R.id.id_text1);
this.tvProductTypeCaption_.setText(R.string.productType);
this.tvProductType_ = (TextView) view.findViewById(R.id.id_text2);
if (UsbConnection.getInstance().isConnected()) {
switch (MagApplication.magParameter.basePara1.devType) {
case 0:
this.tvProductType_.setText(R.string.c1);
break;
case 1:
this.tvProductType_.setText(R.string.c3);
break;
case 2:
this.tvProductType_.setText(R.string.c3p);
break;
case 3:
this.tvProductType_.setText(R.string.core160);
break;
case 4:
default:
this.tvProductType_.setText("");
break;
case 5:
this.tvProductType_.setText(R.string.c1pro);
break;
case 6:
this.tvProductType_.setText(R.string.c1prolite);
break;
}
} else {
this.tvProductType_.setText("");
}
View view2 = rootView.findViewById(R.id.id_swVersion);
this.tvSWVersionCaption_ = (TextView) view2.findViewById(R.id.id_text1);
this.tvSWVersionCaption_.setText(R.string.swVersion);
this.tvSWVersion_ = (TextView) view2.findViewById(R.id.id_text2);
if (this.packInfo_ != null) {
this.tvSWVersion_.setText(this.packInfo_.versionName);
}
View view3 = rootView.findViewById(R.id.id_right);
this.tvRightCaption_ = (TextView) view3.findViewById(R.id.id_text1);
this.tvRightCaption_.setText(R.string.right);
this.tvRight_ = (TextView) view3.findViewById(R.id.id_text2);
this.tvRight_.setText(R.string.juge);
View view4 = rootView.findViewById(R.id.id_hwVersion);
this.tvHWVersionCaption_ = (TextView) view4.findViewById(R.id.id_text1);
this.tvHWVersionCaption_.setText(R.string.hwVersion);
this.tvHWVersion_ = (TextView) view4.findViewById(R.id.id_text2);
if (UsbConnection.getInstance().isConnected()) {
this.tvHWVersion_.setText(Integer.toString(MagApplication.magParameter.basePara1.hwVersion));
} else {
this.tvHWVersion_.setText("");
}
View view5 = rootView.findViewById(R.id.id_company);
this.tvCompanyCaption_ = (TextView) view5.findViewById(R.id.id_text1);
this.tvCompanyCaption_.setText(R.string.company);
this.tvCompany_ = (TextView) view5.findViewById(R.id.id_text2);
this.tvCompany_.setText("http://www.magnity.com.cn");
this.tvCompany_.setAutoLinkMask(15);
this.tvCompany_.setMovementMethod(LinkMovementMethod.getInstance());
return rootView;
}
@Override // android.support.v4.app.Fragment
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getActivity().setTitle(R.string.labelAbout);
}
private class SettingClickListener implements View.OnClickListener {
private SettingClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
v.getId();
}
}
}
@@ -0,0 +1,28 @@
package cn.com.magnity.magnitycx;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/* loaded from: classes.dex */
public class FragmentSupportHelp extends Fragment {
@Override // android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override // android.support.v4.app.Fragment
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_support_help, (ViewGroup) null);
}
@Override // android.support.v4.app.Fragment
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getActivity().setTitle(R.string.labelProductInfo);
}
}
@@ -0,0 +1,959 @@
package cn.com.magnity.magnitycx;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import cn.com.magnity.magnitycx.FragmentMainCenter;
import cn.com.magnity.magnitycx.log.Logging;
import cn.com.magnity.magnitycx.sdk.DeviceController;
import cn.com.magnity.magnitycx.sdk.MagParameter;
import cn.com.magnity.magnitycx.sdk.SharedPreferencesManager;
import cn.com.magnity.magnitycx.sdk.State;
import cn.com.magnity.magnitycx.sdk.TimerHelper;
import cn.com.magnity.magnitycx.sdk.UsbCommunication;
import cn.com.magnity.magnitycx.sdk.WaitCondition;
import com.baidu.mobstat.Config;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/* loaded from: classes.dex */
public class ImageViewer extends SurfaceView implements SurfaceHolder.Callback, UsbCommunication.DelegateNewFrame, FragmentMainCenter.DelegateCapture {
private static final int MAX_ROI_NUM = 1;
private int aimOrientation_;
private int aimX_;
private int aimY_;
private Bitmap bmpIr_;
private Canvas cachedCanvas_;
private Bitmap cachedbmp_;
private WaitCondition condRecording_;
private int dx_;
private int dy_;
private volatile int fpaHeight_;
private volatile int fpaWidth_;
private int frameIndex_;
private int height_;
private SurfaceHolder holder_;
private volatile int imageStableCounter_;
private boolean isAimDrag_;
private volatile boolean isExitThreadRecording_;
private volatile boolean isExitThreadRender_;
private volatile boolean isTempStable_;
private ArrayList<ROIInfo> listRoi_;
private Matrix matrixVGA_;
private Matrix matrix_;
private Paint paintROIVGA_;
private Paint paintROI_;
private Paint paintVGA_;
private Paint paint_;
private PaintFlagsDrawFilter pfd_;
private AtomicLong recordingTimeElapsed_;
private volatile ThreadLocalParam threadLocalParam_;
private ThreadRecording threadRecording_;
private ThreadRender threadRender_;
private TimerHelper timerHelper_;
private WaitCondition waitCondition_;
private int width_;
private static volatile Lock lock_ = new ReentrantLock();
private static volatile long[] ticks_ = new long[20];
private static Object syncNotifyNewFrame_ = new Object();
private static ArrayList<ImageViewer> imgViewerList_ = new ArrayList<>();
private class ThreadLocalParam implements Cloneable {
int centerTemp;
State state;
private ThreadLocalParam() {
}
public Object clone() throws CloneNotSupportedException {
ThreadLocalParam param = (ThreadLocalParam) super.clone();
if (this.state != null) {
param.state = (State) this.state.clone();
}
return param;
}
}
private class OSDParam {
private Bitmap crossLogo_;
private Bitmap laserLogo_;
private Bitmap maxTrace_;
private Bitmap minTrace_;
private Bitmap moveingCrossLogo_;
private Bitmap waterMark_;
private OSDParam() {
}
public Bitmap getCrossLogo() {
return this.crossLogo_;
}
public Bitmap getWaterMark() {
return this.waterMark_;
}
public Bitmap getMinTrace() {
return this.minTrace_;
}
public Bitmap getMaxTrace() {
return this.maxTrace_;
}
public Bitmap getMovingCrossLogo() {
return this.moveingCrossLogo_;
}
public Bitmap getLaserLogo() {
return this.laserLogo_;
}
public void setCrossLogo(int id) {
this.crossLogo_ = BitmapFactory.decodeResource(ImageViewer.this.getResources(), id);
}
public void setWaterMark(int id) {
this.waterMark_ = BitmapFactory.decodeResource(ImageViewer.this.getResources(), id);
}
public void setMinTrace(int id) {
this.minTrace_ = BitmapFactory.decodeResource(ImageViewer.this.getResources(), id);
}
public void setMaxTrace(int id) {
this.maxTrace_ = BitmapFactory.decodeResource(ImageViewer.this.getResources(), id);
}
public void setMovingCrossLogo(int id) {
this.moveingCrossLogo_ = BitmapFactory.decodeResource(ImageViewer.this.getResources(), id);
}
public void setLaserLogo(int id) {
this.laserLogo_ = BitmapFactory.decodeResource(ImageViewer.this.getResources(), id);
}
/* JADX INFO: Access modifiers changed from: private */
public void reset() {
if (this.crossLogo_ != null && !this.crossLogo_.isRecycled()) {
this.crossLogo_.recycle();
this.crossLogo_ = null;
}
if (this.waterMark_ != null && !this.waterMark_.isRecycled()) {
this.waterMark_.recycle();
this.waterMark_ = null;
}
if (this.minTrace_ != null && !this.minTrace_.isRecycled()) {
this.minTrace_.recycle();
this.minTrace_ = null;
}
if (this.maxTrace_ != null && !this.maxTrace_.isRecycled()) {
this.maxTrace_.recycle();
this.maxTrace_ = null;
}
if (this.moveingCrossLogo_ != null && !this.moveingCrossLogo_.isRecycled()) {
this.moveingCrossLogo_.recycle();
this.moveingCrossLogo_ = null;
}
if (this.laserLogo_ != null && !this.laserLogo_.isRecycled()) {
this.laserLogo_.recycle();
this.laserLogo_ = null;
}
}
}
public void setTempStableFlag(boolean isStable) {
this.isTempStable_ = isStable;
}
public boolean getTempStableFlag() {
return this.isTempStable_;
}
public void setImageStableCounter(int counter) {
this.imageStableCounter_ = counter;
}
public int getImageStableCounter() {
return this.imageStableCounter_;
}
public ImageViewer(Context context, AttributeSet attrs) {
super(context, attrs);
this.waitCondition_ = new WaitCondition();
this.condRecording_ = new WaitCondition();
this.threadLocalParam_ = new ThreadLocalParam();
this.paint_ = new Paint(1);
this.matrix_ = new Matrix();
this.matrixVGA_ = new Matrix();
this.paintVGA_ = new Paint(1);
this.paintROI_ = new Paint(1);
this.paintROIVGA_ = new Paint(1);
this.listRoi_ = new ArrayList<>();
this.recordingTimeElapsed_ = new AtomicLong(0L);
this.holder_ = getHolder();
this.holder_.setFormat(-2);
this.holder_.addCallback(this);
this.timerHelper_ = new TimerHelper() { // from class: cn.com.magnity.magnitycx.ImageViewer.1
@Override // cn.com.magnity.magnitycx.sdk.TimerHelper
public void run() {
ImageViewer.this.recordingTimeElapsed_.getAndIncrement();
}
};
}
private void invalidate_() {
synchronized (this.waitCondition_.cond) {
this.waitCondition_.notified = true;
this.waitCondition_.cond.notify();
}
}
private void recordingOneFrame() {
synchronized (this.condRecording_.cond) {
this.condRecording_.notified = true;
this.condRecording_.cond.notify();
}
}
private void updateUiTemps(int fpaWidth, int fpaHeight) {
int pos;
switch (DeviceController.getPreviewOrientation()) {
case 0:
case 180:
pos = ((fpaHeight + 1) * fpaWidth) / 2;
break;
default:
pos = ((fpaWidth + 1) * fpaHeight) / 2;
break;
}
this.threadLocalParam_.centerTemp = DeviceController.getTemperature(pos, 1, false);
this.threadLocalParam_.state = DeviceController.getState();
ROIInfo.lock();
try {
Iterator<ROIInfo> it = this.listRoi_.iterator();
while (it.hasNext()) {
ROIInfo roiInfo = it.next();
switch (roiInfo.getType()) {
case 1:
int[] info = new int[5];
if (roiInfo.isBigEnouth() && DeviceController.getRectTemperatureInfo(roiInfo.getBeginPointX(), roiInfo.getBeginPointY(), roiInfo.getEndPointX(), roiInfo.getEndPointY(), info, false)) {
roiInfo.setTempInfo(info[0], info[1], info[2], info[3], info[4]);
break;
}
break;
}
}
} finally {
ROIInfo.unlock();
}
}
public void initData(int fpaWidth, int fpaHeight) {
this.fpaWidth_ = fpaWidth;
this.fpaHeight_ = fpaHeight;
if (this.bmpIr_ == null) {
this.bmpIr_ = Bitmap.createBitmap(fpaWidth, fpaHeight, Bitmap.Config.ARGB_8888);
} else if (this.bmpIr_.getWidth() != fpaWidth || this.bmpIr_.getHeight() != fpaHeight) {
if (!this.bmpIr_.isRecycled()) {
this.bmpIr_.recycle();
}
this.bmpIr_ = Bitmap.createBitmap(fpaWidth, fpaHeight, Bitmap.Config.ARGB_8888);
}
}
@Override // cn.com.magnity.magnitycx.sdk.UsbCommunication.DelegateNewFrame
public void onNewFrameReceived(int fpaTemp, int camTemp) {
DeviceController.Lock();
if (!DeviceController.getOutputBMPData(this.bmpIr_, this.fpaWidth_ * this.fpaHeight_ * 4)) {
DeviceController.Unlock();
return;
}
int i = this.frameIndex_;
this.frameIndex_ = i + 1;
if ((i & 7) == 0) {
updateUiTemps(this.fpaWidth_, this.fpaHeight_);
}
DeviceController.Unlock();
if (DeviceController.isRecording()) {
recordingOneFrame();
}
invalidate_();
}
private void calculateScreenFit() {
int width;
int height;
int width2 = getWidth();
int height2 = getHeight();
if (getResources().getConfiguration().orientation == 1) {
if (width2 * 4 > height2 * 3) {
height = (height2 / 12) * 12;
width = (height * 3) / 4;
} else {
width = (width2 / 12) * 12;
height = (width * 4) / 3;
}
} else if (width2 * 3 > height2 * 4) {
height = (height2 / 12) * 12;
width = (height * 4) / 3;
} else {
width = (width2 / 12) * 12;
height = (width * 3) / 4;
}
this.dx_ = (getWidth() - width) / 2;
this.dy_ = (getHeight() - height) / 2;
this.width_ = width;
this.height_ = height;
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceCreated(SurfaceHolder holder) {
if (this.cachedbmp_ == null) {
switch (DeviceController.getPreviewOrientation()) {
case 0:
case 180:
this.cachedbmp_ = Bitmap.createBitmap(640, 480, Bitmap.Config.ARGB_8888);
break;
case 90:
case 270:
this.cachedbmp_ = Bitmap.createBitmap(480, 640, Bitmap.Config.ARGB_8888);
break;
}
}
if (this.cachedCanvas_ == null) {
this.cachedCanvas_ = new Canvas();
this.cachedCanvas_.setBitmap(this.cachedbmp_);
}
Canvas canvas = this.holder_.lockCanvas();
if (canvas != null) {
this.paint_.setTextSize(getResources().getDimensionPixelSize(R.dimen.liveTemperatureTextSize));
this.paint_.setTypeface(Typeface.SANS_SERIF);
this.paint_.setTextAlign(Paint.Align.LEFT);
this.paint_.setColor(getResources().getColor(R.color.liveBackground));
canvas.drawRect(0.0f, 0.0f, getWidth(), getHeight(), this.paint_);
this.holder_.unlockCanvasAndPost(canvas);
this.paint_.setColor(getResources().getColor(R.color.textColor));
this.paint_.setStyle(Paint.Style.FILL_AND_STROKE);
this.paint_.setStrokeWidth(2.0f);
this.paint_.setShadowLayer(12.0f, 0.0f, 0.0f, getResources().getColor(R.color.black));
this.paintVGA_.setTextSize(getResources().getDimensionPixelSize(R.dimen.recordingTemperatureTextSize));
this.paintVGA_.setTypeface(Typeface.SANS_SERIF);
this.paintVGA_.setTextAlign(Paint.Align.LEFT);
this.paintVGA_.setColor(getResources().getColor(R.color.textColor));
this.paintVGA_.setStyle(Paint.Style.FILL_AND_STROKE);
this.paintVGA_.setStrokeWidth(1.0f);
this.paintVGA_.setShadowLayer(6.0f, 0.0f, 0.0f, getResources().getColor(R.color.black));
this.paintROI_.setColor(getResources().getColor(R.color.roiColor));
this.paintROI_.setStyle(Paint.Style.STROKE);
this.paintROI_.setStrokeWidth(4.0f);
this.paintROI_.setShadowLayer(6.0f, 0.0f, 0.0f, getResources().getColor(R.color.black));
this.paintROIVGA_.setColor(getResources().getColor(R.color.roiColor));
this.paintROIVGA_.setStyle(Paint.Style.STROKE);
this.paintROIVGA_.setStrokeWidth(2.0f);
this.paintROIVGA_.setShadowLayer(2.0f, 0.0f, 0.0f, getResources().getColor(R.color.black));
}
this.pfd_ = new PaintFlagsDrawFilter(0, 3);
synchronized (syncNotifyNewFrame_) {
imgViewerList_.add(this);
}
calculateScreenFit();
this.aimOrientation_ = getResources().getConfiguration().orientation;
if (this.aimOrientation_ == 1) {
this.aimX_ = SharedPreferencesManager.getInt("aimX_portrait", getWidth() / 2);
this.aimY_ = SharedPreferencesManager.getInt("aimY_portrait", getHeight() / 2);
} else {
this.aimX_ = SharedPreferencesManager.getInt("aimX_landscape", getWidth() / 2);
this.aimY_ = SharedPreferencesManager.getInt("aimY_landscape", getHeight() / 2);
}
DeviceController.setColorbarSize(100, 20);
DeviceController.setColorPalette(SharedPreferencesManager.getInt("paletteIndex", 2));
this.threadRender_ = new ThreadRender();
this.isExitThreadRender_ = false;
this.waitCondition_.notified = false;
this.threadRender_.start();
this.threadRecording_ = new ThreadRecording();
this.isExitThreadRecording_ = false;
this.condRecording_.notified = false;
this.threadRecording_.start();
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
calculateScreenFit();
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceDestroyed(SurfaceHolder holder) {
if (this.aimOrientation_ == 1) {
SharedPreferencesManager.putInt("aimX_portrait", this.aimX_);
SharedPreferencesManager.putIntWithCommit("aimY_portrait", this.aimY_);
} else {
SharedPreferencesManager.putInt("aimX_landscape", this.aimX_);
SharedPreferencesManager.putIntWithCommit("aimY_landscape", this.aimY_);
}
this.isExitThreadRender_ = true;
synchronized (this.waitCondition_.cond) {
this.waitCondition_.notified = true;
this.waitCondition_.cond.notify();
}
try {
this.threadRender_.join();
this.threadRender_ = null;
} catch (InterruptedException e) {
}
this.isExitThreadRecording_ = true;
synchronized (this.condRecording_.cond) {
this.condRecording_.notified = true;
this.condRecording_.cond.notify();
}
try {
this.threadRecording_.join();
this.threadRecording_ = null;
} catch (InterruptedException e2) {
}
synchronized (syncNotifyNewFrame_) {
imgViewerList_.remove(this);
}
this.cachedCanvas_ = null;
if (!this.cachedbmp_.isRecycled()) {
this.cachedbmp_.recycle();
this.cachedbmp_ = null;
}
}
@Override // cn.com.magnity.magnitycx.FragmentMainCenter.DelegateCapture
public boolean onStartRecording(String pathName) {
boolean ret = DeviceController.startRecording(pathName, this.cachedbmp_.getWidth(), this.cachedbmp_.getHeight(), 2048, 20, 5);
this.recordingTimeElapsed_.set(0L);
this.timerHelper_.start(1000L, 1000L);
return ret;
}
@Override // cn.com.magnity.magnitycx.FragmentMainCenter.DelegateCapture
public void onStopRecording() {
this.timerHelper_.stop();
if (DeviceController.isRecording()) {
DeviceController.stopRecording();
}
}
@Override // cn.com.magnity.magnitycx.FragmentMainCenter.DelegateCapture
public Bitmap onCapture() {
OSDParam osdParam = new OSDParam();
osdParam.setCrossLogo(R.mipmap.cross_capture);
osdParam.setWaterMark(R.mipmap.water_mark);
osdParam.setMinTrace(R.mipmap.min_trace_capture);
osdParam.setMaxTrace(R.mipmap.max_trace_capture);
DeviceController.Lock();
updateUiTemps(this.fpaWidth_, this.fpaHeight_);
DeviceController.Unlock();
drawImage(this.cachedCanvas_, this.paintVGA_, this.paintROIVGA_, this.matrixVGA_, 0, 0, this.cachedbmp_.getWidth(), this.cachedbmp_.getHeight(), osdParam);
return this.cachedbmp_;
}
@Override // cn.com.magnity.magnitycx.FragmentMainCenter.DelegateCapture
public void onCaptureFinished(String pathName) {
}
@Override // android.view.View
public boolean onTouchEvent(MotionEvent event) {
boolean z = false;
if (!DeviceController.isProcessImage()) {
return false;
}
switch (event.getActionMasked()) {
case 0:
if (MagApplication.magParameter.isTraceRoi) {
int[] coor = DeviceController.screenXY2ClientXY(((int) event.getX()) - this.dx_, ((int) event.getY()) - this.dy_, this.width_, this.height_);
boolean isPointInROI = false;
ROIInfo.lock();
try {
Iterator<ROIInfo> it = this.listRoi_.iterator();
while (true) {
if (it.hasNext()) {
if (it.next().isPointIn(coor[0], coor[1])) {
it.remove();
isPointInROI = true;
}
}
}
if (!isPointInROI && this.listRoi_.size() > 0) {
this.listRoi_.remove(0);
}
ROIInfo.unlock();
ROIInfo roiInfo = new ROIInfo(1);
roiInfo.setBeginPoint(coor[0], coor[1]);
roiInfo.setEndPoint(coor[0], coor[1]);
ROIInfo.lock();
try {
this.listRoi_.add(roiInfo);
return true;
} finally {
}
} finally {
}
}
if (MagApplication.magParameter.basePara1.devType != 1 || !MagApplication.magParameter.isShowMovingCross || event.getX() <= this.aimX_ - 48 || event.getX() >= this.aimX_ + 48 || event.getY() <= this.aimY_ - 48 || event.getY() >= this.aimY_ + 48) {
return false;
}
this.isAimDrag_ = true;
return true;
case 1:
if (MagApplication.magParameter.isTraceRoi) {
int num = this.listRoi_.size();
if (num < 1) {
return false;
}
ROIInfo roiInfo2 = this.listRoi_.get(num - 1);
int[] coor2 = DeviceController.screenXY2ClientXY(((int) event.getX()) - this.dx_, ((int) event.getY()) - this.dy_, this.width_, this.height_);
ROIInfo.lock();
try {
roiInfo2.setEndPoint(coor2[0], coor2[1]);
if (!roiInfo2.isBigEnouth()) {
this.listRoi_.remove(num - 1);
} else {
roiInfo2.setFinished();
ROIInfo.unlock();
invalidate_();
z = true;
}
return z;
} finally {
}
}
if (!this.isAimDrag_) {
return false;
}
this.isAimDrag_ = false;
invalidate_();
return true;
case 2:
if (MagApplication.magParameter.isTraceRoi) {
int num2 = this.listRoi_.size();
if (num2 < 1) {
return false;
}
ROIInfo roiInfo3 = this.listRoi_.get(num2 - 1);
int[] coor3 = DeviceController.screenXY2ClientXY(((int) event.getX()) - this.dx_, ((int) event.getY()) - this.dy_, this.width_, this.height_);
if (!roiInfo3.isFinished()) {
ROIInfo.lock();
try {
roiInfo3.setEndPoint(coor3[0], coor3[1]);
} finally {
}
}
return true;
}
if (!this.isAimDrag_) {
return false;
}
this.aimX_ = (int) event.getX();
this.aimY_ = (int) event.getY();
if (this.aimX_ < this.dx_) {
this.aimX_ = this.dx_;
} else if (this.aimX_ > this.dx_ + this.width_) {
this.aimX_ = this.dx_ + this.width_;
}
if (this.aimY_ < this.dy_) {
this.aimY_ = this.dy_;
} else if (this.aimY_ > this.dy_ + this.height_) {
this.aimY_ = this.dy_ + this.height_;
}
invalidate_();
return true;
default:
return false;
}
}
/* JADX INFO: Access modifiers changed from: private */
public void doDraw(OSDParam param) {
Bitmap crossLogo;
Canvas canvas = this.holder_.lockCanvas();
if (canvas != null) {
drawImage(canvas, this.paint_, this.paintROI_, this.matrix_, this.dx_, this.dy_, this.width_, this.height_, param);
drawMarginBackground(canvas, this.paint_, this.dx_, this.dy_, this.width_, this.height_);
if (DeviceController.isRecording()) {
drawRecordingTime(canvas, this.paint_, this.dx_, this.dy_, this.width_, this.height_, this.recordingTimeElapsed_.get());
}
if (MagApplication.magParameter.basePara1.devType == 1 && (crossLogo = param.getMovingCrossLogo()) != null && MagApplication.magParameter.isShowMovingCross) {
canvas.drawBitmap(crossLogo, this.aimX_ - (crossLogo.getWidth() / 2), this.aimY_ - (crossLogo.getHeight() / 2), (Paint) null);
}
this.holder_.unlockCanvasAndPost(canvas);
}
}
private void drawFps(Canvas canvas, Paint paint, int dx, int dy, int width, int height, int recvFps, int showFps) {
Paint p = new Paint();
p.setColor(-16711936);
p.setTextSize(20.0f);
String s = String.format("接收帧率:%s", Integer.valueOf(recvFps));
Rect rect = new Rect();
p.getTextBounds(s, 0, s.length(), rect);
canvas.drawText(s, dx + 2, rect.height() + dy + 2, p);
canvas.drawText(String.format("显示帧率:%s", Integer.valueOf(showFps)), dx + 2, ((rect.height() + 2) * 2) + dy, p);
}
private void drawRecordingTime(Canvas canvas, Paint paint, int dx, int dy, int width, int height, long seconds) {
long hour = seconds / 3600;
long min = (seconds - (3600 * hour)) / 60;
long sec = (seconds - (3600 * hour)) - (60 * min);
String hms = String.format("%02d", Long.valueOf(hour)) + Config.TRACE_TODAY_VISIT_SPLIT + String.format("%02d", Long.valueOf(min)) + Config.TRACE_TODAY_VISIT_SPLIT + String.format("%02d", Long.valueOf(sec));
float oldFontSize = paint.getTextSize();
paint.setTextSize(getResources().getDimensionPixelSize(R.dimen.recordingTimeTextSize));
int oldFontColor = paint.getColor();
paint.setColor(getResources().getColor(R.color.highlightText));
Rect rect = new Rect();
paint.getTextBounds(hms + "8", 0, hms.length() + 1, rect);
canvas.drawText(hms, ((getWidth() - rect.width()) / 2) + dx, (dy + height) - 20, paint);
paint.setTextSize(oldFontSize);
paint.setColor(oldFontColor);
}
private void drawMarginBackground(Canvas canvas, Paint paint, int dx, int dy, int width, int height) {
int oldColor = paint.getColor();
paint.setColor(getResources().getColor(R.color.black));
canvas.drawRect(0.0f, 0.0f, dx, getHeight(), paint);
canvas.drawRect(0.0f, 0.0f, getWidth(), dy, paint);
canvas.drawRect(dx + width, 0.0f, getWidth(), getHeight(), paint);
canvas.drawRect(0.0f, dy + height, getWidth(), getHeight(), paint);
paint.setColor(oldColor);
}
private void drawROIs(Canvas canvas, Paint paint, Paint paintROI, Rect rect, int dx, int dy, int width, int height, OSDParam osdParam) {
String format;
int[] coor;
Bitmap maxTrace = osdParam.getMaxTrace();
Bitmap minTrace = osdParam.getMinTrace();
int traceType = MagApplication.magParameter.maxMinTrace;
if (this.isTempStable_) {
format = "%.1f℃";
} else {
format = "~%.1f℃";
}
int pad = maxTrace.getWidth() / 6;
ROIInfo.lock();
try {
Iterator<ROIInfo> it = this.listRoi_.iterator();
while (it.hasNext()) {
ROIInfo roiInfo = it.next();
switch (roiInfo.getType()) {
case 1:
int[] coor2 = DeviceController.clientXY2ScreenXY(roiInfo.getBeginPointX(), roiInfo.getBeginPointY(), width, height);
int[] coor22 = DeviceController.clientXY2ScreenXY(roiInfo.getEndPointX(), roiInfo.getEndPointY(), width, height);
canvas.drawRect(coor2[0] + dx, coor2[1] + dy, coor22[0] + dx, coor22[1] + dy, paintROI);
if (roiInfo.isBigEnouth() && roiInfo.isTempValid()) {
if ((traceType == 0 || traceType == 2 || traceType == -1) && (coor = DeviceController.clientPos2ScreenXY(roiInfo.getMaxPos(), width, height)) != null) {
canvas.drawBitmap(maxTrace, (coor[0] - (maxTrace.getWidth() / 2)) + dx, (coor[1] - (maxTrace.getHeight() / 2)) + dy, paint);
String str = String.format(format, Float.valueOf(roiInfo.getMaxTemp() * 0.001f));
paint.getTextBounds(str, 0, str.length(), rect);
int cx = rect.width();
int cy = rect.height();
int x = coor[0] + pad;
int y = coor[1] + cy + pad;
if (x > width - cx) {
x = (coor[0] - pad) - cx;
}
if (y > height) {
y = (coor[1] - pad) - cy;
}
canvas.drawText(str, x + dx, y + dy, paint);
}
if (traceType != 1 && traceType != 2) {
break;
} else {
int[] coor3 = DeviceController.clientPos2ScreenXY(roiInfo.getMinPos(), width, height);
if (coor3 == null) {
break;
} else {
canvas.drawBitmap(minTrace, (coor3[0] - (minTrace.getWidth() / 2)) + dx, (coor3[1] - (minTrace.getHeight() / 2)) + dy, paint);
String str2 = String.format(format, Float.valueOf(roiInfo.getMinTemp() * 0.001f));
paint.getTextBounds(str2, 0, str2.length(), rect);
int cx2 = rect.width();
int cy2 = rect.height();
int x2 = coor3[0] + pad;
int y2 = coor3[1] + cy2 + pad;
if (x2 > width - cx2) {
x2 = (coor3[0] - pad) - cx2;
}
if (y2 > height) {
y2 = (coor3[1] - pad) - cy2;
}
canvas.drawText(str2, x2 + dx, y2 + dy, paint);
break;
}
}
}
break;
}
}
} finally {
ROIInfo.unlock();
}
}
private void drawMaxMin(Canvas canvas, Paint paint, State state, Rect rect, int dx, int dy, int width, int height, OSDParam osdParam) {
String format;
int[] coor;
int[] coor2;
Bitmap maxTrace = osdParam.getMaxTrace();
Bitmap minTrace = osdParam.getMinTrace();
if (this.isTempStable_) {
format = "%.1f℃";
} else {
format = "~%.1f℃";
}
if (maxTrace != null && minTrace != null) {
int pad = maxTrace.getWidth() / 6;
int traceType = MagApplication.magParameter.maxMinTrace;
if ((traceType == 0 || traceType == 2) && (coor = DeviceController.clientXY2ScreenXY(state.intMaxX, state.intMaxY, width, height)) != null) {
canvas.drawBitmap(maxTrace, (coor[0] - (maxTrace.getWidth() / 2)) + dx, (coor[1] - (maxTrace.getHeight() / 2)) + dy, paint);
String str = String.format(format, Float.valueOf(state.intMaxTemperature * 0.001f));
paint.getTextBounds(str, 0, str.length(), rect);
int cx = rect.width();
int cy = rect.height();
int x = coor[0] + pad;
int y = coor[1] + cy + pad;
if (x > width - cx) {
x = (coor[0] - pad) - cx;
}
if (y > height) {
y = (coor[1] - pad) - cy;
}
canvas.drawText(str, x + dx, y + dy, paint);
}
if ((traceType == 1 || traceType == 2) && (coor2 = DeviceController.clientXY2ScreenXY(state.intMinX, state.intMinY, width, height)) != null) {
canvas.drawBitmap(minTrace, (coor2[0] - (minTrace.getWidth() / 2)) + dx, (coor2[1] - (minTrace.getHeight() / 2)) + dy, paint);
String str2 = String.format(format, Float.valueOf(state.intMinTemperature * 0.001f));
paint.getTextBounds(str2, 0, str2.length(), rect);
int cx2 = rect.width();
int cy2 = rect.height();
int x2 = coor2[0] + pad;
int y2 = coor2[1] + cy2 + pad;
if (x2 > width - cx2) {
x2 = (coor2[0] - pad) - cx2;
}
if (y2 > height) {
y2 = (coor2[1] - pad) - cy2;
}
canvas.drawText(str2, x2 + dx, y2 + dy, paint);
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public void drawImage(Canvas canvas, Paint paint, Paint paintROI, Matrix matrix, int dx, int dy, int width, int height, OSDParam osdParam) {
Bitmap laserLogo;
Bitmap crossLogo;
String str;
matrix.reset();
Rect rect = new Rect();
ThreadLocalParam param = null;
switch (DeviceController.getPreviewOrientation()) {
case 0:
float ratioX = width / this.fpaWidth_;
float ratioY = height / this.fpaHeight_;
matrix.postScale(ratioX, ratioY, 0.0f, 0.0f);
matrix.postTranslate(dx, dy);
break;
case 90:
float ratioX2 = width / this.fpaHeight_;
float ratioY2 = height / this.fpaWidth_;
matrix.postRotate(90.0f);
matrix.postTranslate(this.fpaHeight_ + dx, dy);
matrix.postScale(ratioX2, ratioY2, dx, dy);
break;
case 180:
float ratioX3 = width / this.fpaWidth_;
float ratioY3 = height / this.fpaHeight_;
matrix.postRotate(180.0f, this.fpaWidth_ / 2, this.fpaHeight_ / 2);
matrix.postTranslate(dx, dy);
matrix.postScale(ratioX3, ratioY3, dx, dy);
break;
case 270:
float ratioX4 = width / this.fpaHeight_;
float ratioY4 = height / this.fpaWidth_;
matrix.postRotate(-90.0f);
matrix.postTranslate(dx, this.fpaWidth_ + dy);
matrix.postScale(ratioX4, ratioY4, dx, dy);
break;
}
canvas.setDrawFilter(this.pfd_);
DeviceController.Lock();
canvas.drawBitmap(this.bmpIr_, matrix, null);
try {
param = (ThreadLocalParam) this.threadLocalParam_.clone();
} catch (CloneNotSupportedException e) {
} finally {
DeviceController.Unlock();
}
DeviceController.Unlock();
MagParameter magParameter = MagApplication.magParameter;
if (magParameter.isShowCross && (crossLogo = osdParam.getCrossLogo()) != null) {
canvas.drawBitmap(crossLogo, ((width - crossLogo.getWidth()) / 2) + dx, ((height - crossLogo.getHeight()) / 2) + dy, (Paint) null);
if (this.isTempStable_) {
str = String.format("%.1f℃", Float.valueOf(param.centerTemp * 0.001f));
} else {
str = String.format("~%.1f℃", Float.valueOf(param.centerTemp * 0.001f));
}
paint.getTextBounds(str, 0, str.length(), rect);
int offset = crossLogo.getWidth() / 6;
canvas.drawText(str, (width / 2) + dx + offset, (height / 2) + dy + rect.height() + offset, paint);
}
if (magParameter.isLaserOn && (laserLogo = osdParam.getLaserLogo()) != null) {
int laserPos = magParameter.basePara2.laserPos;
int x = laserPos & 255;
int y = laserPos >> 16;
switch (magParameter.imageEX) {
case 1:
x = ((x - (this.fpaWidth_ / 2)) * 2) + (this.fpaWidth_ / 2);
y = ((y - (this.fpaHeight_ / 2)) * 2) + (this.fpaHeight_ / 2);
break;
case 2:
x = ((x - (this.fpaWidth_ / 2)) * 4) + (this.fpaWidth_ / 2);
y = ((y - (this.fpaHeight_ / 2)) * 4) + (this.fpaHeight_ / 2);
break;
case 3:
x = ((x - (this.fpaWidth_ / 2)) * 8) + (this.fpaWidth_ / 2);
y = ((y - (this.fpaHeight_ / 2)) * 8) + (this.fpaHeight_ / 2);
break;
case 4:
x = ((x - (this.fpaWidth_ / 2)) * 16) + (this.fpaWidth_ / 2);
y = ((y - (this.fpaHeight_ / 2)) * 16) + (this.fpaHeight_ / 2);
break;
}
int[] screenCoor = DeviceController.sensorXY2ScreenXY(x, y, width, height);
if ((magParameter.imageFlip & 1) != 0) {
screenCoor[0] = (width - 1) - screenCoor[0];
}
if ((magParameter.imageFlip & 2) != 0) {
screenCoor[1] = (height - 1) - screenCoor[1];
}
canvas.drawBitmap(laserLogo, (screenCoor[0] - (laserLogo.getWidth() / 2)) + dx, (screenCoor[1] - (laserLogo.getHeight() / 2)) + dy, (Paint) null);
}
if (magParameter.maxMinTrace != -1 && magParameter.isTraceMaxMin && param.state != null) {
drawMaxMin(canvas, paint, param.state, rect, dx, dy, width, height, osdParam);
}
if (magParameter.isTraceRoi) {
drawROIs(canvas, paint, paintROI, rect, dx, dy, width, height, osdParam);
}
Bitmap waterMark = osdParam.getWaterMark();
if (waterMark != null) {
canvas.drawBitmap(waterMark, ((dx + width) - waterMark.getWidth()) - 8, dy + 8, (Paint) null);
}
if (MagApplication.isShowFps && this.frameIndex_ > 20) {
drawFps(canvas, paint, dx, dy, width, height, UsbCommunication.getReceivedFps(), getShowFps());
}
}
private class ThreadRecording extends Thread {
private ThreadRecording() {
}
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
Logging.trace("Enter ThreadRecording.");
OSDParam osdParam = new OSDParam();
osdParam.setCrossLogo(R.mipmap.cross_capture);
osdParam.setWaterMark(R.mipmap.water_mark);
osdParam.setMinTrace(R.mipmap.min_trace_capture);
osdParam.setMaxTrace(R.mipmap.max_trace_capture);
while (!ImageViewer.this.isExitThreadRecording_) {
synchronized (ImageViewer.this.condRecording_.cond) {
while (!ImageViewer.this.condRecording_.notified) {
try {
ImageViewer.this.condRecording_.cond.wait();
} catch (InterruptedException e) {
}
}
ImageViewer.this.condRecording_.notified = false;
}
if (ImageViewer.this.isExitThreadRecording_) {
break;
} else if (DeviceController.isRecording()) {
ImageViewer.this.drawImage(ImageViewer.this.cachedCanvas_, ImageViewer.this.paintVGA_, ImageViewer.this.paintROIVGA_, ImageViewer.this.matrixVGA_, 0, 0, ImageViewer.this.cachedbmp_.getWidth(), ImageViewer.this.cachedbmp_.getHeight(), osdParam);
DeviceController.doRecording(ImageViewer.this.cachedbmp_);
}
}
osdParam.reset();
Logging.trace("Leave ThreadRecording.");
}
}
private class ThreadRender extends Thread {
private ThreadRender() {
}
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
Logging.trace("Enter ThreadRender.");
OSDParam osdParam = new OSDParam();
osdParam.setCrossLogo(R.mipmap.cross);
osdParam.setMinTrace(R.mipmap.min_trace);
osdParam.setMaxTrace(R.mipmap.max_trace);
osdParam.setLaserLogo(R.mipmap.laser);
osdParam.setMovingCrossLogo(R.mipmap.moving_cross);
int frameIndex = -1;
long t1 = 0;
while (!ImageViewer.this.isExitThreadRender_) {
synchronized (ImageViewer.this.waitCondition_.cond) {
while (!ImageViewer.this.waitCondition_.notified) {
try {
ImageViewer.this.waitCondition_.cond.wait();
} catch (InterruptedException e) {
}
}
ImageViewer.this.waitCondition_.notified = false;
}
if (ImageViewer.this.isExitThreadRender_) {
break;
}
if (DeviceController.isOutputDataReady()) {
ImageViewer.this.doDraw(osdParam);
if (MagApplication.isShowFps) {
if (t1 == 0) {
t1 = System.currentTimeMillis();
} else {
long t = System.currentTimeMillis();
ImageViewer.lock_.lock();
ImageViewer.ticks_[frameIndex % ImageViewer.ticks_.length] = t - t1;
ImageViewer.lock_.unlock();
t1 = t;
}
}
frameIndex++;
} else {
Logging.trace("draw not ready.");
}
}
osdParam.reset();
Logging.trace("Leave ThreadRender.");
}
}
private static int getShowFps() {
long[] ticks = new long[ticks_.length];
lock_.lock();
System.arraycopy(ticks_, 0, ticks, 0, ticks_.length);
lock_.unlock();
int sum = 0;
for (int i = ticks.length - 1; i != -1; i--) {
sum = (int) (sum + ticks[i]);
}
return (ticks_.length * 1000) / sum;
}
}
@@ -0,0 +1,132 @@
package cn.com.magnity.magnitycx;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.RelativeLayout;
import cn.com.magnity.magnitycx.sdk.MagParameter;
import cn.com.magnity.magnitycx.sdk.SharedPreferencesManager;
import cn.com.magnity.magnitycx.sdk.VisibleCamera;
/* loaded from: classes.dex */
public class ImageViewerVisible extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder holder_;
private int leftMargin_;
private int mouseDownX_;
private int mouseDownY_;
private int topMargin_;
public ImageViewerVisible(Context context, AttributeSet attrs) {
super(context, attrs);
this.holder_ = null;
this.holder_ = getHolder();
this.holder_.addCallback(this);
this.holder_.setFormat(-2);
this.holder_.setType(3);
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceCreated(SurfaceHolder holder) {
int width;
int height;
this.leftMargin_ = MagApplication.magParameter.visWndLeftMargin;
this.topMargin_ = MagApplication.magParameter.visWndTopMargin;
switch (MagApplication.magParameter.visWndSize) {
case 0:
width = ((MagApplication.magParameter.portraitScreenWidth / 4) / 12) * 12;
break;
case 1:
width = ((MagApplication.magParameter.portraitScreenWidth / 3) / 12) * 12;
break;
case 2:
width = ((MagApplication.magParameter.portraitScreenWidth / 2) / 12) * 12;
break;
default:
width = ((MagApplication.magParameter.portraitScreenWidth / 4) / 12) * 12;
break;
}
if (getResources().getConfiguration().orientation == 2) {
height = width;
width = (height * 4) / 3;
VisibleCamera.initCamera(MagApplication.magParameter.visCameraId, this.holder_, height);
} else {
height = (width * 4) / 3;
VisibleCamera.initCamera(MagApplication.magParameter.visCameraId, this.holder_, width);
}
Point outSize = new Point();
MagApplication.windowManager.getDefaultDisplay().getSize(outSize);
RelativeLayout layout = (RelativeLayout) getParent();
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) getLayoutParams();
lp.width = width;
lp.height = height;
if (this.leftMargin_ < 0 || this.leftMargin_ > outSize.x - lp.width) {
this.leftMargin_ = outSize.x - lp.width;
}
if (this.topMargin_ < 0) {
this.topMargin_ = 0;
} else if (this.topMargin_ > layout.getHeight() - lp.height) {
this.topMargin_ = layout.getHeight() - lp.height;
}
lp.leftMargin = this.leftMargin_;
lp.topMargin = this.topMargin_;
setLayoutParams(lp);
Canvas canvas = this.holder_.lockCanvas();
if (canvas != null) {
Paint pint = new Paint();
pint.setColor(getResources().getColor(R.color.black));
canvas.drawRect(0.0f, 0.0f, lp.width, lp.height, pint);
this.holder_.unlockCanvasAndPost(canvas);
}
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceDestroyed(SurfaceHolder holder) {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) getLayoutParams();
MagApplication.magParameter.visWndLeftMargin = params.leftMargin;
MagApplication.magParameter.visWndTopMargin = params.topMargin;
SharedPreferencesManager.putInt(MagParameter.KEY_VISWNDLEFTMARGIN, params.leftMargin);
SharedPreferencesManager.putInt(MagParameter.KEY_VISWNDTOPMARGIN, params.topMargin);
SharedPreferencesManager.commit();
VisibleCamera.deinitCamera();
}
@Override // android.view.View
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case 0:
this.mouseDownX_ = (int) event.getRawX();
this.mouseDownY_ = (int) event.getRawY();
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) getLayoutParams();
this.leftMargin_ = params.leftMargin;
this.topMargin_ = params.topMargin;
break;
case 2:
RelativeLayout.LayoutParams params2 = (RelativeLayout.LayoutParams) getLayoutParams();
params2.leftMargin = (this.leftMargin_ + ((int) event.getRawX())) - this.mouseDownX_;
params2.topMargin = (this.topMargin_ + ((int) event.getRawY())) - this.mouseDownY_;
RelativeLayout layout = (RelativeLayout) getParent();
if (params2.leftMargin < 0) {
params2.leftMargin = 0;
} else if (params2.leftMargin > layout.getWidth() - params2.width) {
params2.leftMargin = layout.getWidth() - params2.width;
}
if (params2.topMargin < 0) {
params2.topMargin = 0;
} else if (params2.topMargin > layout.getHeight() - params2.height) {
params2.topMargin = layout.getHeight() - params2.height;
}
setLayoutParams(params2);
break;
}
return true;
}
}
@@ -0,0 +1,113 @@
package cn.com.magnity.magnitycx;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import cn.com.magnity.magnitycx.sdk.GlobalFunc;
import cn.com.magnity.magnitycx.sdk.MagParameter;
import cn.com.magnity.magnitycx.sdk.UsbConnection;
/* loaded from: classes.dex */
public class MagApplication extends Application {
public static GlobalFunc globalFunc;
private static MagApplication instance_;
public static MagParameter magParameter;
public static WindowManager windowManager;
private int counter_;
private Handler handler_ = new Handler();
private Runnable runnable_ = new Runnable() { // from class: cn.com.magnity.magnitycx.MagApplication.1
@Override // java.lang.Runnable
public void run() {
UsbConnection.getInstance().deinit(true);
UsbConnection.getInstance().setCallbackReceiver(null);
}
};
private static boolean handlerProhibited_ = false;
public static boolean isShowFps = false;
static /* synthetic */ int access$008(MagApplication x0) {
int i = x0.counter_;
x0.counter_ = i + 1;
return i;
}
static /* synthetic */ int access$010(MagApplication x0) {
int i = x0.counter_;
x0.counter_ = i - 1;
return i;
}
public static void setUsbDeinitAllowed(boolean flag) {
handlerProhibited_ = !flag;
}
public static MagApplication getInstance() {
return instance_;
}
@Override // android.app.Application
public void onCreate() {
super.onCreate();
instance_ = this;
magParameter = new MagParameter(this);
globalFunc = new GlobalFunc();
windowManager = (WindowManager) getSystemService("window");
DisplayMetrics metric = new DisplayMetrics();
try {
windowManager.getDefaultDisplay().getMetrics(metric);
} catch (Exception e) {
int i = 0 + 1;
}
switch (getResources().getConfiguration().orientation) {
case 1:
magParameter.portraitScreenWidth = metric.widthPixels;
magParameter.portraitScreenHeight = metric.heightPixels;
break;
case 2:
magParameter.portraitScreenWidth = metric.heightPixels;
magParameter.portraitScreenHeight = metric.widthPixels;
break;
}
registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() { // from class: cn.com.magnity.magnitycx.MagApplication.2
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStarted(Activity activity) {
MagApplication.access$008(MagApplication.this);
if (MagApplication.this.counter_ == 1) {
MagApplication.this.handler_.removeCallbacks(MagApplication.this.runnable_);
boolean unused = MagApplication.handlerProhibited_ = false;
}
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityResumed(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityPaused(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStopped(Activity activity) {
MagApplication.access$010(MagApplication.this);
if (MagApplication.this.counter_ == 0 && !MagApplication.handlerProhibited_) {
MagApplication.this.handler_.postDelayed(MagApplication.this.runnable_, 500L);
}
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityDestroyed(Activity activity) {
}
});
}
}
@@ -0,0 +1,307 @@
package cn.com.magnity.magnitycx;
import android.graphics.RectF;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.DisplayMetrics;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.OrientationEventListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import cn.com.magnity.magnitycx.QueryDialogFragment;
import cn.com.magnity.magnitycx.log.Logging;
import cn.com.magnity.magnitycx.sdk.DeviceController;
import cn.com.magnity.magnitycx.sdk.UsbConnection;
import cn.com.magnity.magnitycx.upgrade.UpgradeManager;
import cn.com.magnity.magnitycx.util.ActivityUtils;
import com.baidu.mobstat.StatService;
import org.apache.log4j.Level;
/* loaded from: classes.dex */
public class MainActivity extends AppCompatActivity implements QueryDialogFragment.DelegateQueryResult {
private FragmentMainBottom fragmentBottom_;
private FragmentMainCenter fragmentCenter_;
private FragmentMainTop fragmentTop_;
private GestureDetectorCompat gestureDetector_;
private boolean mIsLoggingInitSucc;
OrientationEventListener orientationListener_;
private UpgradeManager upgradeManager_;
public interface DelegateFling {
void afterFling(int i);
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPostResume() {
super.onPostResume();
StatService.onPageStart(getApplicationContext(), "");
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.support.v4.app.BaseFragmentActivityGingerbread, android.app.Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityUtils.requestRuntimePermission(this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.ACCESS_FINE_LOCATION", "android.permission.CAMERA"}, 0);
this.mIsLoggingInitSucc = Logging.init(Level.INFO);
Logging.info("App start");
Logging.trace("Main activity created");
setContentView(R.layout.activity_main);
disableRotationAnimation();
overridePendingTransition(0, 0);
getWindow().setFormat(-3);
StatService.setDebugOn(false);
this.orientationListener_ = new OrientationEventListener(this, 2) { // from class: cn.com.magnity.magnitycx.MainActivity.1
@Override // android.view.OrientationEventListener
public void onOrientationChanged(int orientation) {
if (orientation != -1) {
int degree = 0;
switch (MagApplication.windowManager.getDefaultDisplay().getRotation()) {
case 0:
degree = 90;
break;
case 1:
degree = 0;
break;
case 2:
degree = 270;
break;
case 3:
degree = 180;
break;
}
if (degree != DeviceController.getPreviewOrientation()) {
DeviceController.Lock();
DeviceController.setPreviewOrientation(degree);
DeviceController.Unlock();
}
}
}
};
if (this.orientationListener_.canDetectOrientation()) {
this.orientationListener_.enable();
} else {
this.orientationListener_.disable();
int degree = 0;
switch (MagApplication.windowManager.getDefaultDisplay().getRotation()) {
case 0:
degree = 90;
break;
case 1:
degree = 0;
break;
case 2:
degree = 270;
break;
case 3:
degree = 180;
break;
}
DeviceController.Lock();
DeviceController.setPreviewOrientation(degree);
DeviceController.Unlock();
}
this.gestureDetector_ = new GestureDetectorCompat(this, new MyGestureListener());
FragmentManager fm = getSupportFragmentManager();
this.fragmentTop_ = (FragmentMainTop) fm.findFragmentById(R.id.fragment_container_main_top);
if (this.fragmentTop_ == null) {
this.fragmentTop_ = new FragmentMainTop();
fm.beginTransaction().setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).add(R.id.fragment_container_main_top, this.fragmentTop_).commit();
}
this.fragmentCenter_ = (FragmentMainCenter) fm.findFragmentById(R.id.fragment_container_main_center);
if (this.fragmentCenter_ == null) {
this.fragmentCenter_ = new FragmentMainCenter();
fm.beginTransaction().setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).add(R.id.fragment_container_main_center, this.fragmentCenter_).commit();
}
this.fragmentBottom_ = (FragmentMainBottom) fm.findFragmentById(R.id.fragment_container_main_bottom);
if (this.fragmentBottom_ == null) {
this.fragmentBottom_ = new FragmentMainBottom();
fm.beginTransaction().setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).add(R.id.fragment_container_main_bottom, this.fragmentBottom_).commit();
}
UsbConnection usbConn = UsbConnection.getInstance();
usbConn.registerObserver(this.fragmentTop_);
usbConn.registerObserver(this.fragmentCenter_);
usbConn.registerObserver(this.fragmentBottom_);
if (savedInstanceState == null) {
this.upgradeManager_ = new UpgradeManager(this);
this.upgradeManager_.start();
}
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onStart() {
super.onStart();
UsbConnection usbConn = UsbConnection.getInstance();
if (usbConn != null) {
usbConn.setCallbackReceiver(this.fragmentCenter_);
if (!usbConn.isConnected()) {
usbConn.init();
} else {
usbConn.notifyObervers(1);
}
}
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onStop() {
super.onStop();
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onResume() {
super.onResume();
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
public void onBackPressed() {
super.onBackPressed();
UsbConnection usbConn = UsbConnection.getInstance();
if (usbConn != null) {
usbConn.setCallbackReceiver(null);
usbConn.deinit(false);
}
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onDestroy() {
Logging.trace("Main activity destroyed");
super.onDestroy();
this.orientationListener_.disable();
UsbConnection usbConn = UsbConnection.getInstance();
usbConn.unregisterAll();
if (this.upgradeManager_ != null) {
this.upgradeManager_.stop();
}
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity, android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
for (int i = 0; i < permissions.length; i++) {
String permission = permissions[i];
int result = grantResults[i];
if (result == 0) {
switch (permission) {
case "android.permission.WRITE_EXTERNAL_STORAGE":
if (this.mIsLoggingInitSucc) {
break;
} else {
this.mIsLoggingInitSucc = Logging.init(Level.INFO);
if (this.mIsLoggingInitSucc) {
Logging.info("App start");
break;
} else {
break;
}
}
}
}
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
private void disableRotationAnimation() {
Window localWindow = getWindow();
WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes();
localLayoutParams.rotationAnimation = 2;
localWindow.setAttributes(localLayoutParams);
}
@Override // cn.com.magnity.magnitycx.QueryDialogFragment.DelegateQueryResult
public void onQueryResult(int result) {
if (result == 1) {
this.fragmentTop_.openLaser();
}
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPause() {
super.onPause();
StatService.onPageEnd(getApplicationContext(), "ҳ");
}
@Override // android.app.Activity, android.view.Window.Callback
public boolean dispatchTouchEvent(MotionEvent ev) {
if (this.gestureDetector_ != null && !MagApplication.magParameter.isTraceRoi) {
this.gestureDetector_.onTouchEvent(ev);
}
return super.dispatchTouchEvent(ev);
}
public FragmentMainTop getFragmentMainTop() {
return this.fragmentTop_;
}
public FragmentMainCenter getFragmentMainCenter() {
return this.fragmentCenter_;
}
public FragmentMainBottom getFragmentMainBottom() {
return this.fragmentBottom_;
}
public RectF getRect(int index) {
RectF rt = new RectF();
LinearLayout layout = null;
switch (index) {
case 0:
layout = (LinearLayout) findViewById(R.id.fragment_container_main_top);
break;
case 1:
layout = (LinearLayout) findViewById(R.id.fragment_container_main_center);
break;
case 2:
layout = (LinearLayout) findViewById(R.id.fragment_container_main_bottom);
break;
}
rt.left = layout.getX();
rt.top = layout.getY();
rt.right = rt.left + layout.getWidth();
rt.bottom = rt.top + layout.getHeight();
return rt;
}
private class MyGestureListener extends GestureDetector.SimpleOnGestureListener {
private MyGestureListener() {
}
@Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnDoubleTapListener
public boolean onDoubleTap(MotionEvent e) {
DeviceController.Lock();
DeviceController.triggerFFC();
DeviceController.Unlock();
return super.onDoubleTap(e);
}
@Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnGestureListener
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
DisplayMetrics outMetrics = new DisplayMetrics();
MainActivity.this.getWindow().getWindowManager().getDefaultDisplay().getMetrics(outMetrics);
int resw = outMetrics.widthPixels;
int resh = outMetrics.heightPixels;
if (resw >= resh) {
resw = resh;
}
int cmp = resw / 4;
if (MainActivity.this.getResources().getConfiguration().orientation == 1) {
float dist = e2.getX() - e1.getX();
if (dist > cmp) {
MainActivity.this.fragmentBottom_.afterFling(0);
} else if (dist < (-cmp)) {
MainActivity.this.fragmentBottom_.afterFling(1);
}
} else {
float dist2 = e2.getY() - e1.getY();
if (dist2 > cmp) {
MainActivity.this.fragmentBottom_.afterFling(1);
} else if (dist2 < cmp) {
MainActivity.this.fragmentBottom_.afterFling(0);
}
}
return true;
}
}
}
@@ -0,0 +1,102 @@
package cn.com.magnity.magnitycx;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import cn.com.magnity.magnitycx.QueryDialogFragment;
import cn.com.magnity.magnitycx.sdk.DelegateMediaStatusChanged;
import com.baidu.mobstat.StatService;
/* loaded from: classes.dex */
public class MediaActivity extends AppCompatActivity implements QueryDialogFragment.DelegateQueryResult, DelegateMediaStatusChanged {
private Fragment fragment_;
public interface DelegateBackPressed {
boolean onActivityBackPressed();
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.support.v4.app.BaseFragmentActivityGingerbread, android.app.Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_media);
cancelDefaultAnimation();
ActionBar actionBar = getSupportActionBar();
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
FragmentManager fm = getSupportFragmentManager();
this.fragment_ = fm.findFragmentById(R.id.id_space_fragment_media);
if (this.fragment_ == null) {
this.fragment_ = new FragmentMedia();
getSupportFragmentManager().beginTransaction().add(R.id.id_space_fragment_media, this.fragment_).commit();
}
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPause() {
cancelDefaultAnimation();
StatService.onPageEnd(getApplicationContext(), "媒体页面");
super.onPause();
}
private void cancelDefaultAnimation() {
TypedArray activityStyle = getTheme().obtainStyledAttributes(new int[]{android.R.attr.windowAnimationStyle});
int windowAnimationStyleResId = activityStyle.getResourceId(0, 0);
activityStyle.recycle();
TypedArray activityStyle2 = getTheme().obtainStyledAttributes(windowAnimationStyleResId, new int[]{android.R.attr.activityCloseEnterAnimation, android.R.attr.activityCloseExitAnimation});
int activityCloseEnterAnimation = activityStyle2.getResourceId(0, 0);
int activityCloseExitAnimation = activityStyle2.getResourceId(1, 0);
activityStyle2.recycle();
overridePendingTransition(activityCloseEnterAnimation, activityCloseExitAnimation);
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPostResume() {
super.onPostResume();
StatService.onPageStart(getApplicationContext(), "媒体页面");
}
@Override // cn.com.magnity.magnitycx.QueryDialogFragment.DelegateQueryResult
public void onQueryResult(int result) {
if (this.fragment_ instanceof QueryDialogFragment.DelegateQueryResult) {
((QueryDialogFragment.DelegateQueryResult) this.fragment_).onQueryResult(result);
}
}
@Override // cn.com.magnity.magnitycx.sdk.DelegateMediaStatusChanged
public void onSelChanged(int newSelCount, int count) {
setTitle(String.format(getResources().getString(R.string.mediaSelectedNum), Integer.valueOf(newSelCount)));
}
@Override // cn.com.magnity.magnitycx.sdk.DelegateMediaStatusChanged
public void onModeChanged(int oldMode, int newMode, int count) {
if (newMode == 0) {
getSupportActionBar().setHomeAsUpIndicator((Drawable) null);
setTitle(String.format(getResources().getString(R.string.mediaTitle), Integer.valueOf(count)));
} else if (newMode == 1) {
getSupportActionBar().setHomeAsUpIndicator(R.mipmap.media_cancel_sel_mode);
setTitle(String.format(getResources().getString(R.string.mediaSelectedNum), 1));
}
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
public void onBackPressed() {
if (!(this.fragment_ instanceof DelegateBackPressed) || ((DelegateBackPressed) this.fragment_).onActivityBackPressed()) {
super.onBackPressed();
}
}
@Override // android.app.Activity
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
break;
}
return super.onOptionsItemSelected(item);
}
}
@@ -0,0 +1,181 @@
package cn.com.magnity.magnitycx;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import cn.com.magnity.magnitycx.sdk.BitmapUtilities;
import cn.com.magnity.magnitycx.sdk.GlobalFunc;
import cn.com.magnity.magnitycx.sdk.LruCacheManager;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/* loaded from: classes.dex */
public class MediaGridViewAdapter extends BaseAdapter {
private static final int SAMPLESIZE = 2;
private Context context_;
private ArrayList<String> fileNames_;
private WeakReference<GridView> gridView_;
private LayoutInflater layoutInflater_;
private Map mapSelStatus_;
private int mode_;
private LruCacheManager lruCacheManager_ = LruCacheManager.getInstance();
private Map mapTask_ = new HashMap();
public MediaGridViewAdapter(Context context, GridView gridView, ArrayList<String> fileNames, Map mapSelStatus) {
this.layoutInflater_ = LayoutInflater.from(context);
this.context_ = context;
this.gridView_ = new WeakReference<>(gridView);
this.fileNames_ = fileNames;
this.mapSelStatus_ = mapSelStatus;
}
@Override // android.widget.Adapter
public int getCount() {
return this.fileNames_.size();
}
@Override // android.widget.Adapter
public Object getItem(int position) {
return this.fileNames_.get(position);
}
@Override // android.widget.Adapter
public long getItemId(int position) {
return this.fileNames_.get(position).hashCode();
}
public void setMode(int mode) {
this.mode_ = mode;
}
@Override // android.widget.Adapter
public View getView(int position, View convertView, ViewGroup parent) {
View rootView;
if (convertView == null) {
rootView = this.layoutInflater_.inflate(R.layout.item_gridview, (ViewGroup) null);
} else {
rootView = convertView;
}
String name = this.fileNames_.get(position);
ImageView imgView = (ImageView) rootView.findViewById(R.id.id_wallphoto);
imgView.setTag(name);
ImageView logoView = (ImageView) rootView.findViewById(R.id.id_photo_video);
loadCachedBitmapIfExist(imgView, logoView, name);
ImageView viewSelLogo = (ImageView) rootView.findViewById(R.id.id_photo_selected);
if (this.mode_ == 1) {
Object obj = this.mapSelStatus_.get(name);
if (obj == null || !((Boolean) obj).booleanValue()) {
viewSelLogo.setImageResource(R.mipmap.media_unselected);
imgView.setAlpha(1.0f);
} else {
viewSelLogo.setImageResource(R.mipmap.media_selected);
imgView.setAlpha(0.6f);
}
viewSelLogo.setVisibility(0);
} else {
viewSelLogo.setVisibility(4);
imgView.setAlpha(1.0f);
}
return rootView;
}
public void loadBitmap(int firstVisiblePos, int visibleCount) {
GridView gridView = this.gridView_.get();
if (gridView != null) {
Iterator iter = this.mapTask_.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
int pos = this.fileNames_.indexOf((String) entry.getKey());
if (pos < firstVisiblePos) {
iter.remove();
}
}
for (int i = firstVisiblePos; i < firstVisiblePos + visibleCount; i++) {
String name = this.fileNames_.get(i);
Bitmap bitmap = this.lruCacheManager_.get(name);
if (bitmap != null) {
ImageView imageView = (ImageView) gridView.findViewWithTag(name);
if (imageView != null && bitmap != null) {
imageView.setImageBitmap(bitmap);
}
} else if (((AsyncLoadImageTask) this.mapTask_.get(name)) == null) {
int size = gridView.getColumnWidth();
AsyncLoadImageTask task = new AsyncLoadImageTask(size, size);
this.mapTask_.put(name, task);
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, name);
}
}
}
}
private void loadCachedBitmapIfExist(ImageView imgView, ImageView logoView, String name) {
Bitmap bitmap = this.lruCacheManager_.get(name);
if (bitmap != null) {
imgView.setImageBitmap(bitmap);
} else {
imgView.setImageResource(R.mipmap.empty_photo);
}
GlobalFunc globalFunc = MagApplication.globalFunc;
if (GlobalFunc.guessMediaTypeBySuffix(name) == 1) {
logoView.setVisibility(0);
} else {
logoView.setVisibility(4);
}
}
public void cancelAllTasks() {
for (Map.Entry entry : this.mapTask_.entrySet()) {
AsyncLoadImageTask task = (AsyncLoadImageTask) entry.getValue();
if (task != null) {
task.cancel(false);
}
}
this.mapTask_.clear();
}
private class AsyncLoadImageTask extends AsyncTask<String, Void, Bitmap> {
private int height_;
private String name_;
private int width_;
public AsyncLoadImageTask(int width, int height) {
this.width_ = width;
this.height_ = height;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.os.AsyncTask
public Bitmap doInBackground(String... params) {
this.name_ = params[0];
Bitmap bitmap = BitmapUtilities.getBitmapThumbnail(MagApplication.magParameter.mediaDir + File.separator + this.name_, this.width_, this.height_);
if (bitmap != null) {
MediaGridViewAdapter.this.lruCacheManager_.put(this.name_, bitmap);
}
return bitmap;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.os.AsyncTask
public void onPostExecute(Bitmap bitmap) {
ImageView imageView;
super.onPostExecute((AsyncLoadImageTask) bitmap);
if (!isCancelled()) {
GridView gridView = (GridView) MediaGridViewAdapter.this.gridView_.get();
if (gridView != null && (imageView = (ImageView) gridView.findViewWithTag(this.name_)) != null && bitmap != null) {
imageView.setImageBitmap(bitmap);
}
MediaGridViewAdapter.this.mapTask_.remove(this.name_);
}
}
}
}
@@ -0,0 +1,18 @@
package cn.com.magnity.magnitycx;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
/* loaded from: classes.dex */
public class MediaImageView extends ImageView {
public MediaImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override // android.widget.ImageView, android.view.View
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
setMeasuredDimension(widthMeasureSpec, widthMeasureSpec);
}
}
@@ -0,0 +1,445 @@
package cn.com.magnity.magnitycx;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.media.ExifInterface;
import android.media.MediaMetadataRetriever;
import android.media.ThumbnailUtils;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.content.FileProvider;
import android.support.v4.media.session.PlaybackStateCompat;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
import cn.com.magnity.magnitycx.QueryDialogFragment;
import cn.com.magnity.magnitycx.sdk.BitmapUtilities;
import cn.com.magnity.magnitycx.sdk.GlobalFunc;
import com.baidu.mobstat.StatService;
import java.io.File;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
/* loaded from: classes.dex */
public class MediaSingleActivity extends AppCompatActivity implements QueryDialogFragment.DelegateQueryResult {
public static final String MEDIAINDEX = "mediaIndex";
public static final String MEDIANAMELIST = "mediaNameList";
public static final String MEDIAWINDOWFLAG = "mediaWindowFlag";
private Button btnDel_;
private Button btnInfo_;
private Button btnShare_;
private int currentIndex_;
private ArrayList<String> fileNames_;
private boolean isVideo_;
private MagClickListener magClickListener_;
private int mediaWindowFlag_;
private ViewPager viewPager_;
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.support.v4.app.BaseFragmentActivityGingerbread, android.app.Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_media_single);
if (savedInstanceState != null) {
this.mediaWindowFlag_ = savedInstanceState.getInt(MEDIAWINDOWFLAG);
this.currentIndex_ = savedInstanceState.getInt(MEDIAINDEX);
this.fileNames_ = savedInstanceState.getStringArrayList(MEDIANAMELIST);
} else {
Intent intent = getIntent();
if (intent != null) {
this.mediaWindowFlag_ = intent.getIntExtra(MEDIAWINDOWFLAG, 0);
this.currentIndex_ = intent.getIntExtra(MEDIAINDEX, 0);
this.fileNames_ = intent.getStringArrayListExtra(MEDIANAMELIST);
} else {
this.mediaWindowFlag_ = 0;
this.currentIndex_ = 0;
this.fileNames_ = new ArrayList<>();
GlobalFunc globalFunc = MagApplication.globalFunc;
GlobalFunc.updateFileList(this.fileNames_);
}
}
setTitle(getResources().getString(R.string.mediaHouse) + " " + Integer.toString(this.currentIndex_ + 1) + "/" + this.fileNames_.size());
this.btnShare_ = (Button) findViewById(R.id.id_btn_social_share);
this.btnInfo_ = (Button) findViewById(R.id.id_btn_meida_info);
this.btnDel_ = (Button) findViewById(R.id.id_btn_media_delete);
this.viewPager_ = (ViewPager) findViewById(R.id.id_media_viewpager);
this.viewPager_.setAdapter(new MediaPageAdapter());
this.viewPager_.addOnPageChangeListener(new MediaPageListener());
this.viewPager_.setPageMargin(30);
this.viewPager_.setCurrentItem(this.currentIndex_);
this.viewPager_.setPageTransformer(true, new DepthPageTransformer());
if (this.currentIndex_ < this.fileNames_.size()) {
GlobalFunc globalFunc2 = MagApplication.globalFunc;
this.isVideo_ = GlobalFunc.guessMediaTypeBySuffix(this.fileNames_.get(this.currentIndex_)) == 1;
}
this.magClickListener_ = new MagClickListener();
this.btnShare_.setOnClickListener(this.magClickListener_);
this.btnInfo_.setOnClickListener(this.magClickListener_);
this.btnDel_.setOnClickListener(this.magClickListener_);
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPause() {
super.onPause();
StatService.onPageEnd(getApplicationContext(), "单个媒体页面");
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onResume() {
super.onResume();
showInfoWhenFileNotExist();
StatService.onPageStart(getApplicationContext(), "单个媒体页面");
}
/* JADX INFO: Access modifiers changed from: private */
public void showInfoWhenFileNotExist() {
File file = new File(MagApplication.magParameter.mediaDir + File.separator + this.fileNames_.get(this.currentIndex_));
if (file != null && !file.exists()) {
Toast.makeText(getApplicationContext(), R.string.fileDeleted, 0).show();
}
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(MEDIAWINDOWFLAG, this.mediaWindowFlag_);
outState.putInt(MEDIAINDEX, this.currentIndex_);
outState.putStringArrayList(MEDIANAMELIST, this.fileNames_);
}
@Override // android.app.Activity
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.meida_single_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override // android.app.Activity
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.id_action_media_expand /* 2131624225 */:
if (this.mediaWindowFlag_ == 1) {
super.onBackPressed();
break;
} else {
finish();
Intent intent = new Intent(this, (Class<?>) MediaActivity.class);
startActivity(intent);
break;
}
}
return super.onOptionsItemSelected(item);
}
/* JADX INFO: Access modifiers changed from: private */
public Bitmap decodeBitmap(String pathName) {
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.outWidth = 0;
opts.outHeight = 0;
opts.inJustDecodeBounds = true;
BitmapFactory.decodeFile(pathName, opts);
Point outSize = new Point();
MagApplication.windowManager.getDefaultDisplay().getSize(outSize);
int r1 = ((opts.outWidth - 1) / outSize.x) + 1;
int r2 = ((opts.outHeight - 1) / outSize.y) + 1;
opts.inSampleSize = Math.max(Math.max(r1, r2), 1);
opts.inJustDecodeBounds = false;
Bitmap bitmap = BitmapFactory.decodeFile(pathName, opts);
if (bitmap == null) {
return ThumbnailUtils.createVideoThumbnail(pathName, 1);
}
return bitmap;
}
private File getMediaStoragePath(Context context) {
File file;
String state = Environment.getExternalStorageState();
if ("mounted".equals(state) && (file = new File(Environment.getExternalStorageDirectory(), "magnity/Cx/media")) != null) {
if (!file.exists()) {
file.mkdirs();
return file;
}
return file;
}
return null;
}
/* JADX INFO: Access modifiers changed from: private */
public void socialShare() {
Uri uri;
File f = new File(getMediaStoragePath(this), this.fileNames_.get(this.currentIndex_));
if (f != null && f.isFile() && (uri = FileProvider.getUriForFile(this, "cn.com.magnity.magnitycx.fileprovider", f)) != null) {
Intent intent = new Intent("android.intent.action.SEND");
intent.setType(this.isVideo_ ? "video/*" : "image/*");
intent.putExtra("android.intent.extra.STREAM", uri);
intent.addFlags(1);
startActivity(Intent.createChooser(intent, getResources().getString(R.string.mediaSocialShare)));
}
}
ArrayList<String> getMediaInfos() {
File f;
Point pt;
ArrayList<String> infos = new ArrayList<>();
String time = null;
String size = null;
String reso = null;
String duration = null;
String name = this.fileNames_.get(this.currentIndex_);
String pathName = MagApplication.magParameter.mediaDir + File.separator + name;
GlobalFunc globalFunc = MagApplication.globalFunc;
int mediaType = GlobalFunc.guessMediaTypeBySuffix(name);
if (mediaType == 0) {
try {
ExifInterface exifInterface = new ExifInterface(pathName);
time = exifInterface.getAttribute("DateTimeDigitized");
size = null;
reso = null;
} catch (Exception e) {
}
} else if (mediaType == 1) {
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
try {
mmr.setDataSource(pathName);
time = null;
size = null;
String w = mmr.extractMetadata(18);
String h = mmr.extractMetadata(19);
if (w != null && h != null && w != "0" && h != "0") {
reso = w + " x " + h;
}
duration = mmr.extractMetadata(9);
if (duration != null) {
long sec = Integer.parseInt(duration) / 1000;
long hour = sec / 3600;
long min = (sec - (3600 * hour)) / 60;
duration = String.format("%02d:%02d:%02d", Long.valueOf(hour), Long.valueOf(min), Long.valueOf((sec - (3600 * hour)) - (60 * min)));
}
} catch (Exception e2) {
}
} else {
time = null;
size = null;
reso = null;
}
if ((time == null || size == null || reso == null) && (f = new File(pathName)) != null && f.isFile()) {
if (time == null) {
Date dt = new Date(f.lastModified());
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
time = ft.format(dt);
}
if (size == null) {
DecimalFormat df = new DecimalFormat("0.0");
long bytes = f.length();
if (bytes < PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) {
size = df.format(bytes) + "B";
} else if (bytes < 1048576) {
size = df.format(bytes / 1024.0f) + "KB";
} else {
size = df.format(bytes / 1048576.0f) + "MB";
}
}
if (reso == null && (pt = BitmapUtilities.getBitmapSize(pathName)) != null) {
reso = pt.x + " x " + pt.y;
}
}
if (mediaType == 1) {
infos.add("1");
} else {
infos.add("0");
}
infos.add(name);
infos.add(time);
infos.add(size);
infos.add(duration);
infos.add(reso);
infos.add(pathName);
return infos;
}
@Override // cn.com.magnity.magnitycx.QueryDialogFragment.DelegateQueryResult
public void onQueryResult(int result) {
if (result == 1) {
String pathName = MagApplication.magParameter.mediaDir + File.separator + this.fileNames_.get(this.currentIndex_);
File f = new File(pathName);
if (f != null && f.isFile()) {
f.delete();
this.fileNames_.remove(this.currentIndex_);
File f2 = new File(pathName.replace(".jpg", ".ddt"));
if (f2 != null && f2.isFile()) {
f2.delete();
}
if (this.fileNames_.isEmpty()) {
finish();
return;
}
this.viewPager_.setAdapter(new MediaPageAdapter());
if (this.currentIndex_ > this.fileNames_.size() - 1) {
this.viewPager_.setCurrentItem(this.currentIndex_ - 1);
} else {
this.viewPager_.setCurrentItem(this.currentIndex_);
}
showInfoWhenFileNotExist();
setTitle(getResources().getString(R.string.mediaHouse) + " " + Integer.toString(this.currentIndex_ + 1) + "/" + this.fileNames_.size());
}
}
}
private class MagClickListener implements View.OnClickListener {
private MagClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
switch (v.getId()) {
case R.id.id_btn_social_share /* 2131624072 */:
MediaSingleActivity.this.socialShare();
break;
case R.id.id_btn_meida_info /* 2131624073 */:
DialogFragmentMediaInfo dlgMediaInfo = DialogFragmentMediaInfo.newInstance(MediaSingleActivity.this.getMediaInfos());
dlgMediaInfo.show(MediaSingleActivity.this.getSupportFragmentManager(), "dialogFragmentMediaInfo");
break;
case R.id.id_btn_media_delete /* 2131624074 */:
QueryDialogFragment dlgMediaDel = QueryDialogFragment.newInstance(R.layout.dialog_fragment_query_delete_media);
dlgMediaDel.show(MediaSingleActivity.this.getSupportFragmentManager(), "deleteMedia");
break;
case R.id.id_img_single /* 2131624185 */:
if (MediaSingleActivity.this.isVideo_) {
Intent intent = new Intent("android.intent.action.VIEW");
String pathName = MagApplication.magParameter.mediaDir + File.separator + ((String) MediaSingleActivity.this.fileNames_.get(MediaSingleActivity.this.currentIndex_));
intent.setDataAndType(Uri.parse("file:///" + pathName), "video/*");
MagApplication.setUsbDeinitAllowed(false);
if (intent.resolveActivity(MediaSingleActivity.this.getPackageManager()) != null) {
MediaSingleActivity.this.startActivity(intent);
break;
}
}
break;
}
}
}
private class MediaPageAdapter extends PagerAdapter {
private MediaPageAdapter() {
}
@Override // android.support.v4.view.PagerAdapter
public int getCount() {
return MediaSingleActivity.this.fileNames_.size();
}
@Override // android.support.v4.view.PagerAdapter
public boolean isViewFromObject(View view, Object object) {
return view == object;
}
private void releaseImageViewResouce(ImageView imageView) {
Drawable drawable;
if (imageView != null && (drawable = imageView.getDrawable()) != null && (drawable instanceof BitmapDrawable)) {
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
Bitmap bitmap = bitmapDrawable.getBitmap();
if (bitmap != null && !bitmap.isRecycled()) {
bitmap.recycle();
}
}
}
@Override // android.support.v4.view.PagerAdapter
public void destroyItem(ViewGroup container, int position, Object object) {
View view = (View) object;
if (view != null) {
releaseImageViewResouce((ImageView) view.findViewById(R.id.id_img_single));
container.removeView(view);
}
}
@Override // android.support.v4.view.PagerAdapter
public Object instantiateItem(ViewGroup container, int position) {
View view = MediaSingleActivity.this.getLayoutInflater().inflate(R.layout.include_media_single, (ViewGroup) null);
String name = (String) MediaSingleActivity.this.fileNames_.get(position);
ImageView img = (ImageView) view.findViewById(R.id.id_img_single);
img.setImageBitmap(MediaSingleActivity.this.decodeBitmap(MagApplication.magParameter.mediaDir + File.separator + ((String) MediaSingleActivity.this.fileNames_.get(position))));
ImageView videoLogo = (ImageView) view.findViewById(R.id.id_video_play_logo);
GlobalFunc globalFunc = MagApplication.globalFunc;
int type = GlobalFunc.guessMediaTypeBySuffix(name);
if (type == 1) {
videoLogo.setVisibility(0);
} else {
videoLogo.setVisibility(4);
}
img.setOnClickListener(MediaSingleActivity.this.magClickListener_);
container.addView(view);
return view;
}
}
private class MediaPageListener implements ViewPager.OnPageChangeListener {
private MediaPageListener() {
}
@Override // android.support.v4.view.ViewPager.OnPageChangeListener
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override // android.support.v4.view.ViewPager.OnPageChangeListener
public void onPageSelected(int position) {
MediaSingleActivity.this.currentIndex_ = position;
MediaSingleActivity mediaSingleActivity = MediaSingleActivity.this;
GlobalFunc globalFunc = MagApplication.globalFunc;
mediaSingleActivity.isVideo_ = GlobalFunc.guessMediaTypeBySuffix((String) MediaSingleActivity.this.fileNames_.get(position)) == 1;
MediaSingleActivity.this.setTitle(MediaSingleActivity.this.getResources().getString(R.string.mediaHouse) + " " + Integer.toString(position + 1) + "/" + MediaSingleActivity.this.fileNames_.size());
MediaSingleActivity.this.showInfoWhenFileNotExist();
}
@Override // android.support.v4.view.ViewPager.OnPageChangeListener
public void onPageScrollStateChanged(int state) {
}
}
public class DepthPageTransformer implements ViewPager.PageTransformer {
private static final float MIN_SCALE = 0.75f;
public DepthPageTransformer() {
}
@Override // android.support.v4.view.ViewPager.PageTransformer
public void transformPage(View view, float position) {
int pageWidth = view.getWidth();
if (position < -1.0f) {
view.setAlpha(0.0f);
return;
}
if (position <= 0.0f) {
view.setAlpha(1.0f);
view.setTranslationX(0.0f);
view.setScaleX(1.0f);
view.setScaleY(1.0f);
return;
}
if (position <= 1.0f) {
view.setAlpha(1.0f - position);
view.setTranslationX(pageWidth * (-position));
float scaleFactor = MIN_SCALE + (0.25f * (1.0f - Math.abs(position)));
view.setScaleX(scaleFactor);
view.setScaleY(scaleFactor);
return;
}
view.setAlpha(0.0f);
}
}
}
@@ -0,0 +1,77 @@
package cn.com.magnity.magnitycx;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
/* loaded from: classes.dex */
public class QueryDialogFragment extends DialogFragment {
private static final String RESID = "resid";
private MagOnClickListener magOnClickListener_;
private int resId_;
public interface DelegateQueryResult {
void onQueryResult(int i);
}
public static QueryDialogFragment newInstance(int resId) {
Bundle bundle = new Bundle();
bundle.putInt(RESID, resId);
QueryDialogFragment dlg = new QueryDialogFragment();
dlg.setArguments(bundle);
return dlg;
}
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bundle = getArguments();
if (bundle != null) {
this.resId_ = bundle.getInt(RESID);
}
this.magOnClickListener_ = new MagOnClickListener();
}
@Override // android.support.v4.app.DialogFragment
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(this.resId_, (ViewGroup) null);
Button btnCancel = (Button) view.findViewById(R.id.id_btn_cancel);
Button btnOk = (Button) view.findViewById(R.id.id_btn_ok);
btnCancel.setOnClickListener(this.magOnClickListener_);
btnOk.setOnClickListener(this.magOnClickListener_);
builder.setView(view);
return builder.create();
}
private class MagOnClickListener implements View.OnClickListener {
private MagOnClickListener() {
}
@Override // android.view.View.OnClickListener
public void onClick(View v) {
int result = 0;
switch (v.getId()) {
case R.id.id_btn_ok /* 2131624096 */:
result = 1;
break;
case R.id.id_btn_cancel /* 2131624106 */:
result = 0;
break;
}
if (QueryDialogFragment.this.getActivity() instanceof DelegateQueryResult) {
((DelegateQueryResult) QueryDialogFragment.this.getActivity()).onQueryResult(result);
}
QueryDialogFragment.this.dismiss();
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,127 @@
package cn.com.magnity.magnitycx;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/* loaded from: classes.dex */
public class ROIInfo {
public static final int TYPE_POINT = 0;
public static final int TYPE_RECT = 1;
private static volatile Lock lock = new ReentrantLock();
private int aveTemp_;
private int maxTempPos_;
private int maxTemp_;
private int minTempPos_;
private int minTemp_;
public String name;
private int type_;
private int x0_;
private int x1_;
private int y0_;
private int y1_;
private boolean isFinished_ = false;
private boolean isBigEnouth_ = false;
private boolean isTempValid_ = false;
public ROIInfo(int type) {
this.type_ = type;
}
public void setBeginPoint(int x0, int y0) {
this.x0_ = x0;
this.y0_ = y0;
this.isBigEnouth_ = false;
this.isFinished_ = false;
}
public void translate(int dx, int dy) {
this.x0_ += dx;
this.y0_ += dy;
this.x1_ += dx;
this.y1_ += dy;
}
public void setEndPoint(int x1, int y1) {
this.x1_ = x1;
this.y1_ = y1;
int limit = MagApplication.magParameter.basePara1.fpaWidth / 12;
if (Math.abs(this.x1_ - this.x0_) > limit && Math.abs(this.y1_ - this.y0_) > limit) {
this.isBigEnouth_ = true;
} else {
this.isBigEnouth_ = false;
}
}
public void setTempInfo(int minTemp, int maxTemp, int aveTemp, int minPos, int maxPos) {
this.maxTemp_ = maxTemp;
this.minTemp_ = minTemp;
this.aveTemp_ = aveTemp;
this.maxTempPos_ = maxPos;
this.minTempPos_ = minPos;
this.isTempValid_ = true;
}
public boolean isPointIn(int x, int y) {
return x < this.x1_ && x > this.x0_ && y < this.y1_ && y > this.y0_;
}
public void setFinished() {
this.isFinished_ = true;
}
public int getBeginPointX() {
return this.x0_ > this.x1_ ? this.x1_ : this.x0_;
}
public int getBeginPointY() {
return this.y0_ > this.y1_ ? this.y1_ : this.y0_;
}
public int getEndPointX() {
return this.x0_ > this.x1_ ? this.x0_ : this.x1_;
}
public int getEndPointY() {
return this.y0_ > this.y1_ ? this.y0_ : this.y1_;
}
public int getType() {
return this.type_;
}
public int getMaxTemp() {
return this.maxTemp_;
}
public int getMinTemp() {
return this.minTemp_;
}
public int getMaxPos() {
return this.maxTempPos_;
}
public int getMinPos() {
return this.minTempPos_;
}
public boolean isFinished() {
return this.isFinished_;
}
public boolean isBigEnouth() {
return this.isBigEnouth_;
}
public boolean isTempValid() {
return this.isTempValid_;
}
public static void lock() {
lock.lock();
}
public static void unlock() {
lock.unlock();
}
}
@@ -0,0 +1,52 @@
package cn.com.magnity.magnitycx;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.baidu.mobstat.StatService;
/* loaded from: classes.dex */
public class SettingActivity extends AppCompatActivity {
FragmentSetting fragmentSetting_;
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.support.v4.app.BaseFragmentActivityGingerbread, android.app.Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setting);
ActionBar actionBar = getSupportActionBar();
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
setTitle(R.string.labelSetting);
FragmentManager fm = getSupportFragmentManager();
Fragment fragment = fm.findFragmentById(R.id.id_space_fragment_setting);
if (fragment == null) {
this.fragmentSetting_ = new FragmentSetting();
getSupportFragmentManager().beginTransaction().add(R.id.id_space_fragment_setting, this.fragmentSetting_).commit();
}
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPostResume() {
super.onPostResume();
StatService.onPageStart(getApplicationContext(), "设置主界面");
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPause() {
super.onPause();
StatService.onPageEnd(getApplicationContext(), "设置主界面");
}
@Override // android.app.Activity
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
super.onBackPressed();
break;
}
return super.onOptionsItemSelected(item);
}
}
@@ -0,0 +1,144 @@
package cn.com.magnity.magnitycx;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import com.baidu.mobstat.StatService;
/* loaded from: classes.dex */
public class StoreActivity extends AppCompatActivity {
ViewGroup mLayout;
WebView mWebView;
public static void actionStart(Context ctx, String uri) {
Intent intent = new Intent(ctx, (Class<?>) StoreActivity.class);
intent.putExtra("uri", uri);
ctx.startActivity(intent);
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.support.v4.app.BaseFragmentActivityGingerbread, android.app.Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_store);
this.mLayout = (ViewGroup) findViewById(R.id.id_layout);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(-1, -1);
this.mWebView = new WebView(getApplicationContext());
WebSettings webSettings = this.mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setUseWideViewPort(true);
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setDisplayZoomControls(false);
webSettings.setCacheMode(1);
webSettings.setDomStorageEnabled(true);
webSettings.setAllowFileAccess(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setLoadsImagesAutomatically(true);
webSettings.setDefaultTextEncodingName("utf-8");
this.mWebView.setWebViewClient(new WebViewClient() { // from class: cn.com.magnity.magnitycx.StoreActivity.1
@Override // android.webkit.WebViewClient
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false;
}
@Override // android.webkit.WebViewClient
public void onPageCommitVisible(WebView view, String url) {
StoreActivity.this.setTitle(StoreActivity.this.mWebView.getTitle());
super.onPageCommitVisible(view, url);
}
});
this.mWebView.setLayoutParams(params);
this.mLayout.addView(this.mWebView);
Bundle bundle = getIntent().getExtras();
if (bundle != null) {
this.mWebView.loadUrl(bundle.getString("uri"));
}
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
this.mWebView.saveState(outState);
}
@Override // android.app.Activity
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
this.mWebView.restoreState(savedInstanceState);
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onStart() {
super.onStart();
this.mWebView.getSettings().setJavaScriptEnabled(true);
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onStop() {
this.mWebView.getSettings().setJavaScriptEnabled(false);
super.onStop();
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPause() {
super.onPause();
StatService.onPageEnd(getApplicationContext(), "微商");
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPostResume() {
super.onPostResume();
StatService.onPageStart(getApplicationContext(), "微商");
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onDestroy() {
if (this.mWebView != null) {
this.mWebView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null);
this.mWebView.clearHistory();
this.mLayout.removeView(this.mWebView);
this.mWebView.destroy();
this.mWebView = null;
}
super.onDestroy();
}
@Override // android.app.Activity, android.view.KeyEvent.Callback
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode != 4 || !this.mWebView.canGoBack()) {
return super.onKeyDown(keyCode, event);
}
this.mWebView.getSettings().setCacheMode(3);
this.mWebView.goBack();
return true;
}
@Override // android.app.Activity
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.about_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override // android.app.Activity
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.id_cancel /* 2131624224 */:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
@@ -0,0 +1,56 @@
package cn.com.magnity.magnitycx;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.baidu.mobstat.StatService;
/* loaded from: classes.dex */
public class SupportActivity extends AppCompatActivity {
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.support.v4.app.BaseFragmentActivityGingerbread, android.app.Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_support);
ActionBar actionBar = getSupportActionBar();
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
FragmentManager fm = getSupportFragmentManager();
Fragment fragment = fm.findFragmentById(R.id.id_space_fragment_setting);
if (fragment == null) {
getSupportFragmentManager().beginTransaction().add(R.id.id_space_fragment, new FragmentSupport()).commit();
}
}
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPostResume() {
super.onPostResume();
StatService.onResume(this);
}
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
protected void onPause() {
super.onPause();
StatService.onPause(this);
}
public void showHelp() {
getSupportFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.id_space_fragment, new FragmentSupportHelp()).commit();
}
public void showAbout() {
getSupportFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.id_space_fragment, new FragmentSupportAbout()).commit();
}
@Override // android.app.Activity
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
super.onBackPressed();
break;
}
return super.onOptionsItemSelected(item);
}
}
@@ -0,0 +1,70 @@
package cn.com.magnity.magnitycx.log;
import android.os.Build;
import cn.com.magnity.magnitycx.MagApplication;
import java.io.File;
import java.io.IOException;
import org.apache.log4j.FileAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
/* loaded from: classes.dex */
public class Logging {
private static Logger logger_ = null;
public static void trace(Object msg) {
if (logger_ != null) {
logger_.trace(msg);
}
}
public static void debug(Object msg) {
if (logger_ != null) {
logger_.debug(msg);
}
}
public static void info(Object msg) {
if (logger_ != null) {
logger_.info(msg);
}
}
public static void warn(Object msg) {
if (logger_ != null) {
logger_.warn(msg);
}
}
public static void error(Object msg) {
if (logger_ != null) {
logger_.error(msg);
}
}
public static void fatal(Object msg) {
if (logger_ != null) {
logger_.fatal(msg);
}
}
public static boolean init(Level level) {
if (MagApplication.magParameter.logDir.isEmpty()) {
return false;
}
String pathName = MagApplication.magParameter.logDir + File.separator + (Build.MODEL + "-Android_" + Build.VERSION.RELEASE + "_" + Build.VERSION.SDK_INT) + ".log";
try {
PatternLayout patternLayout = new PatternLayout();
patternLayout.setConversionPattern("%d{yyyy-MM-dd HH:mm:ss} -%-5.5p- %m %n");
FileAppender fileAppender = new FileAppender(patternLayout, pathName);
logger_ = Logger.getLogger(Logging.class);
logger_.addAppender(fileAppender);
logger_.setLevel(level);
return true;
} catch (IOException e) {
logger_ = null;
return false;
}
}
}
@@ -0,0 +1,138 @@
package cn.com.magnity.magnitycx.sdk;
import android.os.Handler;
import android.os.Message;
import java.util.ArrayList;
/* loaded from: classes.dex */
public class AsyncLoadImage {
private static final int MSG = 305419896;
private Handler[] handlers_;
private String imageDir_;
private volatile int maxTaskLen = Integer.MAX_VALUE;
private Object receiver_;
private volatile boolean running_;
private volatile ArrayList<String> taskList;
private volatile ArrayList<String> taskList_;
private ImageLoaderThread[] threads_;
private WaitCondition wcObj_;
public interface DelegateExecute {
Object onBackToDo(Object obj);
void onExecuteFinished(Object obj);
}
public AsyncLoadImage(String imageDir, int threadNum, Object receiver) {
this.receiver_ = receiver;
this.imageDir_ = imageDir;
this.threads_ = new ImageLoaderThread[threadNum];
ImageLoaderThread[] imageLoaderThreadArr = this.threads_;
int length = imageLoaderThreadArr.length;
int i = 0;
int index = 0;
while (i < length) {
ImageLoaderThread imageLoaderThread = imageLoaderThreadArr[i];
ImageLoaderThread thread = new ImageLoaderThread(index);
thread.start();
i++;
index++;
}
this.wcObj_ = new WaitCondition();
this.taskList_ = new ArrayList<>();
for (Handler handler : this.handlers_) {
new Handler() { // from class: cn.com.magnity.magnitycx.sdk.AsyncLoadImage.1
@Override // android.os.Handler
public void handleMessage(Message msg) {
switch (msg.what) {
case AsyncLoadImage.MSG /* 305419896 */:
if (AsyncLoadImage.this.receiver_ instanceof DelegateExecute) {
((DelegateExecute) AsyncLoadImage.this.receiver_).onExecuteFinished(msg.obj);
break;
}
break;
}
super.handleMessage(msg);
}
};
}
}
public void add(String name) {
synchronized (this.wcObj_.cond) {
if (!this.taskList_.contains(name)) {
if (this.taskList_.size() > this.maxTaskLen) {
}
if (!this.taskList_.contains(name)) {
this.taskList_.add(name);
this.wcObj_.notified = true;
this.wcObj_.cond.notify();
}
}
}
}
public void setTaskQueueLen(int len) {
synchronized (this.wcObj_.cond) {
this.maxTaskLen = len;
}
}
public void removeAll() {
synchronized (this.wcObj_.cond) {
this.taskList_.clear();
}
}
public void exit() {
this.running_ = false;
synchronized (this.wcObj_.cond) {
this.wcObj_.notified = true;
this.wcObj_.cond.notifyAll();
}
try {
for (ImageLoaderThread thread : this.threads_) {
thread.join();
}
} catch (InterruptedException e) {
}
}
private class ImageLoaderThread extends Thread {
private int index_;
public ImageLoaderThread(int index) {
this.index_ = index;
}
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
while (AsyncLoadImage.this.running_) {
synchronized (AsyncLoadImage.this.wcObj_.cond) {
while (!AsyncLoadImage.this.wcObj_.notified) {
try {
AsyncLoadImage.this.wcObj_.cond.wait();
} catch (InterruptedException e) {
}
}
AsyncLoadImage.this.wcObj_.notified = false;
if (AsyncLoadImage.this.taskList_.size() > 0) {
String name = (String) AsyncLoadImage.this.taskList_.get(0);
AsyncLoadImage.this.taskList_.remove(0);
if (AsyncLoadImage.this.running_) {
if (AsyncLoadImage.this.receiver_ instanceof DelegateExecute) {
Object object = ((DelegateExecute) AsyncLoadImage.this.receiver_).onBackToDo(name);
Message msg = new Message();
msg.what = AsyncLoadImage.MSG;
msg.obj = object;
AsyncLoadImage.this.handlers_[this.index_].sendMessage(msg);
}
} else {
return;
}
}
}
}
}
}
}
@@ -0,0 +1,46 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public class BasePara1 implements Cloneable {
public int devType;
public int fpaFlip;
public int fpaGain;
public int fpaHeight;
public int fpaWidth;
public int fps;
public int gfid;
public int gsk;
public int hwVersion;
public int interFrame;
public int interLine;
public int reserved1;
public int reserved2;
public int serialNumber;
public int swVersion;
public BasePara1() {
reset();
}
public void reset() {
this.serialNumber = 0;
this.hwVersion = 0;
this.devType = 0;
this.swVersion = 0;
this.reserved1 = 0;
this.fpaWidth = 0;
this.fpaHeight = 0;
this.fps = 0;
this.reserved2 = 0;
this.fpaGain = 0;
this.fpaFlip = 0;
this.interFrame = 0;
this.interLine = 0;
this.gfid = 0;
this.gsk = 0;
}
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
@@ -0,0 +1,46 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public class BasePara2 implements Cloneable {
public float ATErrorSlope;
public int ATZeroErrorPoint;
public int baseLineAcc;
public int denoiseLevel;
public int enlargeRange;
public int ffcTriggerFrame;
public int ffcTriggerTemperature;
public short fpaTempFix;
public int laserPos;
public int reserved1;
public short reserved2;
public int reserved5;
public int reserved6;
public int shutterCloseSpeed;
public int shutterOpenSpeed;
public BasePara2() {
reset();
}
public void reset() {
this.baseLineAcc = 0;
this.denoiseLevel = 0;
this.reserved1 = 0;
this.reserved2 = (short) 0;
this.fpaTempFix = (short) 0;
this.shutterCloseSpeed = 0;
this.shutterOpenSpeed = 0;
this.ffcTriggerFrame = 0;
this.ffcTriggerTemperature = 0;
this.enlargeRange = 0;
this.laserPos = 0;
this.ATZeroErrorPoint = 0;
this.ATErrorSlope = 0.0f;
this.reserved5 = 0;
this.reserved6 = 0;
}
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
@@ -0,0 +1,72 @@
package cn.com.magnity.magnitycx.sdk;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.Point;
import android.media.ThumbnailUtils;
/* loaded from: classes.dex */
public class BitmapUtilities {
public static Bitmap getBitmapThumbnail(String pathName, int width, int height) {
Bitmap bitmap = null;
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inJustDecodeBounds = true;
BitmapFactory.decodeFile(pathName, opts);
if (opts.outWidth > 0 && opts.outHeight > 0) {
float r = Math.max(opts.outHeight / height, opts.outWidth / width);
opts.inSampleSize = (int) (r + 0.5d);
opts.inJustDecodeBounds = false;
bitmap = BitmapFactory.decodeFile(pathName, opts);
}
if (bitmap == null) {
return ThumbnailUtils.createVideoThumbnail(pathName, 1);
}
return bitmap;
}
public static Bitmap getBitmapThumbnail(String pathName, int sampleSize) {
Bitmap bitmap = null;
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inJustDecodeBounds = true;
BitmapFactory.decodeFile(pathName, opts);
if (opts.outWidth > 0 && opts.outHeight > 0) {
opts.inSampleSize = sampleSize;
opts.inJustDecodeBounds = false;
bitmap = BitmapFactory.decodeFile(pathName, opts);
}
if (bitmap == null) {
return ThumbnailUtils.createVideoThumbnail(pathName, 1);
}
return bitmap;
}
public static Point getBitmapSize(String pathName) {
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inJustDecodeBounds = true;
BitmapFactory.decodeFile(pathName, opts);
if (opts.outWidth <= 0 || opts.outHeight <= 0) {
return null;
}
return new Point(opts.outWidth, opts.outHeight);
}
public static Bitmap getBitmapThumbnail(Bitmap bmp, int width, int height) {
Bitmap bitmap;
if (bmp == null) {
return null;
}
int bmpWidth = bmp.getWidth();
int bmpHeight = bmp.getHeight();
if (width > 0 && height > 0) {
Matrix matrix = new Matrix();
float scaleWidth = width / bmpWidth;
float scaleHeight = height / bmpHeight;
matrix.postScale(scaleWidth, scaleHeight);
bitmap = Bitmap.createBitmap(bmp, 0, 0, bmpWidth, bmpHeight, matrix, true);
} else {
bitmap = bmp;
}
return bitmap;
}
}
@@ -0,0 +1,22 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public class CaliInfo implements Cloneable {
public long date;
public int reserved;
public int size;
public CaliInfo() {
reset();
}
public void reset() {
this.size = 0;
this.reserved = 0;
this.date = 0L;
}
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
@@ -0,0 +1,13 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public class D2PCmd {
public static final int D2P_CaliHandledAck = 1538635104;
public static final int D2P_CmdHandledAck = 1538635103;
public static final int D2P_SendCaliFile = 1538635101;
public static final int D2P_SendCaliInfo = 1538635102;
public static final int D2P_SendFPAState = 1538635106;
public static final int D2P_SendLifeTime = 1538635105;
public static final int D2P_SendParameter1 = 1538635099;
public static final int D2P_SendParameter2 = 1538635100;
}
@@ -0,0 +1,8 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public interface DelegateDeviceConnected {
void onDeviceConnected(UsbCommunication usbCommunication);
void onDeviceDisconnected();
}
@@ -0,0 +1,10 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public interface DelegateMedia {
void onCapture();
void onRecordingStart();
void onRecordingStop();
}
@@ -0,0 +1,8 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public interface DelegateMediaStatusChanged {
void onModeChanged(int i, int i2, int i3);
void onSelChanged(int i, int i2);
}
@@ -0,0 +1,6 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public interface DelegateOptionSelected {
void onOptionSelected(int i, int i2);
}
@@ -0,0 +1,93 @@
package cn.com.magnity.magnitycx.sdk;
import android.graphics.Bitmap;
/* loaded from: classes.dex */
public class DeviceController {
public static final int BITSPERPIXEL = 16;
public interface ShutterCallBack {
void setShutterState(int i);
}
public static native void Lock();
public static native void Unlock();
public static native int[] clientPos2ScreenXY(int i, int i2, int i3);
public static native int[] clientXY2ScreenXY(int i, int i2, int i3, int i4);
public static native boolean doRecording(Bitmap bitmap);
public static native int getEX();
public static native void getExtParameter(ExtPara extPara);
public static native boolean getOutputBMPData(Bitmap bitmap, int i);
public static native boolean getOutputColorbarData(Bitmap bitmap, int i);
public static native int getPreviewOrientation();
public static native boolean getRectTemperatureInfo(int i, int i2, int i3, int i4, int[] iArr, boolean z);
public static native State getState();
public static native int getTemperature(int i, int i2, boolean z);
public static native boolean isOutputDataReady();
public static native boolean isProcessImage();
public static native boolean isRecording();
public static native boolean pushFrame(byte[] bArr, int i, int i2);
public static native boolean saveDDT(String str);
public static native int[] screenXY2ClientXY(int i, int i2, int i3, int i4);
public static native int[] screenXY2SensorXY(int i, int i2, int i3, int i4);
public static native int[] sensorXY2ScreenXY(int i, int i2, int i3, int i4);
public static native void setAutoEnlarge(int i);
public static native void setColorPalette(int i);
public static native void setColorbarSize(int i, int i2);
public static native void setEX(int i, int i2, int i3);
public static native void setEmissivity(int i, int i2);
public static native void setExtParameter(ExtPara extPara);
public static native void setPreviewOrientation(int i);
public static native boolean startProcess(ShutterCallBack shutterCallBack, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, String str);
public static native boolean startRecording(String str, int i, int i2, int i3, int i4, int i5);
public static native void stopProcess();
public static native void stopRecording();
public static native void triggerFFC();
static {
System.loadLibrary("avutil-55");
System.loadLibrary("avcodec-57");
System.loadLibrary("swresample-2");
System.loadLibrary("avformat-57");
System.loadLibrary("swscale-4");
System.loadLibrary("postproc-54");
System.loadLibrary("avfilter-6");
System.loadLibrary("avdevice-57");
System.loadLibrary("cxsdk");
System.loadLibrary("cxx2java");
setColorbarSize(100, 20);
setColorPalette(SharedPreferencesManager.getInt("paletteIndex", 2));
}
}
@@ -0,0 +1,12 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public class ExtPara {
public boolean bIsothermal;
public int dwFlip;
public int intAutoEnlargeRange;
public int intBrightOffset;
public int intContrastOffset;
public int intCurrentEnvTemperature;
public int intDetailRatio;
}
@@ -0,0 +1,127 @@
package cn.com.magnity.magnitycx.sdk;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.webkit.MimeTypeMap;
import cn.com.magnity.magnitycx.MagApplication;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
/* loaded from: classes.dex */
public class GlobalFunc {
public static final int MEDIA_IMAGE = 0;
public static final int MEDIA_OTHER = -1;
public static final int MEDIA_VIDEO = 1;
public static int guessMediaTypeBySuffix(String name) {
String mimeType = getMimeType(getExtension(name));
if (mimeType == null) {
return -1;
}
if (mimeType.contains("video/")) {
return 1;
}
return mimeType.contains("image/") ? 0 : -1;
}
public static void updateFileList(ArrayList<String> fileNames) {
File file = new File(MagApplication.magParameter.mediaDir);
File[] files = file.listFiles(new FileFilter() { // from class: cn.com.magnity.magnitycx.sdk.GlobalFunc.1
@Override // java.io.FileFilter
public boolean accept(File pathname) {
String name = pathname.getName().toLowerCase();
return !name.endsWith(".ddt");
}
});
if (file == null || files == null) {
fileNames.clear();
return;
}
ArrayList<FileInfo> fileInfos = new ArrayList<>();
for (File f : files) {
FileInfo fileInfo = new FileInfo();
fileInfo.name = f.getName();
fileInfo.lastModified = f.lastModified();
fileInfos.add(fileInfo);
}
Collections.sort(fileInfos, new FileInfoComparator());
fileNames.clear();
Iterator<FileInfo> it = fileInfos.iterator();
while (it.hasNext()) {
fileNames.add(it.next().name);
}
}
public static void notifyMediaSync(Context context, File file) {
Intent intent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE");
Uri uri = Uri.fromFile(file);
intent.setData(uri);
context.sendBroadcast(intent);
}
public static int byteArrayToInt(byte[] b) {
return (b[0] & 255) | ((b[1] & 255) << 8) | ((b[2] & 255) << 16) | ((b[3] & 255) << 24);
}
public static byte[] intToByteArray(int a) {
return new byte[]{(byte) (a & 255), (byte) ((a >> 8) & 255), (byte) ((a >> 16) & 255), (byte) ((a >> 24) & 255)};
}
public static void intToByteArray(int a, byte[] out, int offset) {
if (out.length >= offset + 4) {
int offset2 = offset + 1;
out[offset] = (byte) a;
int offset3 = offset2 + 1;
out[offset2] = (byte) (a >> 8);
int offset4 = offset3 + 1;
out[offset3] = (byte) (a >> 16);
int i = offset4 + 1;
out[offset4] = (byte) (a >> 24);
}
}
private static String getExtension(String name) {
int idx = name.lastIndexOf(".");
if (idx <= 0) {
return "";
}
String suffix = name.substring(idx + 1);
return suffix;
}
private static String getMimeType(String suffix) {
if (suffix.isEmpty()) {
return null;
}
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(suffix);
}
private static class FileInfoComparator implements Comparator<FileInfo> {
private FileInfoComparator() {
}
@Override // java.util.Comparator
public int compare(FileInfo lhs, FileInfo rhs) {
if (lhs.lastModified > rhs.lastModified) {
return -1;
}
if (lhs.lastModified == rhs.lastModified) {
return 0;
}
return 1;
}
}
private static class FileInfo {
public long lastModified;
public String name;
private FileInfo() {
}
}
}
@@ -0,0 +1,9 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public class ImgHeader {
public int frameIndex;
public int[] reserved = new int[4];
public int sendBytes;
public int startCode;
}
@@ -0,0 +1,13 @@
package cn.com.magnity.magnitycx.sdk;
import java.io.Serializable;
/* loaded from: classes.dex */
public class ImgTail implements Serializable {
public int camTemp;
public int endCode;
public int fpaTemp;
public int frameIndex;
public int intDrop;
public int[] reserved = new int[2];
}
@@ -0,0 +1,52 @@
package cn.com.magnity.magnitycx.sdk;
import android.graphics.Bitmap;
import android.os.Build;
import android.support.v4.util.LruCache;
/* loaded from: classes.dex */
public class LruCacheManager {
private static final int CACHE_SIZE = 10485760;
private static LruCacheManager instance_;
private LruCache<String, Bitmap> memCache_;
private LruCacheManager() {
}
public static LruCacheManager getInstance() {
if (instance_ == null) {
instance_ = new LruCacheManager();
instance_.init();
}
return instance_;
}
private void init() {
int maxMemory = (int) Runtime.getRuntime().maxMemory();
int cacheSize = CACHE_SIZE;
if (CACHE_SIZE > maxMemory / 8) {
cacheSize = maxMemory / 8;
}
this.memCache_ = new LruCache<String, Bitmap>(cacheSize) { // from class: cn.com.magnity.magnitycx.sdk.LruCacheManager.1
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.support.v4.util.LruCache
public int sizeOf(String key, Bitmap bitmap) {
return Build.VERSION.SDK_INT >= 12 ? bitmap.getByteCount() : bitmap.getRowBytes() * bitmap.getHeight();
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.support.v4.util.LruCache
public void entryRemoved(boolean evicted, String key, Bitmap oldValue, Bitmap newValue) {
super.entryRemoved(evicted, (boolean) key, oldValue, newValue);
}
};
}
public synchronized Bitmap put(String key, Bitmap value) {
return this.memCache_.put(key, value);
}
public synchronized Bitmap get(String key) {
return this.memCache_.get(key);
}
}
@@ -0,0 +1,228 @@
package cn.com.magnity.magnitycx.sdk;
import android.content.Context;
import android.os.Environment;
import java.io.File;
/* loaded from: classes.dex */
public class MagParameter {
public static final int DISPMODE_IRONLY = 1;
public static final int DISPMODE_PIP = 0;
public static final int EM_LEVEL1 = 100;
public static final int EM_LEVEL2 = 90;
public static final int EM_LEVEL3 = 80;
public static final int EM_LEVEL4 = 70;
public static final String EVENT_C1 = "c1设备启动";
public static final String EVENT_C1_ID = "C1";
public static final String EVENT_C3 = "c3设备启动";
public static final String EVENT_C3_ID = "C3";
public static final String EVENT_CLICK_ABOUT = "点击关于";
public static final String EVENT_CLICK_ABOUT_ID = "CLICK_ABOUT";
public static final String EVENT_CLICK_PRODUCT = "点击产品";
public static final String EVENT_CLICK_PRODUCT_ID = "CLICK_PRODUCT";
public static final String EVENT_CLICK_SHARE = "点击分享";
public static final String EVENT_CLICK_SHARE_ID = "CLICK_SHARE";
public static final String EVENT_COLOR_PALETTE = "调色板";
public static final String EVENT_COLOR_PALETTE_ID = "COLOR_PALETTE";
public static final String EVENT_DIABLE_MAX_TEMP = "关闭最高温测温";
public static final String EVENT_DIABLE_MAX_TEMP_ID = "DISABLE_MAX_TEMP";
public static final String EVENT_DISABLE_CENTER_TEMP = "关闭中心测温";
public static final String EVENT_DISABLE_CENTER_TEMP_ID = "DISABLE_CENTER_TEMP";
public static final String EVENT_DISABLE_LASER = "关闭激光";
public static final String EVENT_DISABLE_LASER_ID = "DISABLE_LASER";
public static final String EVENT_DISABLE_VISWND = "关闭可见光";
public static final String EVENT_DISABLE_VISWND_ID = "DISABLE_VISWND";
public static final String EVENT_EMISSIVITY_DARK = "辐射率暗光";
public static final String EVENT_EMISSIVITY_DARK_ID = "EMISSIVITY_DARK";
public static final String EVENT_EMISSIVITY_HALF = "辐射率半光";
public static final String EVENT_EMISSIVITY_HALF_ID = "EMISSIVITY_HALF";
public static final String EVENT_EMISSIVITY_LIGHT = "辐射率亮光";
public static final String EVENT_EMISSIVITY_LIGHT_ID = "EMISSIVITY_LIGHT";
public static final String EVENT_EMISSIVITY_NONE = "辐射率无光";
public static final String EVENT_EMISSIVITY_NONE_ID = "EMISSIVITY_NONE";
public static final String EVENT_ENABLE_CENTER_TEMP = "打开中心测温";
public static final String EVENT_ENABLE_CENTER_TEMP_ID = "ENABLE_CENTER_TEMP";
public static final String EVENT_ENABLE_LASER = "打开激光";
public static final String EVENT_ENABLE_LASER_ID = "ENABLE_LASER";
public static final String EVENT_ENABLE_MAX_TEMP = "打开最高温测温";
public static final String EVENT_ENABLE_MAX_TEMP_ID = "ENABLE_MAX_TEMP";
public static final String EVENT_ENABLE_VISWND = "打开可见光";
public static final String EVENT_ENABLE_VISWND_ID = "ENABLE_VISWND";
public static final String EVENT_ENTER_COMPANY_WEBSITE = "进入官网";
public static final String EVENT_ENTER_COMPANY_WEBSITE_ID = "ENTER_COMPANY_WEBSITE";
public static final String EVENT_ENTER_WECHAT_STORE = "进入微店";
public static final String EVENT_ENTER_WECHAT_STORE_ID = "ENTER_WECHAT_STORE";
public static final String EVENT_FLIP_HORIZONTAL = "水平翻转";
public static final String EVENT_FLIP_HORIZONTAL_ID = "FLIP_HORIZONTAL";
public static final String EVENT_FLIP_VERTICAL = "竖直翻转";
public static final String EVENT_FLIP_VERTICAL_ID = "FLIP_VERTICAL";
public static final String EVENT_FRAME_RATE_HIGH = "帧率高";
public static final String EVENT_FRAME_RATE_HIGH_ID = "FRAME_RATE_HIGH";
public static final String EVENT_FRAME_RATE_LOW = "帧率低";
public static final String EVENT_FRAME_RATE_LOW_ID = "FRAME_RATE_LOW";
public static final String EVENT_PHOTO = "拍照";
public static final String EVENT_PHOTO_ID = "PHOTO";
public static final String EVENT_ROIT_TRACE = "矩形测温";
public static final String EVENT_ROIT_TRACE_ID = "ROIT_TRACE";
public static final String EVENT_TRACE_MAX = "目标最高温";
public static final String EVENT_TRACE_MAXMIN = "目标全";
public static final String EVENT_TRACE_MAXMIN_ID = "TRACE_MAXMIN";
public static final String EVENT_TRACE_MAX_ID = "TRACE_MAX";
public static final String EVENT_TRACE_MIN = "目标最低温";
public static final String EVENT_TRACE_MIN_ID = "TRACE_MIN";
public static final String EVENT_TRACE_NONE = "目标无";
public static final String EVENT_TRACE_NONE_ID = "TRACE_NONE";
public static final String EVENT_VIDEO = "录像";
public static final String EVENT_VIDEO_ID = "VIDEO";
public static final String EVENT_VISWND_LARGE = "可见光尺寸大";
public static final String EVENT_VISWND_LARGE_ID = "VISWND_LARGE";
public static final String EVENT_VISWND_MIDDLE = "可见光尺寸中";
public static final String EVENT_VISWND_MIDDLE_ID = "VISWND_MIDDLE";
public static final String EVENT_VISWND_SMALL = "可见光尺寸小";
public static final String EVENT_VISWND_SMALL_ID = "VISWND_SMALL";
public static final int FLIP_HOR = 1;
public static final int FLIP_NO = 0;
public static final int FLIP_VER = 2;
public static final int FPS_HIGH = 0;
public static final int FPS_LOW = 1;
public static final String KEY_DISPMODE = "dispMode";
public static final String KEY_EMISSIVITY = "emissivity";
public static final String KEY_EXMODE = "exMode";
public static final String KEY_FLIPMODE = "flipMode";
public static final String KEY_FPSMODE = "fpsMode";
public static final String KEY_MAXMINTRACE = "maxMinTrace";
public static final String KEY_ONCETIPMEDIALONGCLICK = "onceTipMediaLongClick2";
public static final String KEY_ONCETIPVISIBLEMOVE = "onceTipVisibleMove2";
public static final String KEY_SHOWCROSS = "isShowCross";
public static final String KEY_SHOWMOVINGCROSS = "isShowMovingCross";
public static final String KEY_TRACEMAXMIN = "isTraceMaxMin";
public static final String KEY_TRACEROI = "isTraceRoi";
public static final String KEY_VISCAMID = "visCameraId";
public static final String KEY_VISWNDLEFTMARGIN = "visWndLeftMargin";
public static final String KEY_VISWNDSIZE = "visWndSize";
public static final String KEY_VISWNDTOPMARGIN = "visWndTopMargin";
public static final int TRACE_MAX = 0;
public static final int TRACE_MAXMIN = 2;
public static final int TRACE_MIN = 1;
public static final int TRACE_NONE = -1;
public static final int TYPE_160CORE = 3;
public static final int TYPE_C1 = 0;
public static final int TYPE_C1Pro = 5;
public static final int TYPE_C1ProLite = 6;
public static final int TYPE_C3 = 1;
public static final int TYPE_C3P = 2;
public static final int TYPE_C6 = 4;
public static final int VISWND_LARGE = 2;
public static final int VISWND_MEDIUM = 1;
public static final int VISWND_SMALL = 0;
public BasePara1 basePara1;
public BasePara2 basePara2;
public CaliInfo caliInfo;
public int dispMode;
public int emissivity;
public int fpsMode;
public int imageEX;
public int imageFlip;
public boolean isLaserOn;
public boolean isShowCross;
public boolean isShowMovingCross;
public boolean isTraceMaxMin;
public boolean isTraceRoi;
public int maxMinTrace;
public int onceTipMediaLongClick;
public int onceTipVisibleMove;
public int portraitScreenHeight;
public int portraitScreenWidth;
public int visCameraId;
public int visWndLeftMargin;
public int visWndSize;
public int visWndTopMargin;
public String logDir = "";
public String caliDir = "";
public String mediaDir = "";
public String otherDir = "";
public MagParameter(Context context) {
SharedPreferencesManager.init(context);
this.basePara1 = new BasePara1();
this.basePara2 = new BasePara2();
this.caliInfo = new CaliInfo();
this.dispMode = SharedPreferencesManager.getInt(KEY_DISPMODE, 1);
this.isShowCross = SharedPreferencesManager.getBoolean(KEY_SHOWCROSS, false);
this.isShowMovingCross = SharedPreferencesManager.getBoolean(KEY_SHOWMOVINGCROSS, false);
this.isTraceMaxMin = SharedPreferencesManager.getBoolean(KEY_TRACEMAXMIN, false);
this.isLaserOn = false;
this.isTraceRoi = SharedPreferencesManager.getBoolean(KEY_TRACEROI, false);
this.visCameraId = SharedPreferencesManager.getInt(KEY_VISCAMID, 0);
this.visWndSize = SharedPreferencesManager.getInt(KEY_VISWNDSIZE, 1);
this.maxMinTrace = SharedPreferencesManager.getInt(KEY_MAXMINTRACE, 0);
this.imageFlip = SharedPreferencesManager.getInt(KEY_FLIPMODE, 0);
this.imageEX = SharedPreferencesManager.getInt(KEY_EXMODE, 0);
this.emissivity = SharedPreferencesManager.getInt(KEY_EMISSIVITY, 100);
this.visWndLeftMargin = SharedPreferencesManager.getInt(KEY_VISWNDLEFTMARGIN, -1);
this.visWndTopMargin = SharedPreferencesManager.getInt(KEY_VISWNDTOPMARGIN, 0);
this.onceTipMediaLongClick = SharedPreferencesManager.getInt(KEY_ONCETIPMEDIALONGCLICK, 3);
this.onceTipVisibleMove = SharedPreferencesManager.getInt(KEY_ONCETIPVISIBLEMOVE, 3);
this.fpsMode = SharedPreferencesManager.getInt(KEY_FPSMODE, 1);
createDirs();
}
private void createDirs() {
if (Environment.getExternalStorageState().equals("mounted")) {
String pathName = Environment.getExternalStorageDirectory().getPath() + File.separator + "magnity" + File.separator + "Cx";
File file = new File(pathName);
if (file.exists() || file.mkdirs()) {
String pathName2 = pathName + File.separator;
this.logDir = pathName2 + "log";
File file2 = new File(this.logDir);
if (!file2.exists()) {
file2.mkdirs();
}
this.caliDir = pathName2 + "others";
File file3 = new File(this.caliDir);
if (!file3.exists()) {
file3.mkdirs();
}
this.mediaDir = pathName2 + "media";
File file4 = new File(this.mediaDir);
if (!file4.exists()) {
file4.mkdirs();
}
this.otherDir = pathName2 + "others";
File file5 = new File(this.otherDir);
if (!file5.exists()) {
file5.mkdirs();
}
}
}
}
public class Size {
private int height_;
private int width_;
public Size() {
}
public Size(int width, int height) {
this.width_ = width;
this.height_ = height;
}
public void setWidth(int width) {
this.width_ = width;
}
public void setHeight(int height) {
this.height_ = height;
}
public int getWidth() {
return this.width_;
}
public int getHeight() {
return this.height_;
}
}
}
@@ -0,0 +1,77 @@
package cn.com.magnity.magnitycx.sdk;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Parcelable;
import android.support.v4.content.LocalBroadcastManager;
import cn.com.magnity.magnitycx.MagApplication;
/* loaded from: classes.dex */
public class MsgBus {
private static MsgBus mInstance;
private static LocalBroadcastManager mLocalBroadcastManager;
public static synchronized MsgBus getInstance() {
MsgBus msgBus;
synchronized (MsgBus.class) {
if (mInstance == null) {
mInstance = new MsgBus(MagApplication.getInstance());
}
msgBus = mInstance;
}
return msgBus;
}
public MsgBus(Context context) {
mLocalBroadcastManager = LocalBroadcastManager.getInstance(context.getApplicationContext());
}
public void register(BroadcastReceiver receiver, String action) {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(action);
mLocalBroadcastManager.registerReceiver(receiver, intentFilter);
}
public void register(BroadcastReceiver receiver, String[] actions) {
IntentFilter intentFilter = new IntentFilter();
for (String msg : actions) {
intentFilter.addAction(msg);
}
mLocalBroadcastManager.registerReceiver(receiver, intentFilter);
}
public void unregister(BroadcastReceiver receiver) {
mLocalBroadcastManager.unregisterReceiver(receiver);
}
public void postEmptytMsg(String msg) {
mLocalBroadcastManager.sendBroadcast(new Intent(msg));
}
public void postMsg(String msg, String tag, int val) {
Intent intent = new Intent(msg);
intent.putExtra(tag, val);
mLocalBroadcastManager.sendBroadcast(intent);
}
public void postMsg(String msg, String tag, String val) {
Intent intent = new Intent(msg);
intent.putExtra(tag, val);
mLocalBroadcastManager.sendBroadcast(intent);
}
public void postMsg(String msg, String tag, Parcelable parcel) {
Intent intent = new Intent(msg);
intent.putExtra(tag, parcel);
mLocalBroadcastManager.sendBroadcast(intent);
}
public void postMsg(String msg, String tag1, Parcelable parcel, String tag2, int val) {
Intent intent = new Intent();
intent.putExtra(tag1, parcel);
intent.putExtra(tag2, val);
mLocalBroadcastManager.sendBroadcast(intent);
}
}
@@ -0,0 +1,35 @@
package cn.com.magnity.magnitycx.sdk;
import java.util.ArrayList;
/* loaded from: classes.dex */
public abstract class Observable<T> {
protected final ArrayList<T> observers_ = new ArrayList<>();
public void registerObserver(T observer) {
if (observer != null) {
synchronized (this.observers_) {
if (!this.observers_.contains(observer)) {
this.observers_.add(observer);
}
}
}
}
public void unregisterObserver(T observer) {
if (observer != null) {
synchronized (this.observers_) {
int index = this.observers_.indexOf(observer);
if (index != -1) {
this.observers_.remove(index);
}
}
}
}
public void unregisterAll() {
synchronized (this.observers_) {
this.observers_.clear();
}
}
}
@@ -0,0 +1,20 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public class P2DCmd {
public static final int P2D_GetCaliFile = 1807136368;
public static final int P2D_GetCaliInfo = 1807136367;
public static final int P2D_GetFPAState = 1807136376;
public static final int P2D_GetLifeTime = 1807136373;
public static final int P2D_GetParameter1 = 1807136363;
public static final int P2D_GetParameter2 = 1807136364;
public static final int P2D_PowerSave = 1807136375;
public static final int P2D_SendCaliFile = 1807136369;
public static final int P2D_SetFrameRate = 1807136377;
public static final int P2D_SetLaserState = 1807136374;
public static final int P2D_SetParameter1 = 1807136365;
public static final int P2D_SetParameter2 = 1807136366;
public static final int P2D_SetShutterState = 1807136370;
public static final int P2D_StartTransferImg = 1807136371;
public static final int P2D_StopTransferImg = 1807136372;
}
@@ -0,0 +1,58 @@
package cn.com.magnity.magnitycx.sdk;
import android.content.Context;
import android.content.SharedPreferences;
/* loaded from: classes.dex */
public class SharedPreferencesManager {
private static SharedPreferences.Editor editor_;
private static SharedPreferences preferences_;
public static void init(Context context) {
preferences_ = context.getApplicationContext().getSharedPreferences("magnitycx", 0);
editor_ = preferences_.edit();
}
public static boolean commit() {
return editor_.commit();
}
public static SharedPreferences.Editor putInt(String key, int value) {
return editor_.putInt(key, value);
}
public static void putIntWithCommit(String key, int value) {
editor_.putInt(key, value);
editor_.commit();
}
public static int getInt(String key, int defValue) {
return preferences_.getInt(key, defValue);
}
public static SharedPreferences.Editor putFloat(String key, float value) {
return editor_.putFloat(key, value);
}
public static void putFloatWithCommit(String key, float value) {
editor_.putFloat(key, value);
editor_.commit();
}
public static float getFloat(String key, float defValue) {
return preferences_.getFloat(key, defValue);
}
public static SharedPreferences.Editor putBoolean(String key, boolean value) {
return editor_.putBoolean(key, value);
}
public static void putBooleanWithCommit(String key, boolean value) {
editor_.putBoolean(key, value);
editor_.commit();
}
public static boolean getBoolean(String key, boolean defValue) {
return preferences_.getBoolean(key, defValue);
}
}
@@ -0,0 +1,25 @@
package cn.com.magnity.magnitycx.sdk;
import java.util.Arrays;
/* loaded from: classes.dex */
public class State implements Cloneable {
public int intAveNETDt;
public int intAveTemperature;
public int[] intHistTemperature = new int[256];
public int intMaxTemperature;
public int intMaxX;
public int intMaxY;
public int intMinTemperature;
public int intMinX;
public int intMinY;
public int intSTDTemperature;
public Object clone() throws CloneNotSupportedException {
State state = (State) super.clone();
if (this.intHistTemperature != null) {
state.intHistTemperature = Arrays.copyOf(this.intHistTemperature, this.intHistTemperature.length);
}
return state;
}
}
@@ -0,0 +1,29 @@
package cn.com.magnity.magnitycx.sdk;
import java.util.Timer;
import java.util.TimerTask;
/* loaded from: classes.dex */
public abstract class TimerHelper {
private Timer timer_ = null;
public abstract void run();
public void start(long delay, long period) {
stop();
this.timer_ = new Timer();
this.timer_.schedule(new TimerTask() { // from class: cn.com.magnity.magnitycx.sdk.TimerHelper.1
@Override // java.util.TimerTask, java.lang.Runnable
public void run() {
TimerHelper.this.run();
}
}, delay, period);
}
public void stop() {
if (this.timer_ != null) {
this.timer_.cancel();
this.timer_ = null;
}
}
}
@@ -0,0 +1,966 @@
package cn.com.magnity.magnitycx.sdk;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbEndpoint;
import android.hardware.usb.UsbInterface;
import android.hardware.usb.UsbManager;
import android.os.Handler;
import android.os.Message;
import android.support.v4.media.TransportMediator;
import android.support.v7.widget.helper.ItemTouchHelper;
import cn.com.magnity.magnitycx.ImageViewer;
import cn.com.magnity.magnitycx.MagApplication;
import cn.com.magnity.magnitycx.R;
import cn.com.magnity.magnitycx.log.Logging;
import cn.com.magnity.magnitycx.sdk.DeviceController;
import com.baidu.mobstat.Config;
import com.baidu.mobstat.autotrace.Common;
import java.io.File;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.log4j.Priority;
/* loaded from: classes.dex */
public class UsbCommunication implements DeviceController.ShutterCallBack {
private static final int DOWNLOAD_CALI_TIMEOUT = 5000;
private static final int HEADER_SIZE = 28;
private static final int IMG_END_CODE = 464630044;
private static final int IMG_START_CODE = 464630043;
private static final int MAX_CALI_FILE_LEN = 104857600;
private static final int MAX_RECEIVED_LEN = 16384;
private static final int MIN_CALI_FILE_LEN = 65536;
public static final String MSG_SET_BASEPARAMETER = "set_baseparameter";
public static final String MSG_TRIGGER_FFC = "trigger_ffc";
public static final int PROGRESS_CALI_ID = 0;
private static final int PROGRESS_CANCEL = 3;
private static final int PROGRESS_CHANGED = 2;
private static final int PROGRESS_FINISHED = 1;
private static final int PROGRESS_START = 0;
public static final int PROGRESS_WAIT_FOR_CORRECT_STREAM_ID = 1;
private static final int QUERY_DEVICE_LIFETIME = 4;
private static final int TAIL_SIZE = 28;
private static final int TIMEOUT = 800;
private static final int TIME_FOR_DEVICE_INIT = 15000;
private static volatile Lock lock_ = new ReentrantLock();
private static volatile long[] ticks_ = new long[20];
private volatile int camTemp_;
private UsbConnection conn_;
private volatile int fpaTemp_;
private byte[] imgExchangeBuf1_;
private ImageViewer imgViewer_;
private volatile boolean isExitThreadImgProcess_;
private IProgressCallback progressCallback_;
private ThreadCaliRecv threadCaliRecv_;
private ThreadImgProcess threadImgProcess_;
private ThreadImgRecv threadImgRecv_;
private UsbDeviceConnection usbConn_;
private UsbEndpoint usbEpCaliIn_;
private UsbEndpoint usbEpCaliOut_;
private UsbEndpoint usbEpCmdIn_;
private UsbEndpoint usbEpCmdOut_;
private UsbEndpoint usbEpImgIn_;
private UsbInterface usbInterface_;
private volatile boolean connected_ = false;
private volatile boolean isExitCaliRecvThread = false;
private WaitCondition condImgProcess_ = new WaitCondition();
private volatile boolean isToRecvFirstCaliPacket_ = false;
private String caliPathName_ = "";
private Handler handler_ = new Handler() { // from class: cn.com.magnity.magnitycx.sdk.UsbCommunication.1
@Override // android.os.Handler
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case 0:
if (UsbCommunication.this.progressCallback_ != null) {
UsbCommunication.this.progressCallback_.progressStart(((Integer) msg.obj).intValue());
break;
}
break;
case 1:
if (UsbCommunication.this.progressCallback_ != null) {
UsbCommunication.this.progressCallback_.progressFinished(((Integer) msg.obj).intValue());
break;
}
break;
case 2:
if (UsbCommunication.this.progressCallback_ != null) {
UsbCommunication.this.progressCallback_.progressChanged(msg.arg1, msg.arg2);
break;
}
break;
case 3:
if (UsbCommunication.this.progressCallback_ != null) {
UsbCommunication.this.progressCallback_.progressCancel(((Integer) msg.obj).intValue());
break;
}
break;
case 4:
int t = UsbCommunication.this.getDevLifeTime();
if (t != -1) {
if (MagApplication.magParameter.basePara1.devType == 0 || MagApplication.magParameter.basePara1.devType == 5 || MagApplication.magParameter.basePara1.devType == 6 || MagApplication.magParameter.basePara1.devType == 3) {
if (t > 5000) {
if (UsbCommunication.this.imgViewer_.getImageStableCounter() == 4) {
}
UsbCommunication.this.imgViewer_.setImageStableCounter(0);
} else {
UsbCommunication.this.imgViewer_.setImageStableCounter(4);
}
} else if (MagApplication.magParameter.basePara1.devType == 1 || MagApplication.magParameter.basePara1.devType == 2) {
if (t > 26000) {
if (UsbCommunication.this.imgViewer_.getImageStableCounter() == 1) {
DeviceController.Lock();
DeviceController.triggerFFC();
DeviceController.Unlock();
}
UsbCommunication.this.imgViewer_.setImageStableCounter(0);
} else if (t > 19500) {
if (UsbCommunication.this.imgViewer_.getImageStableCounter() == 2) {
DeviceController.Lock();
DeviceController.triggerFFC();
DeviceController.Unlock();
}
UsbCommunication.this.imgViewer_.setImageStableCounter(1);
} else if (t > 13000) {
if (UsbCommunication.this.imgViewer_.getImageStableCounter() == 3) {
DeviceController.Lock();
DeviceController.triggerFFC();
DeviceController.Unlock();
}
UsbCommunication.this.imgViewer_.setImageStableCounter(2);
} else if (t > 6500) {
if (UsbCommunication.this.imgViewer_.getImageStableCounter() == 4) {
DeviceController.Lock();
DeviceController.triggerFFC();
DeviceController.Unlock();
}
UsbCommunication.this.imgViewer_.setImageStableCounter(3);
} else {
UsbCommunication.this.imgViewer_.setImageStableCounter(4);
}
}
if (t > 40000) {
UsbCommunication.this.imgViewer_.setTempStableFlag(true);
break;
} else {
UsbCommunication.this.imgViewer_.setTempStableFlag(false);
break;
}
}
break;
}
}
};
private BroadcastReceiver mReceiver = new BroadcastReceiver() { // from class: cn.com.magnity.magnitycx.sdk.UsbCommunication.2
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) {
case "set_baseparameter":
UsbCommunication.this.setFrameRate();
DeviceController.triggerFFC();
break;
case "trigger_ffc":
DeviceController.triggerFFC();
break;
}
}
};
public interface DelegateNewFrame {
void onNewFrameReceived(int i, int i2);
}
public interface IProgressCallback {
void progressCancel(int i);
void progressChanged(int i, int i2);
void progressFinished(int i);
void progressStart(int i);
}
/* JADX INFO: Access modifiers changed from: private */
public int getDevLifeTime() {
int i = -1;
if (sendEmptyCmd(P2DCmd.P2D_GetLifeTime, TIMEOUT) < 0) {
Logging.error("Fail to get device lifetime");
}
byte[] data = new byte[64];
int len = recvCmd(data, 0, data.length, TIMEOUT);
if (len < 0) {
Logging.error("Fail to get lifetime ack");
} else if (len < 4) {
Logging.error("Get wrong ack size(" + len + ")");
} else if (len < 8) {
Logging.error("Get wrong ack size(" + len + ", cmd: " + GlobalFunc.byteArrayToInt(data) + ")");
} else {
ByteBuffer bb = ByteBuffer.wrap(data, 0, len);
bb.order(ByteOrder.LITTLE_ENDIAN);
try {
if (bb.getInt() == 1538635105) {
i = bb.getInt();
} else {
Logging.error("Get wrong cmd(expected is lifetime)");
}
} catch (IndexOutOfBoundsException e) {
Logging.error("Exception of get liftime");
}
}
return i;
}
public void setCallbackReceiver(IProgressCallback cb) {
this.progressCallback_ = cb;
}
public UsbCommunication(UsbConnection conn, UsbManager usbMgr, UsbDevice device, IProgressCallback cb) throws Exception {
this.conn_ = conn;
this.progressCallback_ = cb;
this.usbConn_ = usbMgr.openDevice(device);
if (this.usbConn_ == null) {
throw new Exception("Unable to open USB device");
}
if (device.getInterfaceCount() < 1) {
throw new Exception("Unable to get USB interface");
}
this.usbInterface_ = device.getInterface(0);
if (!this.usbConn_.claimInterface(this.usbInterface_, true)) {
throw new Exception("Unable to claim USB interface");
}
if (this.usbInterface_.getEndpointCount() < 4) {
throw new Exception("Unable to get USB endpoint (" + this.usbInterface_.getEndpointCount() + ")");
}
for (int i = this.usbInterface_.getEndpointCount() - 1; i != -1; i--) {
UsbEndpoint ep = this.usbInterface_.getEndpoint(i);
switch (ep.getAddress()) {
case 3:
this.usbEpCmdOut_ = ep;
break;
case 5:
this.usbEpCaliOut_ = ep;
break;
case 129:
this.usbEpImgIn_ = ep;
break;
case TransportMediator.KEYCODE_MEDIA_RECORD /* 130 */:
this.usbEpCmdIn_ = ep;
break;
case 132:
this.usbEpCaliIn_ = ep;
break;
default:
Logging.warn("Unknown endpoint found.");
break;
}
}
if (this.usbEpCmdIn_ == null || this.usbEpCmdOut_ == null || this.usbEpCaliIn_ == null || this.usbEpCaliOut_ == null || this.usbEpImgIn_ == null) {
Logging.warn("Some endpoint lost.");
}
}
public void setImageViewer(ImageViewer imageViewer) {
this.imgViewer_ = imageViewer;
}
public int connect() {
if (this.connected_) {
return 1;
}
MsgBus.getInstance().register(this.mReceiver, new String[]{MSG_SET_BASEPARAMETER, MSG_TRIGGER_FFC});
byte[] data = new byte[64];
if (sendEmptyCmd(P2DCmd.P2D_GetParameter1, TIMEOUT) < 0) {
Logging.error("Fail to get parameter1");
return -1;
}
int len = recvCmd(data, 0, data.length, TIMEOUT);
if (len > 0) {
if (parseCmd(data, len) != 1) {
return -1;
}
if (MagApplication.magParameter.basePara1.devType != 0 && MagApplication.magParameter.basePara1.devType != 5 && MagApplication.magParameter.basePara1.devType != 6 && MagApplication.magParameter.basePara1.devType != 1 && MagApplication.magParameter.basePara1.devType != 2 && MagApplication.magParameter.basePara1.devType != 3) {
Logging.error("unknown device type " + MagApplication.magParameter.basePara1.devType);
return -1;
}
if (sendEmptyCmd(P2DCmd.P2D_GetParameter2, TIMEOUT) < 0) {
Logging.error("Fail to get parameter2");
return -1;
}
int len2 = recvCmd(data, 0, data.length, TIMEOUT);
if (len2 > 0) {
if (parseCmd(data, len2) != 1) {
return -1;
}
if (sendEmptyCmd(P2DCmd.P2D_GetCaliInfo, TIMEOUT) < 0) {
Logging.error("Fail to get remote file info");
return -1;
}
int len3 = recvCmd(data, 0, data.length, TIMEOUT);
if (len3 > 0) {
int ret = parseCmd(data, len3);
if (ret == 1) {
return !startTransfer(this.caliPathName_) ? -1 : 1;
}
return ret;
}
Logging.error("Fail to get remote file info");
return -1;
}
Logging.error("Fail to get parameter2 ack");
return -1;
}
Logging.error("Fail to get parameter1 ack");
return -1;
}
/* JADX INFO: Access modifiers changed from: private */
public boolean startTransfer(String caliPathName) {
BasePara1 para1 = MagApplication.magParameter.basePara1;
BasePara2 para2 = MagApplication.magParameter.basePara2;
if (!DeviceController.startProcess(this, para1.fpaWidth, para1.fpaHeight, para1.serialNumber, para1.devType, para2.shutterCloseSpeed, para2.shutterOpenSpeed, para2.ffcTriggerFrame, para2.ffcTriggerTemperature, SharedPreferencesManager.getInt("paletteIndex", 2), para2.baseLineAcc, caliPathName)) {
Logging.error("SDK start fail");
try {
File f = new File(caliPathName);
f.delete();
return false;
} catch (Exception e) {
return false;
}
}
DeviceController.setEX(MagApplication.magParameter.imageEX, MagApplication.magParameter.basePara1.fpaWidth / 2, MagApplication.magParameter.basePara1.fpaHeight / 2);
ExtPara param = new ExtPara();
DeviceController.Lock();
DeviceController.getExtParameter(param);
param.dwFlip = MagApplication.magParameter.imageFlip;
DeviceController.setExtParameter(param);
DeviceController.setAutoEnlarge(para2.enlargeRange);
DeviceController.Unlock();
Logging.info("****Start****");
this.connected_ = true;
this.threadImgRecv_ = new ThreadImgRecv();
this.threadImgRecv_.start();
this.threadImgProcess_ = new ThreadImgProcess();
this.isExitThreadImgProcess_ = false;
this.condImgProcess_.notified = false;
this.threadImgProcess_.start();
try {
Thread.sleep(5L);
} catch (InterruptedException e2) {
}
if (sendEmptyCmd(P2DCmd.P2D_StartTransferImg, Common.EDIT_SNAPSHOT_INTERVAL) < 0) {
Logging.error("Fail to start remote transferring");
DeviceController.stopProcess();
return false;
}
if (para1.devType == 1) {
MagApplication.magParameter.isTraceRoi = false;
MagApplication.magParameter.isShowCross = false;
MagApplication.magParameter.isTraceMaxMin = true;
MagApplication.magParameter.maxMinTrace = -1;
MagApplication.magParameter.emissivity = 100;
DeviceController.Lock();
DeviceController.setEmissivity(100, Priority.INFO_INT);
DeviceController.Unlock();
} else if (para1.devType == 0 || para1.devType == 5 || para1.devType == 6 || para1.devType == 3) {
MagApplication.magParameter.isTraceRoi = false;
MagApplication.magParameter.isShowMovingCross = false;
MagApplication.magParameter.emissivity = 100;
DeviceController.Lock();
DeviceController.setEmissivity(100, Priority.INFO_INT);
DeviceController.Unlock();
} else if (para1.devType == 2) {
MagApplication.magParameter.isShowMovingCross = false;
MagApplication.magParameter.isTraceMaxMin = true;
}
if (para1.devType == 1 || para1.devType == 2) {
if (MagApplication.magParameter.fpsMode == 0) {
MagApplication.magParameter.basePara1.interFrame = 9;
MagApplication.magParameter.basePara1.interLine = 12;
} else {
MagApplication.magParameter.basePara1.interFrame = 105;
MagApplication.magParameter.basePara1.interLine = 105;
}
setFrameRate();
}
return true;
}
private void stopTransfer() {
if (sendEmptyCmd(P2DCmd.P2D_StopTransferImg, TIMEOUT) < 0) {
Logging.error("Fail to stop remote transferring");
}
this.connected_ = false;
try {
if (this.threadImgRecv_ != null) {
this.threadImgRecv_.join();
this.threadImgRecv_ = null;
}
} catch (InterruptedException e) {
this.threadImgRecv_ = null;
Logging.trace("Thread join interrupted1");
}
this.isExitThreadImgProcess_ = true;
synchronized (this.condImgProcess_.cond) {
this.condImgProcess_.notified = true;
this.condImgProcess_.cond.notify();
}
try {
if (this.threadImgProcess_ != null) {
this.threadImgProcess_.join();
this.threadImgProcess_ = null;
}
} catch (InterruptedException e2) {
this.condImgProcess_ = null;
Logging.trace("Thread join interrupted2");
}
DeviceController.stopProcess();
Logging.trace("****Stop****");
}
public void disconnect() {
MsgBus.getInstance().unregister(this.mReceiver);
setLaserState(0);
MagApplication.magParameter.isLaserOn = false;
stopTransfer();
this.conn_ = null;
if (this.usbConn_ != null) {
if (this.usbInterface_ != null) {
this.usbConn_.releaseInterface(this.usbInterface_);
}
this.usbConn_.close();
this.usbConn_ = null;
}
this.usbEpImgIn_ = null;
this.usbEpCaliOut_ = null;
this.usbEpCaliIn_ = null;
this.usbEpCmdOut_ = null;
this.usbEpCmdIn_ = null;
stopCaliRecvThread();
}
@Override // cn.com.magnity.magnitycx.sdk.DeviceController.ShutterCallBack
public void setShutterState(int on) {
setShutterState_(on);
}
private void startCaliRecvThread() {
if (this.threadCaliRecv_ == null) {
this.threadCaliRecv_ = new ThreadCaliRecv();
this.isExitCaliRecvThread = false;
this.threadCaliRecv_.start();
}
}
private void stopCaliRecvThread() {
try {
if (this.threadCaliRecv_ != null) {
this.isExitCaliRecvThread = true;
this.threadCaliRecv_.join();
this.threadCaliRecv_ = null;
}
} catch (InterruptedException e) {
this.threadCaliRecv_ = null;
Logging.trace("Thread join interrupted.");
}
}
private void setShutterState_(int on) {
byte[] buf = {(byte) P2DCmd.P2D_SetShutterState, (byte) 7059126, (byte) 27574, (byte) 107, (byte) on, (byte) (on >> 8), (byte) (on >> 16), (byte) (on >> 24)};
sendCmd(buf, 0, buf.length, TIMEOUT);
}
public boolean setLaserState(int on) {
byte[] buf = {(byte) P2DCmd.P2D_SetLaserState, (byte) 7059126, (byte) 27574, (byte) 107, (byte) on, (byte) (on >> 8), (byte) (on >> 16), (byte) (on >> 24)};
return sendCmd(buf, 0, buf.length, TIMEOUT) >= 0;
}
/* JADX INFO: Access modifiers changed from: private */
public boolean setFrameRate() {
int interFrame;
int interLine;
byte[] buf = new byte[12];
if (MagApplication.magParameter.fpsMode == 0) {
interFrame = 9;
interLine = 12;
} else {
interFrame = 105;
interLine = 105;
}
buf[0] = (byte) P2DCmd.P2D_SetFrameRate;
buf[1] = (byte) 7059126;
buf[2] = (byte) 27574;
buf[3] = (byte) 107;
buf[4] = (byte) interFrame;
buf[5] = (byte) (interFrame >> 8);
buf[6] = (byte) (interFrame >> 16);
buf[7] = (byte) (interFrame >> 24);
buf[8] = (byte) interLine;
buf[9] = (byte) (interLine >> 8);
buf[10] = (byte) (interLine >> 16);
buf[11] = (byte) (interLine >> 24);
return sendCmd(buf, 0, buf.length, TIMEOUT) >= 0;
}
private boolean waitForCmdAck(int cmd, int timeout) {
switch (cmd) {
case P2DCmd.P2D_SetParameter1 /* 1807136365 */:
case P2DCmd.P2D_SetParameter2 /* 1807136366 */:
case P2DCmd.P2D_GetCaliFile /* 1807136368 */:
case P2DCmd.P2D_SendCaliFile /* 1807136369 */:
case P2DCmd.P2D_SetShutterState /* 1807136370 */:
case P2DCmd.P2D_StartTransferImg /* 1807136371 */:
case P2DCmd.P2D_StopTransferImg /* 1807136372 */:
case P2DCmd.P2D_SetLaserState /* 1807136374 */:
case P2DCmd.P2D_SetFrameRate /* 1807136377 */:
byte[] buf = new byte[64];
int ret = this.usbConn_.bulkTransfer(this.usbEpCmdIn_, buf, 0, buf.length, timeout);
if (ret < 0) {
Logging.trace("Fail to get command ack - " + Integer.toHexString(cmd));
return false;
}
case P2DCmd.P2D_GetCaliInfo /* 1807136367 */:
case P2DCmd.P2D_GetLifeTime /* 1807136373 */:
case P2DCmd.P2D_PowerSave /* 1807136375 */:
case P2DCmd.P2D_GetFPAState /* 1807136376 */:
default:
return true;
}
}
public synchronized int sendCmd(byte[] data, int offset, int len, int timeout) {
int ret;
ret = this.usbConn_.bulkTransfer(this.usbEpCmdOut_, data, offset, len, timeout);
if (ret < 0) {
ret = -1;
} else if (!waitForCmdAck(GlobalFunc.byteArrayToInt(data), timeout)) {
ret = -1;
}
return ret;
}
public synchronized int sendEmptyCmd(int data, int timeout) {
int ret;
ret = this.usbConn_.bulkTransfer(this.usbEpCmdOut_, GlobalFunc.intToByteArray(data), 0, 4, timeout);
if (ret < 0) {
ret = -1;
} else if (!waitForCmdAck(data, timeout)) {
ret = -1;
}
return ret;
}
public synchronized int recvCmd(byte[] buffer, int offset, int len, int timeout) {
return this.usbConn_.bulkTransfer(this.usbEpCmdIn_, buffer, offset, len, timeout);
}
public int sendCali(byte[] data, int offset, int len, int timeout) {
int ret = this.usbConn_.bulkTransfer(this.usbEpCaliOut_, data, offset, len, timeout);
if (ret >= 0 && waitForCmdAck(GlobalFunc.byteArrayToInt(data), timeout)) {
return ret;
}
return -1;
}
public synchronized int sendEmptyCali(int data, int timeout) {
int ret;
ret = this.usbConn_.bulkTransfer(this.usbEpCaliOut_, GlobalFunc.intToByteArray(data), 0, 4, timeout);
if (ret < 0) {
ret = -1;
} else if (!waitForCmdAck(data, timeout)) {
ret = -1;
}
return ret;
}
public int recvCali(byte[] buffer, int offset, int len, int timeout) {
return this.usbConn_.bulkTransfer(this.usbEpCaliIn_, buffer, offset, len, timeout);
}
public int recvImg(byte[] buffer, int offset, int len, int timeout) {
return this.usbConn_.bulkTransfer(this.usbEpImgIn_, buffer, offset, len, timeout);
}
public int getCmdInAddress() {
return this.usbEpCmdIn_.getAddress();
}
public int getCaliInAddress() {
return this.usbEpCaliIn_.getAddress();
}
public int getImgInAddress() {
return this.usbEpImgIn_.getAddress();
}
private int parseCmd(byte[] data, int len) {
String productType;
if (len < 4) {
return -1;
}
ByteBuffer bb = ByteBuffer.wrap(data, 0, len);
bb.order(ByteOrder.LITTLE_ENDIAN);
int cmd = bb.getInt();
switch (cmd) {
case D2PCmd.D2P_SendParameter1 /* 1538635099 */:
Logging.trace("D2P_SendParameter1");
BasePara1 para1 = MagApplication.magParameter.basePara1;
try {
para1.serialNumber = bb.getInt();
int val = bb.getInt();
para1.hwVersion = 16777215 & val;
para1.devType = (val >> 24) & 255;
para1.swVersion = bb.getInt();
para1.reserved1 = bb.getInt();
para1.fpaWidth = bb.getInt();
para1.fpaHeight = bb.getInt();
para1.fps = bb.getInt();
para1.reserved2 = bb.getInt();
para1.fpaGain = bb.getInt();
para1.fpaFlip = bb.getInt();
para1.interFrame = bb.getInt();
para1.interLine = bb.getInt();
para1.gfid = bb.getInt();
para1.gsk = bb.getInt();
if (bb.hasRemaining()) {
Logging.warn("D2PCmd.D2P_SendParameter1 cmd size is too long");
return -1;
}
Logging.trace("Serial number: " + para1.serialNumber);
return 1;
} catch (IndexOutOfBoundsException e) {
para1.reset();
Logging.error("D2PCmd.D2P_SendParameter1 cmd size is not enough");
return -1;
}
case D2PCmd.D2P_SendParameter2 /* 1538635100 */:
Logging.trace("D2P_SendParameter2");
BasePara2 para2 = MagApplication.magParameter.basePara2;
try {
para2.baseLineAcc = bb.getInt();
para2.denoiseLevel = bb.getInt();
para2.reserved1 = bb.getInt();
para2.reserved2 = bb.getShort();
para2.fpaTempFix = bb.getShort();
para2.shutterCloseSpeed = bb.getInt();
para2.shutterOpenSpeed = bb.getInt();
para2.ffcTriggerFrame = bb.getInt();
para2.ffcTriggerTemperature = bb.getInt();
para2.enlargeRange = bb.getInt();
para2.laserPos = bb.getInt();
para2.ATZeroErrorPoint = bb.getInt();
para2.ATErrorSlope = bb.getFloat();
para2.reserved5 = bb.getInt();
para2.reserved6 = bb.getInt();
if (bb.hasRemaining()) {
Logging.warn("D2PCmd.D2P_SendParameter2 cmd size is too long");
return -1;
}
return 1;
} catch (IndexOutOfBoundsException e2) {
para2.reset();
Logging.error("D2PCmd.D2P_SendParameter2 cmd size is not enough");
return -1;
}
case D2PCmd.D2P_SendCaliFile /* 1538635101 */:
Logging.trace("D2P_SendRemoteFile");
this.isToRecvFirstCaliPacket_ = true;
return 1;
case D2PCmd.D2P_SendCaliInfo /* 1538635102 */:
Logging.trace("D2P_SendRemoteFileInfo");
CaliInfo caliInfo = MagApplication.magParameter.caliInfo;
try {
caliInfo.size = bb.getInt();
caliInfo.reserved = bb.getInt();
caliInfo.date = bb.getLong();
if (bb.hasRemaining()) {
Logging.warn("D2PCmd.D2P_SendRemoteFileInfo cmd size is too long");
return -1;
}
Logging.trace("Remote file info: " + caliInfo.size + ", " + caliInfo.date);
if (MagApplication.magParameter.caliInfo.size < 65536 || MagApplication.magParameter.caliInfo.size > MAX_CALI_FILE_LEN) {
this.caliPathName_ = "";
Logging.error("remoteFileInfo error(invalid size)");
return -1;
}
if (MagApplication.magParameter.caliDir != null) {
switch (MagApplication.magParameter.basePara1.devType) {
case 0:
productType = MagApplication.getInstance().getResources().getString(R.string.c1);
break;
case 1:
productType = MagApplication.getInstance().getResources().getString(R.string.c3);
break;
case 2:
productType = MagApplication.getInstance().getResources().getString(R.string.c3p);
break;
case 3:
productType = MagApplication.getInstance().getResources().getString(R.string.core160);
break;
case 4:
default:
productType = MagApplication.getInstance().getResources().getString(R.string.unknownProductType);
break;
case 5:
productType = MagApplication.getInstance().getResources().getString(R.string.c1pro);
break;
case 6:
productType = MagApplication.getInstance().getResources().getString(R.string.c1prolite);
break;
}
this.caliPathName_ = MagApplication.magParameter.caliDir + File.separator + productType + "." + MagApplication.magParameter.basePara1.serialNumber + "." + MagApplication.magParameter.caliInfo.date;
File dir = new File(MagApplication.magParameter.caliDir);
File file = new File(this.caliPathName_);
if (!file.exists() || file.length() != MagApplication.magParameter.caliInfo.size) {
File[] files = dir.listFiles();
for (File f : files) {
if (f.getName().contains(MagApplication.magParameter.basePara1.serialNumber + ".")) {
f.delete();
}
}
stopCaliRecvThread();
startCaliRecvThread();
try {
Thread.sleep(50L);
} catch (InterruptedException e3) {
}
sendEmptyCmd(P2DCmd.P2D_GetCaliFile, TIMEOUT);
return 0;
}
}
return 1;
} catch (IndexOutOfBoundsException e4) {
caliInfo.reset();
Logging.error("D2PCmd.D2P_SendRemoteFileInfo cmd size is not enough");
return -1;
}
default:
Logging.warn("Unknown command(" + cmd + ")");
return -1;
}
}
private class ThreadImgRecv extends Thread {
private ThreadImgRecv() {
}
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
int drop;
int frameBytes = ((MagApplication.magParameter.basePara1.fpaWidth * MagApplication.magParameter.basePara1.fpaHeight) * 16) / 8;
int imgRecvBufLength = frameBytes + 1024;
if (UsbCommunication.this.imgExchangeBuf1_ == null || UsbCommunication.this.imgExchangeBuf1_.length < imgRecvBufLength) {
UsbCommunication.this.imgExchangeBuf1_ = new byte[imgRecvBufLength];
}
Logging.trace("Enter ThreadImgReceiver");
byte[] recvbuf = new byte[imgRecvBufLength];
boolean headerFound = false;
int total = 0;
int index = 0;
long t1 = 0;
while (UsbCommunication.this.connected_) {
int len = UsbCommunication.this.recvImg(recvbuf, total, recvbuf.length - total, ItemTouchHelper.Callback.DEFAULT_DRAG_ANIMATION_DURATION);
if (len > 0) {
if (!headerFound) {
if (len >= 28) {
ByteBuffer bb = ByteBuffer.wrap(recvbuf, 0, 28);
bb.order(ByteOrder.LITTLE_ENDIAN);
if (bb.getInt() == UsbCommunication.IMG_START_CODE) {
headerFound = true;
}
}
total = 0;
} else if (len >= 28) {
ByteBuffer bb2 = ByteBuffer.wrap(recvbuf, (total + len) - 28, 28);
bb2.order(ByteOrder.LITTLE_ENDIAN);
if (bb2.getInt() == UsbCommunication.IMG_END_CODE) {
if ((total + len) - 28 == frameBytes) {
int frameIndex = bb2.getInt();
long t = System.currentTimeMillis();
synchronized (UsbCommunication.this.condImgProcess_.cond) {
System.arraycopy(recvbuf, 0, UsbCommunication.this.imgExchangeBuf1_, 0, recvbuf.length);
if (MagApplication.magParameter.basePara1.devType == 0 || MagApplication.magParameter.basePara1.devType == 5 || MagApplication.magParameter.basePara1.devType == 6 || MagApplication.magParameter.basePara1.devType == 3) {
UsbCommunication.this.fpaTemp_ = bb2.getInt();
UsbCommunication.this.camTemp_ = UsbCommunication.this.fpaTemp_ - 500;
drop = bb2.getInt();
} else {
bb2.getInt();
drop = bb2.getInt();
UsbCommunication.this.camTemp_ = bb2.getInt();
UsbCommunication.this.fpaTemp_ = UsbCommunication.this.camTemp_ + 500;
}
if (drop == 0 || drop == 1) {
UsbCommunication.this.condImgProcess_.notified = true;
UsbCommunication.this.condImgProcess_.cond.notify();
}
}
if (UsbCommunication.this.imgViewer_ != null && (index == 0 || !UsbCommunication.this.imgViewer_.getTempStableFlag() || UsbCommunication.this.imgViewer_.getImageStableCounter() != 0)) {
int index2 = index + 1;
if ((index & 15) == 0) {
UsbCommunication.this.handler_.sendEmptyMessage(4);
}
index = index2;
}
if (MagApplication.isShowFps) {
if (t1 != 0) {
UsbCommunication.lock_.lock();
UsbCommunication.ticks_[frameIndex % UsbCommunication.ticks_.length] = t - t1;
UsbCommunication.lock_.unlock();
}
t1 = t;
}
}
headerFound = false;
total = 0;
} else {
total += len;
}
} else {
total += len;
}
if (total > frameBytes) {
headerFound = false;
total = 0;
}
}
}
Logging.trace("Leave ThreadImgReceiver");
}
}
public static int getReceivedFps() {
long[] ticks = new long[ticks_.length];
lock_.lock();
System.arraycopy(ticks_, 0, ticks, 0, ticks_.length);
lock_.unlock();
int sum = 0;
for (int i = ticks.length - 1; i != -1; i--) {
sum = (int) (sum + ticks[i]);
}
return (ticks_.length * 1000) / sum;
}
private class ThreadImgProcess extends Thread {
private ThreadImgProcess() {
}
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
int fpaTemp;
int camTemp;
Logging.trace("Enter ThreadImgProcess");
int frameBytes = ((MagApplication.magParameter.basePara1.fpaWidth * MagApplication.magParameter.basePara1.fpaHeight) * 16) / 8;
byte[] imgExchangeBuf2 = new byte[frameBytes + 1024];
while (!UsbCommunication.this.isExitThreadImgProcess_) {
synchronized (UsbCommunication.this.condImgProcess_.cond) {
while (!UsbCommunication.this.condImgProcess_.notified) {
try {
UsbCommunication.this.condImgProcess_.cond.wait();
} catch (InterruptedException e) {
}
}
UsbCommunication.this.condImgProcess_.notified = false;
if (imgExchangeBuf2 == null) {
imgExchangeBuf2 = new byte[UsbCommunication.this.imgExchangeBuf1_.length];
}
System.arraycopy(UsbCommunication.this.imgExchangeBuf1_, 0, imgExchangeBuf2, 0, UsbCommunication.this.imgExchangeBuf1_.length);
fpaTemp = UsbCommunication.this.fpaTemp_ + MagApplication.magParameter.basePara2.fpaTempFix;
camTemp = UsbCommunication.this.camTemp_ + MagApplication.magParameter.basePara2.fpaTempFix;
}
DeviceController.Lock();
boolean ret = DeviceController.pushFrame(imgExchangeBuf2, fpaTemp, camTemp);
DeviceController.Unlock();
if (UsbCommunication.this.isExitThreadImgProcess_) {
break;
} else if (ret && UsbCommunication.this.imgViewer_ != null) {
UsbCommunication.this.imgViewer_.onNewFrameReceived(fpaTemp, camTemp);
}
}
Logging.trace("Leave ThreadImgProcess");
}
}
private class ThreadCaliRecv extends Thread {
private ThreadCaliRecv() {
}
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
Logging.trace("Enter ThreadRemoteFileReceiver");
byte[] recvbuf = new byte[16384];
int totalSize = 0;
FileOutputStream out = null;
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(0, 0));
long t1 = System.currentTimeMillis();
while (true) {
if (UsbCommunication.this.isExitCaliRecvThread) {
break;
}
int remain = MagApplication.magParameter.caliInfo.size - totalSize;
UsbCommunication usbCommunication = UsbCommunication.this;
if (remain > 16384) {
remain = recvbuf.length;
}
int len = usbCommunication.recvCali(recvbuf, 0, remain, UsbCommunication.TIMEOUT);
if (len >= 0 && !UsbCommunication.this.caliPathName_.isEmpty()) {
if (UsbCommunication.this.isToRecvFirstCaliPacket_) {
totalSize = 0;
UsbCommunication.this.isToRecvFirstCaliPacket_ = false;
}
if (totalSize == 0) {
try {
FileOutputStream out2 = new FileOutputStream(UsbCommunication.this.caliPathName_);
out = out2;
} catch (Exception e) {
Logging.error("Receive remote file error 1.");
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(3, 0));
}
}
totalSize += len;
if (totalSize > MagApplication.magParameter.caliInfo.size) {
try {
out.close();
Logging.error("Receive remote file error 3.");
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(3, 0));
break;
} catch (Exception e2) {
Logging.error("Receive remote file error 2.");
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(3, 0));
}
} else {
try {
out.write(recvbuf, 0, len);
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(2, 0, (totalSize * 100) / MagApplication.magParameter.caliInfo.size));
if (totalSize == MagApplication.magParameter.caliInfo.size) {
try {
out.close();
Logging.info("Receive remote file succ.");
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(1, 0));
if (!UsbCommunication.this.startTransfer(UsbCommunication.this.caliPathName_)) {
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(3, 0));
Logging.error("SDK start fail.");
}
} catch (Exception e3) {
Logging.error("Receive remote file error 5.");
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(3, 0));
}
}
} catch (Exception e4) {
Logging.error("Receive remote file error 4.");
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(3, 0));
}
}
} else if (System.currentTimeMillis() - t1 > Config.BPLUS_DELAY_TIME) {
UsbCommunication.this.handler_.sendMessage(UsbCommunication.this.handler_.obtainMessage(3, 0));
break;
}
}
Logging.trace("Leave ThreadRemoteFileReceiver");
}
}
}
@@ -0,0 +1,246 @@
package cn.com.magnity.magnitycx.sdk;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.telephony.TelephonyManager;
import cn.com.magnity.magnitycx.FragmentMainCenter;
import cn.com.magnity.magnitycx.MagApplication;
import cn.com.magnity.magnitycx.log.Logging;
/* loaded from: classes.dex */
public class UsbConnection extends Observable<DelegateDeviceConnected> {
private static final String ACTION_USB_PERMISSION = "cn.com.magnity.magnitycx.USB_PERMISSION";
private static UsbConnection instance_ = new UsbConnection();
private FragmentMainCenter fragmentMainCenter_;
private PhoneReceiver phoneReceiver_;
private UsbCommunication usbComm_;
private UsbConnectionReceiver usbConnectionReceiver_;
private UsbPermissionReceiver usbPermissionReceiver_;
private Context context_ = MagApplication.getInstance();
private UsbManager usbManager_ = (UsbManager) this.context_.getSystemService("usb");
public static UsbConnection getInstance() {
return instance_;
}
private UsbConnection() {
}
public void setCallbackReceiver(FragmentMainCenter fragment) {
this.fragmentMainCenter_ = fragment;
if (this.usbComm_ != null) {
this.usbComm_.setCallbackReceiver(fragment);
}
}
public boolean init() {
if (this.phoneReceiver_ == null) {
registerPhoneReceiver();
}
if (this.usbConnectionReceiver_ == null) {
registerConnectionReceiver();
}
UsbDevice device = findDevice(33596, 1);
if (device != null) {
requestDevicePermission(device);
}
return device != null;
}
public void deinit(boolean notifyUi) {
if (this.usbConnectionReceiver_ != null) {
this.context_.unregisterReceiver(this.usbConnectionReceiver_);
this.usbConnectionReceiver_ = null;
}
if (this.usbPermissionReceiver_ != null) {
this.context_.unregisterReceiver(this.usbPermissionReceiver_);
this.usbPermissionReceiver_ = null;
}
disconnect(notifyUi);
}
public boolean isConnected() {
return this.usbComm_ != null;
}
/* JADX INFO: Access modifiers changed from: private */
public boolean connect(UsbDevice device) {
if (this.usbComm_ != null) {
return true;
}
Logging.info("Try to connect to device");
try {
this.usbComm_ = new UsbCommunication(this, this.usbManager_, device, this.fragmentMainCenter_);
int ret = this.usbComm_.connect();
if (ret == -1) {
Logging.error("Fail to connect to device, do clean work now");
this.usbComm_.disconnect();
this.usbComm_ = null;
return false;
}
if (ret == 0) {
return false;
}
notifyObervers(1);
return true;
} catch (Exception ex) {
Logging.warn("Exception when connecting to device (" + ex.getMessage() + ")");
if (this.usbComm_ != null) {
this.usbComm_.disconnect();
}
this.usbComm_ = null;
return false;
}
}
public void notifyObervers(int status) {
synchronized (this.observers_) {
if (status == 1) {
for (int i = this.observers_.size() - 1; i != -1; i--) {
((DelegateDeviceConnected) this.observers_.get(i)).onDeviceConnected(this.usbComm_);
}
} else if (status == 2) {
for (int i2 = this.observers_.size() - 1; i2 != -1; i2--) {
}
} else if (status == 0) {
for (int i3 = this.observers_.size() - 1; i3 != -1; i3--) {
((DelegateDeviceConnected) this.observers_.get(i3)).onDeviceDisconnected();
}
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public void disconnect(boolean notifyUi) {
Logging.info("Try to disconnect to device");
if (this.usbComm_ != null) {
this.usbComm_.disconnect();
this.usbComm_ = null;
}
if (notifyUi) {
notifyObervers(0);
}
}
private UsbDevice findDevice(int vendorId, int productId) {
for (UsbDevice device : this.usbManager_.getDeviceList().values()) {
if (device.getVendorId() == vendorId && device.getProductId() == productId) {
return device;
}
}
return null;
}
private void registerConnectionReceiver() {
this.usbConnectionReceiver_ = new UsbConnectionReceiver();
IntentFilter localFilter = new IntentFilter();
localFilter.addAction("android.hardware.usb.action.USB_DEVICE_ATTACHED");
localFilter.addAction("android.hardware.usb.action.USB_DEVICE_DETACHED");
this.context_.registerReceiver(this.usbConnectionReceiver_, localFilter);
}
private void registerPhoneReceiver() {
this.phoneReceiver_ = new PhoneReceiver();
IntentFilter localFilter = new IntentFilter();
localFilter.addAction("android.intent.action.NEW_OUTGOING_CALL");
localFilter.addAction("android.intent.action.PHONE_STATE");
this.context_.registerReceiver(this.phoneReceiver_, localFilter);
}
private void requestDevicePermission(UsbDevice device) {
if (this.usbManager_.hasPermission(device)) {
Logging.trace("Already has permission");
connect(device);
return;
}
if (this.usbPermissionReceiver_ == null) {
this.usbPermissionReceiver_ = new UsbPermissionReceiver();
IntentFilter localFilter = new IntentFilter(ACTION_USB_PERMISSION);
this.context_.registerReceiver(this.usbPermissionReceiver_, localFilter);
}
PendingIntent pendingIntent = PendingIntent.getBroadcast(this.context_, 0, new Intent(ACTION_USB_PERMISSION), 0);
this.usbManager_.requestPermission(device, pendingIntent);
Logging.trace("Request permission");
}
private final class UsbConnectionReceiver extends BroadcastReceiver {
private UsbConnectionReceiver() {
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) {
case "android.hardware.usb.action.USB_DEVICE_ATTACHED":
Logging.trace("Broadcast for usb attached received");
UsbConnection.this.disconnect(false);
UsbConnection.this.init();
break;
case "android.hardware.usb.action.USB_DEVICE_DETACHED":
Logging.trace("Broadcast for usb detached received");
UsbConnection.this.disconnect(true);
break;
}
}
}
private final class UsbPermissionReceiver extends BroadcastReceiver {
private UsbPermissionReceiver() {
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) {
case "cn.com.magnity.magnitycx.USB_PERMISSION":
Logging.trace("Broadcast for usb permission received");
if (!intent.getBooleanExtra("permission", false)) {
Logging.warn("Permission rejected by user");
break;
} else {
UsbDevice device = (UsbDevice) intent.getParcelableExtra("device");
if (device != null) {
UsbConnection.this.connect(device);
UsbConnection.this.context_.unregisterReceiver(UsbConnection.this.usbPermissionReceiver_);
UsbConnection.this.usbPermissionReceiver_ = null;
break;
} else {
Logging.warn("Failed to get device");
break;
}
}
}
}
}
private class PhoneReceiver extends BroadcastReceiver {
private PhoneReceiver() {
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) {
case "android.intent.action.PHONE_STATE":
if (MagApplication.magParameter.basePara1.swVersion > 100) {
String state = intent.getStringExtra("state");
if (state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING)) {
Logging.trace("ring");
UsbConnection.this.deinit(true);
break;
} else if (state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_IDLE)) {
Logging.trace("hang up");
UsbConnection.this.init();
break;
} else if (state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_OFFHOOK)) {
Logging.trace("hang on");
break;
}
}
break;
}
}
}
}
@@ -0,0 +1,103 @@
package cn.com.magnity.magnitycx.sdk;
import android.hardware.Camera;
import android.view.SurfaceHolder;
import cn.com.magnity.magnitycx.MagApplication;
import java.util.List;
/* loaded from: classes.dex */
public class VisibleCamera {
private static Camera camera_;
private static boolean isPreview_;
public static void initCamera(int id, SurfaceHolder surfaceHolder, int size) {
if (Camera.getNumberOfCameras() >= 1) {
if (!isPreview_) {
camera_ = Camera.open(id);
setPreviewOrientation(id);
}
if (camera_ != null && !isPreview_) {
try {
Camera.Parameters parameters = camera_.getParameters();
setPreviewSize(parameters, size);
parameters.setPictureFormat(256);
parameters.set("jpeg-quality", 85);
parameters.setFlashMode("auto");
parameters.setFocusMode("continuous-picture");
camera_.setParameters(parameters);
camera_.setPreviewDisplay(surfaceHolder);
camera_.startPreview();
camera_.cancelAutoFocus();
} catch (Exception e) {
}
isPreview_ = true;
}
}
}
public static void deinitCamera() {
if (camera_ != null) {
if (isPreview_) {
camera_.stopPreview();
isPreview_ = false;
}
camera_.release();
camera_ = null;
}
}
private static void setPreviewSize(Camera.Parameters parameters, int size) {
List<Camera.Size> list = parameters.getSupportedPreviewSizes();
int num = list.size();
for (int i = 0; i < num; i++) {
Camera.Size s = list.get(i);
if ((s.width <= s.height || s.width * 3 == s.height * 4) && ((s.width >= s.height || s.width * 4 == s.height * 3) && Math.min(s.width, s.height) >= size)) {
parameters.setPreviewSize(s.width, s.height);
return;
}
}
}
private static void setPreviewOrientation(int id) {
int result;
if (camera_ != null) {
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(id, info);
int rotation = MagApplication.windowManager.getDefaultDisplay().getRotation();
int degrees = 0;
switch (rotation) {
case 0:
degrees = 0;
break;
case 1:
degrees = 90;
break;
case 2:
degrees = 180;
break;
case 3:
degrees = 270;
break;
}
if (info.facing == 1) {
int result2 = (info.orientation + degrees) % 360;
result = (360 - result2) % 360;
} else {
result = ((info.orientation - degrees) + 360) % 360;
}
camera_.setDisplayOrientation(result);
}
}
public static boolean isCameraPermission() {
if (camera_ != null) {
return true;
}
try {
Camera.open().release();
return true;
} catch (Exception e) {
return false;
}
}
}
@@ -0,0 +1,291 @@
package cn.com.magnity.magnitycx.sdk;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.hardware.Camera;
import android.media.ExifInterface;
import android.net.Uri;
import android.view.SurfaceHolder;
import cn.com.magnity.magnitycx.MagApplication;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/* loaded from: classes.dex */
public class VisibleCameraHelper {
private static volatile VisibleCameraHelper instance_;
private Camera camera_;
private final CameraSizeComparator sizeComparator = new CameraSizeComparator();
private Camera.PictureCallback jpegCallback = new Camera.PictureCallback() { // from class: cn.com.magnity.magnitycx.sdk.VisibleCameraHelper.1
@Override // android.hardware.Camera.PictureCallback
public void onPictureTaken(byte[] data, Camera camera) {
try {
Bitmap bm = BitmapFactory.decodeByteArray(data, 0, data.length);
File myCaptureFile = new File(MagApplication.magParameter.mediaDir, "1.jpg");
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(myCaptureFile));
bm.compress(Bitmap.CompressFormat.JPEG, 100, bos);
bos.flush();
bos.close();
camera.stopPreview();
camera.startPreview();
} catch (Exception e) {
e.printStackTrace();
}
}
};
public int getOrientation(Context context, Uri photoUri) {
Cursor cursor = context.getContentResolver().query(photoUri, new String[]{"_id", "orientation"}, null, null, null);
if (cursor == null) {
return 0;
}
cursor.moveToFirst();
int i = cursor.getInt(cursor.getColumnIndexOrThrow("orientation"));
cursor.close();
return i;
}
public int getExifOrientation(String filepath) {
int orientation;
ExifInterface exif = null;
try {
ExifInterface exif2 = new ExifInterface(filepath);
exif = exif2;
} catch (IOException ex) {
ex.printStackTrace();
}
if (exif == null || (orientation = exif.getAttributeInt("Orientation", -1)) == -1) {
return 0;
}
switch (orientation) {
}
return 0;
}
public static VisibleCameraHelper getInstance() {
if (instance_ == null) {
synchronized (VisibleCameraHelper.class) {
if (instance_ == null) {
instance_ = new VisibleCameraHelper();
}
}
}
return instance_;
}
public boolean openCamera(int id) {
if (Camera.getNumberOfCameras() < 1) {
return false;
}
if (this.camera_ != null) {
stopPreview();
closeCamera();
}
try {
this.camera_ = Camera.open(id);
return this.camera_ != null;
} catch (Exception e) {
return false;
}
}
public void closeCamera() {
if (this.camera_ != null) {
this.camera_.release();
this.camera_ = null;
}
}
public Size setPreviewSize(int expectedWidth, float rate) {
Camera.Parameters parameters;
if (this.camera_ == null || (parameters = this.camera_.getParameters()) == null) {
return null;
}
List<Camera.Size> list = parameters.getSupportedPreviewSizes();
Collections.sort(list, this.sizeComparator);
Camera.Size size = null;
int num = list.size();
int i = 0;
while (i < num) {
Camera.Size size2 = list.get(i);
size = size2;
if (size.width > expectedWidth && equalRate(size, rate)) {
break;
}
i++;
}
if (i == num) {
return null;
}
parameters.setPreviewSize(size.width, size.height);
this.camera_.setParameters(parameters);
return new Size(size.width, size.height);
}
public Size setPictureSize(int expectedWidth, float rate) {
Camera.Parameters parameters;
if (this.camera_ == null || (parameters = this.camera_.getParameters()) == null) {
return null;
}
List<Camera.Size> list = parameters.getSupportedPictureSizes();
Collections.sort(list, this.sizeComparator);
Camera.Size size = null;
int num = list.size();
int i = 0;
while (i < num) {
Camera.Size size2 = list.get(i);
size = size2;
if (size.width > expectedWidth && equalRate(size, rate)) {
break;
}
i++;
}
if (i == num) {
return null;
}
parameters.setPictureSize(size.width, size.height);
this.camera_.setParameters(parameters);
return new Size(size.width, size.height);
}
private boolean equalRate(Camera.Size s, float rate) {
float r = s.width / s.height;
return ((double) Math.abs(r - rate)) <= 0.1d;
}
public boolean startPreview(SurfaceHolder holder, int flashMode) {
String mode;
if (this.camera_ == null) {
return false;
}
stopPreview();
try {
this.camera_.setPreviewDisplay(holder);
Camera.Parameters parameters = this.camera_.getParameters();
if (parameters != null) {
switch (flashMode) {
case 0:
mode = "off";
break;
case 1:
mode = "auto";
break;
case 2:
mode = "on";
break;
case 3:
mode = "red-eye";
break;
case 4:
mode = "torch";
break;
default:
mode = "off";
break;
}
parameters.setFlashMode(mode);
this.camera_.setParameters(parameters);
}
this.camera_.startPreview();
return true;
} catch (IOException e) {
return false;
}
}
public void stopPreview() {
if (this.camera_ != null) {
this.camera_.stopPreview();
}
}
public int setPreviewOrientation(int cameraId) {
int result;
if (this.camera_ == null) {
return 0;
}
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(cameraId, info);
int rotation = MagApplication.windowManager.getDefaultDisplay().getRotation();
int degrees = 0;
switch (rotation) {
case 0:
degrees = 0;
break;
case 1:
degrees = 90;
break;
case 2:
degrees = 180;
break;
case 3:
degrees = 270;
break;
}
if (info.facing == 1) {
int result2 = (info.orientation + degrees) % 360;
result = (360 - result2) % 360;
} else {
result = ((info.orientation - degrees) + 360) % 360;
}
this.camera_.setDisplayOrientation(result);
return result;
}
public void takePicture() {
if (this.camera_ != null) {
this.camera_.takePicture(null, null, this.jpegCallback);
}
}
private class CameraSizeComparator implements Comparator<Camera.Size> {
private CameraSizeComparator() {
}
@Override // java.util.Comparator
public int compare(Camera.Size lhs, Camera.Size rhs) {
if (lhs.width == rhs.width) {
return 0;
}
if (lhs.width > rhs.width) {
return 1;
}
return -1;
}
}
public class Size {
private int height_;
private int width_;
public Size() {
}
public Size(int width, int height) {
this.width_ = width;
this.height_ = height;
}
public void setWidth(int width) {
this.width_ = width;
}
public void setHeight(int height) {
this.height_ = height;
}
public int getWidth() {
return this.width_;
}
public int getHeight() {
return this.height_;
}
}
}
@@ -0,0 +1,7 @@
package cn.com.magnity.magnitycx.sdk;
/* loaded from: classes.dex */
public class WaitCondition {
public final Object cond = new Object();
public volatile boolean notified = false;
}
@@ -0,0 +1,315 @@
package cn.com.magnity.magnitycx.upgrade;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.support.v4.content.FileProvider;
import cn.com.magnity.magnitycx.MagApplication;
import cn.com.magnity.magnitycx.MainActivity;
import cn.com.magnity.magnitycx.R;
import cn.com.magnity.magnitycx.log.Logging;
import java.io.File;
import java.util.Locale;
import org.apache.log4j.Priority;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class CheckVersionTask implements Runnable {
private static final int CHECK_ERROR = -1;
private static final int CHECK_OK = 0;
private static final String UPGRADEINFO_DESC = "description";
private static final String UPGRADEINFO_FORCE = "forceUpgrade";
private static final String UPGRADEINFO_URL = "url";
private static final String UPGRADEINFO_VERSIONCODE = "versionCode";
private static final String UPGRADEINFO_VERSIONNAME = "versionName";
public static final int UPGRADE_BEGIN = 1;
private static final int UPGRADE_ERROR = -2;
public static final int UPGRADE_FINISHED = 3;
public static final int UPGRADE_RECEIVED_SIZE = 2;
private Context ctx_;
private boolean isForceUpgrade_;
private int localVersion_;
Handler handler_ = new Handler() { // from class: cn.com.magnity.magnitycx.upgrade.CheckVersionTask.1
@Override // android.os.Handler
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case -2:
if (CheckVersionTask.this.progressDialog_ != null) {
CheckVersionTask.this.progressDialog_.dismiss();
CheckVersionTask.this.progressDialog_ = null;
}
AlertDialog.Builder builder = new AlertDialog.Builder(CheckVersionTask.this.ctx_);
builder.setTitle(R.string.upgradeError);
builder.setPositiveButton(R.string.labelOK, new DialogInterface.OnClickListener() { // from class: cn.com.magnity.magnitycx.upgrade.CheckVersionTask.1.1
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialog, int which) {
CheckVersionTask.this.unlockScreen();
}
});
AlertDialog dialog = builder.create();
dialog.setCanceledOnTouchOutside(false);
dialog.show();
break;
case -1:
CheckVersionTask.this.unlockScreen();
break;
case 0:
CheckVersionTask.this.lockScreen();
Bundle bundle = msg.getData();
CheckVersionTask.this.isForceUpgrade_ = bundle.getBoolean(CheckVersionTask.UPGRADEINFO_FORCE);
CheckVersionTask.this.showUpgradeDialog(bundle.getString(CheckVersionTask.UPGRADEINFO_DESC), bundle.getString(CheckVersionTask.UPGRADEINFO_URL), bundle.getString(CheckVersionTask.UPGRADEINFO_VERSIONNAME), bundle.getInt(CheckVersionTask.UPGRADEINFO_VERSIONCODE), CheckVersionTask.this.isForceUpgrade_);
break;
case 1:
CheckVersionTask.this.progressDialog_ = new ProgressDialog(CheckVersionTask.this.ctx_);
CheckVersionTask.this.progressDialog_.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: cn.com.magnity.magnitycx.upgrade.CheckVersionTask.1.2
@Override // android.content.DialogInterface.OnCancelListener
public void onCancel(DialogInterface dialog2) {
CheckVersionTask.this.stopDownloadApk();
CheckVersionTask.this.unlockScreen();
if (CheckVersionTask.this.isForceUpgrade_ && (CheckVersionTask.this.ctx_ instanceof MainActivity)) {
((MainActivity) CheckVersionTask.this.ctx_).onBackPressed();
}
}
});
CheckVersionTask.this.progressDialog_.setProgressStyle(1);
CheckVersionTask.this.progressDialog_.setMessage(CheckVersionTask.this.ctx_.getResources().getString(R.string.upgrading));
CheckVersionTask.this.progressDialog_.setProgressNumberFormat("%1d KB/%2d KB");
CheckVersionTask.this.progressDialog_.setProgress(0);
CheckVersionTask.this.progressDialog_.setMax(msg.arg1 / 1000);
CheckVersionTask.this.progressDialog_.setCanceledOnTouchOutside(false);
CheckVersionTask.this.progressDialog_.show();
break;
case 2:
if (CheckVersionTask.this.progressDialog_ != null) {
CheckVersionTask.this.progressDialog_.setProgress(msg.arg1 / 1000);
break;
}
break;
case 3:
if (CheckVersionTask.this.progressDialog_ != null) {
CheckVersionTask.this.progressDialog_.dismiss();
CheckVersionTask.this.progressDialog_ = null;
}
CheckVersionTask.this.unlockScreen();
if (msg.obj != null && (msg.obj instanceof File)) {
CheckVersionTask.this.installApk((File) msg.obj);
break;
}
break;
}
}
};
private ProgressDialog progressDialog_ = null;
private Thread threadUpgrading_ = null;
public CheckVersionTask(Context ctx, int localVersion) {
this.ctx_ = ctx;
this.localVersion_ = localVersion;
}
public void stopDownload() {
stopDownloadApk();
}
public UpgradeInfo parseVersionInfo(String str) throws Exception {
UpgradeInfo info = null;
JSONObject object = new JSONObject(str);
if (object != null && object.length() >= 1) {
String productType = this.ctx_.getString(R.string.upgradeID);
if (object.has(productType)) {
JSONArray array = object.getJSONArray(productType);
if (array.length() > 0) {
JSONObject obj = array.getJSONObject(array.length() - 1);
info = new UpgradeInfo();
if (obj.has("verName")) {
info.setVersionName(obj.getString("verName"));
}
if (obj.has("verCode")) {
info.setVersionCode(obj.getInt("verCode"));
}
if (obj.has("apkUrl")) {
info.setApkUrl(obj.getString("apkUrl"));
}
try {
Configuration config = this.ctx_.getResources().getConfiguration();
if (!config.locale.getLanguage().equals(Locale.CHINA.getLanguage()) || !config.locale.getCountry().equals(Locale.CHINA.getCountry())) {
if (obj.has("description-en")) {
info.setDescription(obj.getString("description-en"));
}
} else if (obj.has(UPGRADEINFO_DESC)) {
info.setDescription(obj.getString(UPGRADEINFO_DESC));
}
} catch (Exception e) {
}
if (obj.has(UPGRADEINFO_FORCE)) {
info.setForceUpgrade(obj.getBoolean(UPGRADEINFO_FORCE));
}
}
}
}
return info;
}
/* JADX INFO: Access modifiers changed from: private */
public void lockScreen() {
if (this.ctx_ instanceof Activity) {
((Activity) this.ctx_).setRequestedOrientation(14);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void unlockScreen() {
if (this.ctx_ instanceof Activity) {
((Activity) this.ctx_).setRequestedOrientation(10);
}
}
@Override // java.lang.Runnable
public void run() {
String path = this.ctx_.getResources().getString(R.string.remote_url);
try {
String str = HttpHelper.GetRemoteVersionInfo(path, 10000, Priority.INFO_INT);
UpgradeInfo upgradeInfo = parseVersionInfo(str);
if (upgradeInfo == null) {
Logging.info("Parse version info fail.");
this.handler_.sendEmptyMessage(-1);
} else if (upgradeInfo.getVersionCode() > this.localVersion_) {
Logging.info("New app version is detected(" + upgradeInfo.getVersionCode() + ")");
Message msg = new Message();
msg.what = 0;
Bundle bundle = new Bundle();
bundle.putBoolean(UPGRADEINFO_FORCE, upgradeInfo.isForceUpgrade());
bundle.putString(UPGRADEINFO_DESC, upgradeInfo.getDescription());
bundle.putString(UPGRADEINFO_URL, upgradeInfo.getApkUrl());
bundle.putString(UPGRADEINFO_VERSIONNAME, upgradeInfo.getVersionName());
bundle.putInt(UPGRADEINFO_VERSIONCODE, upgradeInfo.getVersionCode());
msg.setData(bundle);
this.handler_.sendMessage(msg);
}
} catch (Exception ex) {
this.handler_.sendEmptyMessage(-1);
Logging.error("Check upgrade error(" + ex.getMessage() + ")");
}
}
/* JADX INFO: Access modifiers changed from: private */
public void showUpgradeDialog(String description, final String url, final String versionName, final int versionCode, boolean isForceUpgrade) {
AlertDialog.Builder builer = new AlertDialog.Builder(this.ctx_);
builer.setTitle(this.ctx_.getResources().getString(R.string.upgrade) + "(V" + versionName + ")");
builer.setMessage(description);
builer.setPositiveButton(R.string.labelOK, new DialogInterface.OnClickListener() { // from class: cn.com.magnity.magnitycx.upgrade.CheckVersionTask.2
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialog, int which) {
String path = MagApplication.magParameter.otherDir + File.separator + "MAG-Cx." + versionName + ".apk";
File file = new File(path);
if (file.exists()) {
PackageManager pm = CheckVersionTask.this.ctx_.getPackageManager();
PackageInfo packInfo = pm.getPackageArchiveInfo(path, 1);
if (packInfo == null || packInfo.versionCode != versionCode) {
CheckVersionTask.this.startDownloadApk(url, versionName);
return;
} else {
CheckVersionTask.this.installApk(file);
return;
}
}
CheckVersionTask.this.startDownloadApk(url, versionName);
}
});
if (!isForceUpgrade) {
builer.setNegativeButton(R.string.labelCancel, new DialogInterface.OnClickListener() { // from class: cn.com.magnity.magnitycx.upgrade.CheckVersionTask.3
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialog, int which) {
CheckVersionTask.this.unlockScreen();
}
});
} else {
builer.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: cn.com.magnity.magnitycx.upgrade.CheckVersionTask.4
@Override // android.content.DialogInterface.OnCancelListener
public void onCancel(DialogInterface dialog) {
if (CheckVersionTask.this.ctx_ instanceof MainActivity) {
((MainActivity) CheckVersionTask.this.ctx_).onBackPressed();
}
}
});
}
AlertDialog dialog = builer.create();
dialog.setCanceledOnTouchOutside(false);
dialog.show();
}
/* JADX INFO: Access modifiers changed from: private */
public void startDownloadApk(final String url, final String version) {
HttpHelper.isCancelled = false;
this.threadUpgrading_ = new Thread() { // from class: cn.com.magnity.magnitycx.upgrade.CheckVersionTask.5
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
try {
File file = HttpHelper.getRemoteApk(url, version, 10000, 30000, CheckVersionTask.this.handler_);
if (file == null) {
CheckVersionTask.this.handler_.sendEmptyMessage(-2);
} else {
CheckVersionTask.this.handler_.sendMessage(CheckVersionTask.this.handler_.obtainMessage(3, file));
}
} catch (Exception ex) {
Logging.error("Upgrading error(" + ex.getMessage() + ")");
CheckVersionTask.this.handler_.sendEmptyMessage(-2);
}
}
};
this.threadUpgrading_.start();
}
/* JADX INFO: Access modifiers changed from: private */
public void stopDownloadApk() {
HttpHelper.isCancelled = true;
try {
this.threadUpgrading_.join(500L);
this.threadUpgrading_ = null;
} catch (Exception e) {
this.threadUpgrading_ = null;
}
}
private File getOthersStoragePath(Context context) {
File file;
String state = Environment.getExternalStorageState();
if ("mounted".equals(state) && (file = new File(Environment.getExternalStorageDirectory(), "magnity/Cx/others")) != null) {
if (!file.exists()) {
file.mkdirs();
return file;
}
return file;
}
return null;
}
/* JADX INFO: Access modifiers changed from: private */
public void installApk(File file) {
Intent installIntent = new Intent("android.intent.action.VIEW");
installIntent.setFlags(268435456);
File usedFile = new File(getOthersStoragePath(this.ctx_), file.getName());
if (Build.VERSION.SDK_INT >= 24) {
installIntent.setFlags(1);
Uri contentUri = FileProvider.getUriForFile(this.ctx_, "cn.com.magnity.magnitycx.fileprovider", usedFile);
installIntent.setDataAndType(contentUri, "application/vnd.android.package-archive");
} else {
installIntent.setDataAndType(Uri.fromFile(usedFile), "application/vnd.android.package-archive");
}
this.ctx_.startActivity(installIntent);
}
}
@@ -0,0 +1,224 @@
package cn.com.magnity.magnitycx.upgrade;
import android.os.Handler;
import cn.com.magnity.magnitycx.MagApplication;
import cn.com.magnity.magnitycx.log.Logging;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
/* loaded from: classes.dex */
public class HttpHelper {
public static volatile boolean isCancelled;
public static String GetRemoteVersionInfo(String path, int connTimeout, int readTimeout) throws Exception {
String str;
BufferedReader br = null;
InputStream is = null;
try {
URL url = new URL(path);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(connTimeout);
conn.setReadTimeout(readTimeout);
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept-Language", "zh-CN");
conn.setRequestProperty("Charset", "UTF-8");
conn.setRequestProperty("Connextion", "Keep-Alive");
int code = conn.getResponseCode();
if (code == 302) {
URL url2 = new URL(conn.getHeaderField("Location"));
conn = (HttpURLConnection) url2.openConnection();
conn.setConnectTimeout(connTimeout);
conn.setReadTimeout(readTimeout);
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept-Language", "zh-CN");
conn.setRequestProperty("Charset", "UTF-8");
conn.setRequestProperty("Connextion", "Keep-Alive");
code = conn.getResponseCode();
}
if (code == 200) {
is = conn.getInputStream();
BufferedReader br2 = new BufferedReader(new InputStreamReader(is));
try {
StringBuffer stringBuffer = new StringBuffer("");
String newLine = System.getProperty("line.separator");
while (true) {
String line = br2.readLine();
if (line == null) {
break;
}
stringBuffer.append(line + newLine);
}
if (stringBuffer.length() > 0) {
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
}
br2.close();
is.close();
str = stringBuffer.toString();
if (br2 != null) {
try {
br2.close();
} catch (IOException e) {
Logging.error("Fail to get remote info because of io error.");
}
}
if (is != null) {
is.close();
}
} catch (Throwable th) {
th = th;
br = br2;
if (br != null) {
try {
br.close();
} catch (IOException e2) {
Logging.error("Fail to get remote info because of io error.");
throw th;
}
}
if (is != null) {
is.close();
}
throw th;
}
} else {
Logging.error("Get error respond(" + code + ")");
str = "";
if (0 != 0) {
try {
br.close();
} catch (IOException e3) {
Logging.error("Fail to get remote info because of io error.");
}
}
if (0 != 0) {
is.close();
}
}
return str;
} catch (Throwable th2) {
th = th2;
}
}
public static File getRemoteApk(String path, String version, int connTimeout, int readTimeout, Handler handler) throws Exception {
File file;
FileOutputStream fos;
int total;
int len;
FileOutputStream fos2 = null;
BufferedInputStream bis = null;
InputStream is = null;
try {
URL url = new URL(path);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(connTimeout);
conn.setReadTimeout(readTimeout);
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept-Language", "zh-CN");
conn.setRequestProperty("Charset", "UTF-8");
conn.setRequestProperty("Connextion", "Keep-Alive");
int code = conn.getResponseCode();
if (code == 302) {
URL url2 = new URL(conn.getHeaderField("Location"));
conn = (HttpURLConnection) url2.openConnection();
conn.setConnectTimeout(connTimeout);
conn.setReadTimeout(readTimeout);
conn.setRequestProperty("Accept-Encoding", "identity");
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept-Language", "zh-CN");
conn.setRequestProperty("Charset", "UTF-8");
conn.setRequestProperty("Connextion", "Keep-Alive");
code = conn.getResponseCode();
}
if (code == 200) {
int size = conn.getContentLength();
handler.sendMessage(handler.obtainMessage(1, size, 0));
is = conn.getInputStream();
BufferedInputStream bis2 = new BufferedInputStream(is);
try {
file = new File(MagApplication.magParameter.otherDir, "MAG-Cx." + version + ".apk");
if (file.exists()) {
file.delete();
}
fos = new FileOutputStream(file);
total = 0;
} catch (Throwable th) {
th = th;
bis = bis2;
}
try {
byte[] buf = new byte[1024];
while (!isCancelled && (len = bis2.read(buf)) != -1) {
fos.write(buf, 0, len);
total += len;
handler.sendMessage(handler.obtainMessage(2, total, 0));
}
fos.close();
bis2.close();
is.close();
if (total != size) {
file = null;
}
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
Logging.error("Fail to get remote file because of io error.");
}
}
if (bis2 != null) {
bis2.close();
}
if (is != null) {
is.close();
}
} catch (Throwable th2) {
th = th2;
bis = bis2;
fos2 = fos;
if (fos2 != null) {
try {
fos2.close();
} catch (IOException e2) {
Logging.error("Fail to get remote file because of io error.");
throw th;
}
}
if (bis != null) {
bis.close();
}
if (is != null) {
is.close();
}
throw th;
}
} else {
Logging.error("Get error respond(" + code + ")");
file = null;
if (0 != 0) {
try {
fos2.close();
} catch (IOException e3) {
Logging.error("Fail to get remote file because of io error.");
}
}
if (0 != 0) {
bis.close();
}
if (0 != 0) {
is.close();
}
}
return file;
} catch (Throwable th3) {
th = th3;
}
}
}
@@ -0,0 +1,50 @@
package cn.com.magnity.magnitycx.upgrade;
/* loaded from: classes.dex */
public class UpgradeInfo {
private String apkUrl_;
private String description_;
private boolean isForceUpgrade_;
private int versionCode_;
private String versionName_;
public void setVersionName(String name) {
this.versionName_ = name;
}
public String getVersionName() {
return this.versionName_;
}
public void setVersionCode(int code) {
this.versionCode_ = code;
}
public int getVersionCode() {
return this.versionCode_;
}
public void setDescription(String description) {
this.description_ = description;
}
public String getDescription() {
return this.description_;
}
public void setApkUrl(String url) {
this.apkUrl_ = url;
}
public String getApkUrl() {
return this.apkUrl_;
}
public void setForceUpgrade(boolean b) {
this.isForceUpgrade_ = b;
}
public boolean isForceUpgrade() {
return this.isForceUpgrade_;
}
}
@@ -0,0 +1,67 @@
package cn.com.magnity.magnitycx.upgrade;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import cn.com.magnity.magnitycx.log.Logging;
/* loaded from: classes.dex */
public class UpgradeManager {
private Context ctx_;
private CheckVersionTask task_;
private Thread thread_;
public UpgradeManager(Context ctx) {
this.ctx_ = ctx;
}
public boolean start() {
if (!checkNetWorkStatus(this.ctx_)) {
return false;
}
this.task_ = new CheckVersionTask(this.ctx_, getLocalVersionCode(this.ctx_));
this.thread_ = new Thread(this.task_);
this.thread_.start();
return true;
}
public void stop() {
if (this.task_ != null) {
this.task_.stopDownload();
try {
this.thread_.join(500L);
} catch (InterruptedException e) {
}
this.thread_ = null;
this.task_ = null;
}
}
private int getLocalVersionCode(Context ctx) {
PackageManager packageManager = ctx.getPackageManager();
try {
PackageInfo packInfo = packageManager.getPackageInfo(ctx.getPackageName(), 0);
return packInfo.versionCode;
} catch (PackageManager.NameNotFoundException ex) {
Logging.warn("Fail to get packet name(" + ex.getMessage() + ")");
return 100;
}
}
public static boolean checkNetWorkStatus(Context context) {
try {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService("connectivity");
NetworkInfo netinfo = cm.getActiveNetworkInfo();
if (netinfo != null) {
if (netinfo.isConnected()) {
return true;
}
}
return false;
} catch (Exception e) {
return false;
}
}
}
@@ -0,0 +1,27 @@
package cn.com.magnity.magnitycx.util;
import android.app.Activity;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import java.util.ArrayList;
/* loaded from: classes.dex */
public final class ActivityUtils {
public static boolean requestRuntimePermission(Activity activity, String[] permissionTypes, int requestCode) {
if (permissionTypes == null) {
return false;
}
ArrayList<String> permissions = new ArrayList<>();
for (int i = 0; i < permissionTypes.length; i++) {
String permissionType = permissionTypes[i];
if (ContextCompat.checkSelfPermission(activity, permissionType) != 0) {
permissions.add(permissionTypes[i]);
}
}
if (permissions.isEmpty()) {
return true;
}
ActivityCompat.requestPermissions(activity, (String[]) permissions.toArray(new String[permissions.size()]), requestCode);
return false;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,842 @@
0000000000105cb8 0000000000105cd1 _init
0000000000105ce0 0000000000105ceb FUN_00105ce0
0000000000105cf0 0000000000105cf5 exp
0000000000105d00 0000000000105d05 pthread_getspecific
0000000000105d10 0000000000105d15 pthread_cond_destroy
0000000000105d20 0000000000105d25 libusb_cancel_transfer
0000000000105d30 0000000000105d35 libusb_get_device_address
0000000000105d40 0000000000105d45 memset
0000000000105d50 0000000000105d55 ftell
0000000000105d60 0000000000105d65 libusb_close
0000000000105d70 0000000000105d75 libusb_get_active_config_descriptor
0000000000105d80 0000000000105d85 libusb_unref_device
0000000000105d90 0000000000105d95 close
0000000000105da0 0000000000105da5 libusb_unlock_event_waiters
0000000000105db0 0000000000105db5 libusb_open
0000000000105dc0 0000000000105dc5 MAG_Free
0000000000105dd0 0000000000105dd5 ioctl
0000000000105de0 0000000000105de5 libusb_claim_interface
0000000000105df0 0000000000105df5 pthread_setspecific
0000000000105e00 0000000000105e05 libusb_alloc_transfer
0000000000105e10 0000000000105e15 libusb_set_configuration
0000000000105e20 0000000000105e25 __gmon_start__
0000000000105e30 0000000000105e35 recvmsg
0000000000105e40 0000000000105e45 operator.new[]
0000000000105e50 0000000000105e55 uname
0000000000105e60 0000000000105e65 fseek
0000000000105e70 0000000000105e75 pthread_cond_signal
0000000000105e80 0000000000105e85 operator.delete
0000000000105e90 0000000000105e95 _M_dispose
0000000000105ea0 0000000000105ea5 pthread_mutexattr_destroy
0000000000105eb0 0000000000105eb5 libusb_free_device_list
0000000000105ec0 0000000000105ec5 __assert_fail
0000000000105ed0 0000000000105ed5 __printf_chk
0000000000105ee0 0000000000105ee5 gettimeofday
0000000000105ef0 0000000000105ef5 MAG_GetRectTemperatureInfo
0000000000105f00 0000000000105f05 libusb_get_device_list
0000000000105f10 0000000000105f15 Init
0000000000105f20 0000000000105f25 MAG_GetCamInfo
0000000000105f30 0000000000105f35 read
0000000000105f40 0000000000105f45 strncmp
0000000000105f50 0000000000105f55 malloc
0000000000105f60 0000000000105f65 fopen
0000000000105f70 0000000000105f75 libusb_control_transfer
0000000000105f80 0000000000105f85 pthread_cond_timedwait
0000000000105f90 0000000000105f95 __memcpy_chk
0000000000105fa0 0000000000105fa5 libusb_get_config_descriptor
0000000000105fb0 0000000000105fb5 __cxa_atexit
0000000000105fc0 0000000000105fc5 libusb_try_lock_events
0000000000105fd0 0000000000105fd5 setsockopt
0000000000105fe0 0000000000105fe5 MAG_StopProcessImage
0000000000105ff0 0000000000105ff5 pthread_mutex_init
0000000000106000 0000000000106005 fgets
0000000000106010 0000000000106015 __vsnprintf_chk
0000000000106020 0000000000106025 libusb_handle_events_timeout_completed
0000000000106030 0000000000106035 pthread_attr_destroy
0000000000106040 0000000000106045 libusb_has_capability
0000000000106050 0000000000106055 getpwuid
0000000000106060 0000000000106065 operator<<
0000000000106070 0000000000106075 __strdup
0000000000106080 0000000000106085 free
0000000000106090 0000000000106095 libusb_get_bus_number
00000000001060a0 00000000001060a5 strlen
00000000001060b0 00000000001060b5 libusb_free_config_descriptor
00000000001060c0 00000000001060c5 _M_destroy
00000000001060d0 00000000001060d5 __asprintf_chk
00000000001060e0 00000000001060e5 pthread_create
00000000001060f0 00000000001060f5 opendir
0000000000106100 0000000000106105 __xstat
0000000000106110 0000000000106115 pthread_cond_init
0000000000106120 0000000000106125 libusb_submit_transfer
0000000000106130 0000000000106135 __ctype_b_loc
0000000000106140 0000000000106145 __cxa_finalize
0000000000106150 0000000000106155 libusb_event_handler_active
0000000000106160 0000000000106165 pthread_key_delete
0000000000106170 0000000000106175 readdir
0000000000106180 0000000000106185 libusb_ref_device
0000000000106190 0000000000106195 libusb_handle_events_timeout
00000000001061a0 00000000001061a5 libusb_exit
00000000001061b0 00000000001061b5 strrchr
00000000001061c0 00000000001061c5 syscall
00000000001061d0 00000000001061d5 libusb_free_bos_descriptor
00000000001061e0 00000000001061e5 sscanf
00000000001061f0 00000000001061f5 libusb_wait_for_event
0000000000106200 0000000000106205 libusb_init
0000000000106210 0000000000106215 pipe
0000000000106220 0000000000106225 libusb_free_transfer
0000000000106230 0000000000106235 pthread_join
0000000000106240 0000000000106245 poll
0000000000106250 0000000000106255 pthread_mutex_trylock
0000000000106260 0000000000106265 libusb_unlock_events
0000000000106270 0000000000106275 pow
0000000000106280 0000000000106285 libusb_set_auto_detach_kernel_driver
0000000000106290 0000000000106295 usleep
00000000001062a0 00000000001062a5 strerror
00000000001062b0 00000000001062b5 MAG_IsLinked
00000000001062c0 00000000001062c5 fputs
00000000001062d0 00000000001062d5 lseek
00000000001062e0 00000000001062e5 strtol
00000000001062f0 00000000001062f5 readlink
0000000000106300 0000000000106305 libusb_hotplug_deregister_callback
0000000000106310 0000000000106315 __strcpy_chk
0000000000106320 0000000000106325 __ostream_insert<char,std::char_traits<char>>
0000000000106330 0000000000106335 memmove
0000000000106340 0000000000106345 strchr
0000000000106350 0000000000106355 socket
0000000000106360 0000000000106365 fread
0000000000106370 0000000000106375 getenv
0000000000106380 0000000000106385 libusb_get_next_timeout
0000000000106390 0000000000106395 __errno_location
00000000001063a0 00000000001063a5 pthread_mutexattr_settype
00000000001063b0 00000000001063b5 __stack_chk_fail
00000000001063c0 00000000001063c5 strcmp
00000000001063d0 00000000001063d5 __cxa_allocate_exception
00000000001063e0 00000000001063e5 libusb_error_name
00000000001063f0 00000000001063f5 assign
0000000000106400 0000000000106405 MAG_IsChannelAvailable
0000000000106410 0000000000106415 nanosleep
0000000000106420 0000000000106425 getuid
0000000000106430 0000000000106435 pthread_cond_wait
0000000000106440 0000000000106445 operator.delete[]
0000000000106450 0000000000106455 libusb_get_device_descriptor
0000000000106460 0000000000106465 calloc
0000000000106470 0000000000106475 munmap
0000000000106480 0000000000106485 feof
0000000000106490 0000000000106495 __cxa_throw
00000000001064a0 00000000001064a5 fclose
00000000001064b0 00000000001064b5 libusb_handle_events_completed
00000000001064c0 00000000001064c5 strncpy
00000000001064d0 00000000001064d5 pthread_attr_init
00000000001064e0 00000000001064e5 localtime_r
00000000001064f0 00000000001064f5 __cxa_end_catch
0000000000106500 0000000000106505 __throw_bad_alloc
0000000000106510 0000000000106515 fscanf
0000000000106520 0000000000106525 closedir
0000000000106530 0000000000106535 __sprintf_chk
0000000000106540 0000000000106545 libusb_get_port_numbers
0000000000106550 0000000000106555 MAG_LinkCameraEx
0000000000106560 0000000000106565 __snprintf_chk
0000000000106570 0000000000106575 access
0000000000106580 0000000000106585 endl<char,std::char_traits<char>>
0000000000106590 0000000000106595 __cxa_begin_catch
00000000001065a0 00000000001065a5 bind
00000000001065b0 00000000001065b5 libusb_bulk_transfer
00000000001065c0 00000000001065c5 fwrite
00000000001065d0 00000000001065d5 pthread_mutex_lock
00000000001065e0 00000000001065e5 realloc
00000000001065f0 00000000001065f5 timerfd_create
0000000000106600 0000000000106605 pthread_mutexattr_init
0000000000106610 0000000000106615 pthread_key_create
0000000000106620 0000000000106625 libusb_lock_events
0000000000106630 0000000000106635 timerfd_settime
0000000000106640 0000000000106645 localtime
0000000000106650 0000000000106655 pthread_mutex_destroy
0000000000106660 0000000000106665 write
0000000000106670 0000000000106675 operator.new
0000000000106680 0000000000106685 _Unwind_Resume
0000000000106690 0000000000106695 pthread_cond_broadcast
00000000001066a0 00000000001066a5 clock_gettime
00000000001066b0 00000000001066b5 sqrt
00000000001066c0 00000000001066c5 strtoul
00000000001066d0 00000000001066d5 pthread_mutex_unlock
00000000001066e0 00000000001066e5 memcpy
00000000001066f0 00000000001066f5 fcntl
0000000000106700 0000000000106705 libusb_release_interface
0000000000106710 0000000000106715 open
0000000000106720 0000000000106725 __open_2
0000000000106730 0000000000106735 mmap
0000000000106740 0000000000106745 libusb_lock_event_waiters
0000000000106750 0000000000106755 mkdir
0000000000106760 0000000000106765 time
0000000000106770 0000000000106775 fflush
0000000000106780 0000000000106785 sqrtf
0000000000106790 0000000000106795 pthread_attr_setdetachstate
00000000001067a0 00000000001067cd entry
00000000001067d0 000000000010680f _INIT_2
0000000000106810 000000000010683d _INIT_3
0000000000106840 000000000010686d _INIT_4
0000000000106870 000000000010689d _INIT_5
00000000001068a0 00000000001068cb FUN_001068a0
00000000001068d0 000000000010690b FUN_001068d0
0000000000106910 0000000000106941 _FINI_0
0000000000106950 0000000000106984 _INIT_0
0000000000106990 00000000001069d3 FUN_00106990
00000000001069e0 00000000001069f1 FUN_001069e0
0000000000106a00 0000000000106a3e FUN_00106a00
0000000000106a40 0000000000106b3c FUN_00106a40
0000000000106b40 0000000000106d2a FUN_00106b40
0000000000106d30 0000000000106d3f FUN_00106d30
0000000000106d40 0000000000106d44 FUN_00106d40
0000000000106d50 0000000000106d71 FUN_00106d50
0000000000106d80 0000000000106da1 FUN_00106d80
0000000000106db0 0000000000106dd1 FUN_00106db0
0000000000106de0 0000000000106e04 FUN_00106de0
0000000000106e10 0000000000106e34 FUN_00106e10
0000000000106e40 0000000000106e64 FUN_00106e40
0000000000106e70 0000000000106ed8 FUN_00106e70
0000000000106ee0 0000000000106eea FUN_00106ee0
0000000000106ef0 0000000000106ef4 FUN_00106ef0
0000000000106f00 0000000000106f16 FUN_00106f00
0000000000106f20 0000000000106f57 FUN_00106f20
0000000000106f60 0000000000106f7e FUN_00106f60
0000000000106f80 0000000000106f88 FUN_00106f80
0000000000106f90 0000000000106fa6 FUN_00106f90
0000000000106fb0 000000000010704e FUN_00106fb0
0000000000107080 0000000000107096 FUN_00107080
00000000001070a0 00000000001070bc FUN_001070a0
00000000001070c0 00000000001070e3 FUN_001070c0
00000000001070f0 0000000000107123 FUN_001070f0
0000000000107130 00000000001071b6 FUN_00107130
00000000001071e0 0000000000107521 FUN_001071e0
0000000000107530 000000000010762b FUN_00107530
0000000000107640 0000000000107754 FUN_00107640
0000000000107760 00000000001079c7 FUN_00107760
00000000001079d0 0000000000108981 FUN_001079d0
0000000000108990 00000000001089c9 FUN_00108990
00000000001089d0 0000000000108add FUN_001089d0
0000000000108ae0 0000000000108dbf FUN_00108ae0
0000000000108dc0 0000000000108e03 FUN_00108dc0
0000000000108e10 000000000010915d FUN_00108e10
0000000000109160 00000000001092a2 FUN_00109160
00000000001092b0 000000000010943a FUN_001092b0
0000000000109440 0000000000109662 FUN_00109440
0000000000109670 0000000000109ce0 FUN_00109670
0000000000109d40 0000000000109e6f FUN_00109d40
0000000000109e70 0000000000109ecb FUN_00109e70
0000000000109ed0 0000000000109f13 FUN_00109ed0
0000000000109f20 000000000010a0c4 FUN_00109f20
000000000010a0d0 000000000010a14d FUN_0010a0d0
000000000010a150 000000000010a181 FUN_0010a150
000000000010a190 000000000010a1a3 FUN_0010a190
000000000010a1b0 000000000010a1d1 FUN_0010a1b0
000000000010a1e0 000000000010a1f3 FUN_0010a1e0
000000000010a200 000000000010a221 FUN_0010a200
000000000010a230 000000000010a3b3 FUN_0010a230
000000000010a3c0 000000000010a4a6 FUN_0010a3c0
000000000010a4b0 000000000010a4f7 FUN_0010a4b0
000000000010a500 000000000010a60d FUN_0010a500
000000000010a610 000000000010ac24 FUN_0010a610
000000000010ac30 000000000010ace3 FUN_0010ac30
000000000010acf0 000000000010ad24 FUN_0010acf0
000000000010ad30 000000000010ad42 FUN_0010ad30
000000000010ad50 000000000010ad80 FUN_0010ad50
000000000010ad90 000000000010b09a FUN_0010ad90
000000000010b0a0 000000000010b61d FUN_0010b0a0
000000000010b620 000000000010b8c7 FUN_0010b620
000000000010b8d0 000000000010b985 FUN_0010b8d0
000000000010b990 000000000010b9e2 FUN_0010b990
000000000010b9f0 000000000010bd0a FUN_0010b9f0
000000000010bd10 000000000010be7b FUN_0010bd10
000000000010be80 000000000010c3d6 FUN_0010be80
000000000010c3e0 000000000010c77e FUN_0010c3e0
000000000010c780 000000000010d01d FUN_0010c780
000000000010d020 000000000010d390 FUN_0010d020
000000000010d3a0 000000000010d7d5 FUN_0010d3a0
000000000010d7e0 000000000010dc3d FUN_0010d7e0
000000000010dc40 000000000010dec6 FUN_0010dc40
000000000010ded0 000000000010e0b1 FUN_0010ded0
000000000010e0c0 000000000010e1f8 FUN_0010e0c0
000000000010e200 000000000010e332 FUN_0010e200
000000000010e340 000000000010e51b FUN_0010e340
000000000010e520 000000000010e728 FUN_0010e520
000000000010e730 000000000010e84f FUN_0010e730
000000000010e850 000000000010ea63 FUN_0010e850
000000000010ea70 000000000010eaa4 FUN_0010ea70
000000000010eab0 000000000010eb31 FUN_0010eab0
000000000010eb40 000000000010ebd6 FUN_0010eb40
000000000010ebe0 000000000010ed77 FUN_0010ebe0
000000000010eda0 000000000010edfe FUN_0010eda0
000000000010ee00 000000000010ef53 FUN_0010ee00
000000000010ef60 000000000010f0f4 FUN_0010ef60
000000000010f100 000000000010f2a0 FUN_0010f100
000000000010f2b0 000000000010f3fa FUN_0010f2b0
000000000010f400 000000000010f610 FUN_0010f400
000000000010f620 000000000010f72e FUN_0010f620
000000000010f730 000000000010f94a FUN_0010f730
000000000010f950 000000000010f964 FUN_0010f950
000000000010f970 000000000010f981 FUN_0010f970
000000000010f990 000000000010fa7d FUN_0010f990
000000000010fa80 000000000010fa86 FUN_0010fa80
000000000010fa90 000000000010fc36 FUN_0010fa90
000000000010fc40 000000000011002d FUN_0010fc40
0000000000110030 00000000001101a7 FUN_00110030
00000000001101b0 00000000001101d6 FUN_001101b0
00000000001101e0 0000000000110319 FUN_001101e0
0000000000110320 00000000001105c3 FUN_00110320
00000000001105d0 0000000000110b6e FUN_001105d0
0000000000110b70 0000000000110f86 FUN_00110b70
0000000000110f90 0000000000111236 FUN_00110f90
0000000000111240 000000000011143c FUN_00111240
0000000000111440 0000000000111552 FUN_00111440
0000000000111560 000000000011171b FUN_00111560
0000000000111720 0000000000111c2b FUN_00111720
0000000000111c30 00000000001122f4 FUN_00111c30
0000000000112370 00000000001123ec FUN_00112370
0000000000112460 0000000000112471 FUN_00112460
0000000000112480 0000000000112719 FUN_00112480
0000000000112770 0000000000112b67 FUN_00112770
0000000000112bc0 0000000000113a9f FUN_00112bc0
0000000000113aa0 0000000000113b19 FUN_00113aa0
0000000000113b30 0000000000113b6d FUN_00113b30
0000000000113b90 0000000000113b97 FUN_00113b90
0000000000113ba0 0000000000113bb4 FUN_00113ba0
0000000000113bc0 0000000000113c04 FUN_00113bc0
0000000000113c10 0000000000113c1a FUN_00113c10
0000000000113c20 0000000000113c87 FUN_00113c20
0000000000113c90 0000000000113ddc FUN_00113c90
0000000000113de0 0000000000113f2f FUN_00113de0
0000000000113f30 0000000000114055 FUN_00113f30
0000000000114060 00000000001141d4 FUN_00114060
00000000001141e0 00000000001142c9 FUN_001141e0
00000000001142f0 000000000011457e FUN_001142f0
0000000000114580 00000000001145a9 FUN_00114580
00000000001145b0 0000000000114608 FUN_001145b0
0000000000114610 0000000000114668 FUN_00114610
0000000000114670 0000000000114e3c FUN_00114670
0000000000114e40 0000000000114f41 FUN_00114e40
0000000000114f50 0000000000114fe6 FUN_00114f50
0000000000114ff0 0000000000115066 FUN_00114ff0
0000000000115070 00000000001150e1 FUN_00115070
00000000001150f0 0000000000115554 FUN_001150f0
0000000000115580 00000000001155d8 FUN_00115580
00000000001155e0 00000000001156fd FUN_001155e0
0000000000115700 0000000000115704 thunk_FUN_001155e0
0000000000115710 0000000000115714 thunk_FUN_001155e0
0000000000115720 000000000011578f FUN_00115720
0000000000115790 0000000000115da7 FUN_00115790
0000000000115db0 0000000000115dbc FUN_00115db0
0000000000115dc0 0000000000115e4a FUN_00115dc0
0000000000115e50 0000000000115edb FUN_00115e50
0000000000115ee0 0000000000115f6b FUN_00115ee0
0000000000115f70 0000000000116003 FUN_00115f70
0000000000116010 000000000011609b FUN_00116010
00000000001160a0 000000000011612b FUN_001160a0
0000000000116130 0000000000116144 FUN_00116130
0000000000116150 0000000000116165 FUN_00116150
0000000000116170 0000000000116185 FUN_00116170
0000000000116190 00000000001161a5 FUN_00116190
00000000001161b0 00000000001161c5 FUN_001161b0
00000000001161d0 00000000001161e5 FUN_001161d0
00000000001161f0 0000000000116242 FUN_001161f0
0000000000116250 00000000001162a3 FUN_00116250
00000000001162b0 0000000000116303 FUN_001162b0
0000000000116310 0000000000116326 FUN_00116310
0000000000116330 000000000011635c FUN_00116330
0000000000116360 0000000000116371 FUN_00116360
0000000000116380 000000000011647c FUN_00116380
0000000000116480 000000000011648b FUN_00116480
0000000000116490 0000000000116547 FUN_00116490
0000000000116550 0000000000116554 FUN_00116550
0000000000116560 0000000000116564 FUN_00116560
0000000000116570 000000000011657e FUN_00116570
0000000000116580 0000000000116596 FUN_00116580
00000000001165a0 00000000001165dd FUN_001165a0
00000000001165e0 0000000000116607 FUN_001165e0
0000000000116610 0000000000116618 FUN_00116610
0000000000116620 000000000011662b FUN_00116620
0000000000116630 000000000011663d FUN_00116630
0000000000116640 000000000011666b FUN_00116640
0000000000116670 00000000001167b9 FUN_00116670
00000000001167f0 0000000000116b13 FUN_001167f0
0000000000116b20 0000000000116b71 FUN_00116b20
0000000000116b80 0000000000116e4f FUN_00116b80
0000000000116e50 0000000000116e8a FUN_00116e50
0000000000116ea0 0000000000116f8e FUN_00116ea0
0000000000116fb0 000000000011704e FUN_00116fb0
0000000000117050 0000000000117093 FUN_00117050
00000000001170a0 000000000011746a FUN_001170a0
0000000000117470 0000000000117fbc FUN_00117470
0000000000117fc0 000000000011816d FUN_00117fc0
0000000000118190 0000000000118436 FUN_00118190
0000000000118440 00000000001186a1 FUN_00118440
00000000001186b0 00000000001187e2 FUN_001186b0
00000000001187f0 00000000001189e4 FUN_001187f0
00000000001189f0 0000000000118abb FUN_001189f0
0000000000118ad0 0000000000118b0b FUN_00118ad0
0000000000118b10 0000000000118b48 FUN_00118b10
0000000000118b50 0000000000118c5b FUN_00118b50
0000000000118c60 0000000000118cbb FUN_00118c60
0000000000118cc0 0000000000118d01 FUN_00118cc0
0000000000118d10 0000000000118d3f FUN_00118d10
0000000000118d40 0000000000118e02 FUN_00118d40
0000000000118e10 0000000000118e9b FUN_00118e10
0000000000118f20 0000000000118f31 FUN_00118f20
0000000000118f40 0000000000119188 FUN_00118f40
00000000001191a0 000000000011924e FUN_001191a0
0000000000119250 000000000011927b FUN_00119250
0000000000119280 00000000001192ab FUN_00119280
00000000001192b0 00000000001192db FUN_001192b0
00000000001192e0 000000000011937f FUN_001192e0
0000000000119380 00000000001193ea FUN_00119380
00000000001193f0 00000000001194be FUN_001193f0
00000000001194c0 0000000000119821 FUN_001194c0
0000000000119830 000000000011998b FUN_00119830
0000000000119990 0000000000119a3e FUN_00119990
0000000000119a40 0000000000119d12 FUN_00119a40
0000000000119d90 0000000000119dfc FUN_00119d90
0000000000119e00 0000000000119e0f FUN_00119e00
0000000000119e10 0000000000119e69 FUN_00119e10
0000000000119e70 0000000000119e81 FUN_00119e70
0000000000119e90 0000000000119ede FUN_00119e90
0000000000119ee0 000000000011a00a FUN_00119ee0
000000000011a010 000000000011a13e FUN_0011a010
000000000011a140 000000000011a220 FUN_0011a140
000000000011a230 000000000011a260 FUN_0011a230
000000000011a270 000000000011a3c8 FUN_0011a270
000000000011a3d0 000000000011aac9 FUN_0011a3d0
000000000011aad0 000000000011abc7 FUN_0011aad0
000000000011abd0 000000000011ad6a MAG_NewChannel
000000000011ad90 000000000011adcc MAG_IsChannelAvailable
000000000011add0 000000000011ae36 MAG_RevisedTemp2InnerTemp
000000000011ae40 000000000011aea6 MAG_RevisedTemp2Gray
000000000011aeb0 000000000011afec MAG_GetCurrentOffset
000000000011aff0 000000000011b02b MAG_GetCurrentCameraInnerTemperature
000000000011b030 000000000011b06b MAG_GetCameraTemperature
000000000011b070 000000000011b0ab MAG_GetSenorTemperature
000000000011b0b0 000000000011b0d8 MAG_IsInitialized
000000000011b0e0 000000000011b0f1 MAG_GetLocalIp
000000000011b100 000000000011b106 MAG_SetFilter
000000000011b110 000000000011b119 MAG_EnableAutoReConnect
000000000011b120 000000000011b14f MAG_EnumCameras
000000000011b150 000000000011b17b MAG_IsLinked
000000000011b180 000000000011b18f MAG_IsListening
000000000011b190 000000000011b19f MAG_ListenTo
000000000011b1a0 000000000011b1e5 MAG_GetRecentHeartBeat
000000000011b1f0 000000000011b22b MAG_SetReConnectCallBack
000000000011b230 000000000011b27c MAG_GetCamInfo
000000000011b280 000000000011b291 MAG_GetMulticastState
000000000011b2a0 000000000011b311 MAG_GetTerminalList
000000000011b320 000000000011b344 MAG_IsProcessingImage
000000000011b350 000000000011b3e9 MAG_PrepareProcessImage
000000000011b3f0 000000000011b433 MAG_WillStartImmediately
000000000011b440 000000000011b484 MAG_TransferPulseImage
000000000011b490 000000000011b538 MAG_StopProcessImage
000000000011b540 000000000011b5d9 MAG_Initialize
000000000011b5e0 000000000011b696 MAG_Free
000000000011b6a0 000000000011b762 MAG_DelChannel
000000000011b770 000000000011b7d8 MAG_DisLinkCamera
000000000011b7e0 000000000011b80f MAG_StopListen
000000000011b810 000000000011b843 MAG_SetFFCMode
000000000011b850 000000000011b8d3 FUN_0011b850
000000000011b8e0 000000000011bcb2 FUN_0011b8e0
000000000011bcc0 000000000011bcdc MAG_TriggerFFC
000000000011bce0 000000000011bcef MAG_SetIoAlarmState
000000000011bcf0 000000000011bd56 MAG_SetColorPalette
000000000011bd60 000000000011be47 MAG_SetSubsectionEnlargePara
000000000011be50 000000000011bf28 MAG_SetAutoEnlargePara
000000000011bf30 000000000011bfdd MAG_SetIsothermalPara
000000000011bfe0 000000000011bfef MAG_SetUserROIs
000000000011bff0 000000000011bfff MAG_ResetCamera
000000000011c000 000000000011c04e MAG_GetFilteredRaw
000000000011c050 000000000011c0fa MAG_GetOutputBMPdata
000000000011c100 000000000011c249 MAG_GetOutputBMPdataRGB24
000000000011c250 000000000011c29e MAG_GetOutputRawData
000000000011c2a0 000000000011c34a MAG_GetOutputColorBardata
000000000011c350 000000000011c3fa MAG_GetOutputVideoData
000000000011c400 000000000011c44e MAG_GetOutputVideoYV12
000000000011c450 000000000011c488 MAG_GetVideoPPS
000000000011c490 000000000011c4c8 MAG_GetVideoSPS
000000000011c4d0 000000000011c508 MAG_GetVideoVCL
000000000011c510 000000000011c56d MAG_GetTemperatureData
000000000011c570 000000000011c747 MAG_GetTemperatureData_Raw
000000000011c750 000000000011c7e2 MAG_GetFixPara
000000000011c7f0 000000000011c8f0 MAG_SetFixPara
000000000011c900 000000000011c959 MAG_SetEXLevel
000000000011c960 000000000011c990 MAG_GetEXLevel
000000000011c9a0 000000000011c9dc MAG_SetDetailEnhancement
000000000011c9e0 000000000011ca52 MAG_FixTemperature
000000000011ca60 000000000011caba MAG_FixTemperature2
000000000011cac0 000000000011caf3 MAG_GetFrameStatisticalData
000000000011cb00 000000000011cb33 MAG_GetRemoteInfo
000000000011cb40 000000000011cbd7 MAG_GetTemperatureProbe
000000000011cbe0 000000000011cc29 MAG_GetTemperatureProbe2
000000000011cc30 000000000011cca6 MAG_GetLineTemperatureInfo
000000000011ccb0 000000000011cd3e MAG_GetRectTemperatureInfo
000000000011cd40 000000000011cdaa MAG_GetEllipseTemperatureInfo
000000000011cdb0 000000000011ce0d MAG_GetRgnTemperatureInfo
000000000011ce10 000000000011ce4f MAG_UseTemperatureMask
000000000011ce50 000000000011ce8d MAG_IsUsingTemperatureMask
000000000011ce90 000000000011cef6 MAG_SaveBMP
000000000011cf00 000000000011cf0f MAG_SetPTZCmd
000000000011cf10 000000000011cf1f MAG_QueryPTZState
000000000011cf20 000000000011cf2f MAG_SetSerialCmd
000000000011cf30 000000000011cf3f MAG_SetVideoContrast
000000000011cf40 000000000011cf55 MAG_SetSerialCallBack
000000000011cf60 000000000011cf6f MAG_SetVideoBrightness
000000000011cf70 000000000011cfb0 MAG_LockFrame
000000000011cfc0 000000000011d000 MAG_UnLockFrame
000000000011d010 000000000011d070 FUN_0011d010
000000000011d080 000000000011d084 MAG_LoadBufferedDDT
000000000011d090 000000000011d09f MAG_SDStorageMGT
000000000011d0a0 000000000011d0af MAG_SDStorageBMP
000000000011d0b0 000000000011d0bf MAG_SDStorageMGSStart
000000000011d0c0 000000000011d0cf MAG_SDStorageMGSStop
000000000011d0d0 000000000011d0df MAG_SDStorageAviStart
000000000011d0e0 000000000011d0ef MAG_SDStorageAviStop
000000000011d0f0 000000000011d10f MAG_SDCardStorage
000000000011d110 000000000011d77f FUN_0011d110
000000000011d780 000000000011d872 MAG_LinkCameraEx
000000000011d880 000000000011d8a8 MAG_LinkCamera
000000000011d8b0 000000000011dc4b FUN_0011d8b0
000000000011dc50 000000000011dcaf MAG_StartProcessImage
000000000011dcb0 000000000011dd12 MAG_StartProcessPulseImage
000000000011dd20 000000000011dd21 FUN_0011dd20
000000000011dd30 000000000011ddce FUN_0011dd30
000000000011ddd0 000000000011de24 MAG_SetEstimateUnderArmTempMode
000000000011de30 000000000011de55 MAG_GetEstimateUnderArmTempMode
000000000011de60 000000000011de81 MAG_GetEstimatedEnvTemp
000000000011de90 000000000011dec9 MAG_SetEnvTempEstimateMode
000000000011ded0 000000000011e9e5 MAG_EstimateUnderArmTempFromForeheadRect
000000000011e9f0 000000000011ea82 MAG_LoadDDT
000000000011eac0 000000000011f12c FUN_0011eac0
000000000011f1b0 000000000011f2e6 MAG_SaveMGT
000000000011f300 000000000011f7b9 FUN_0011f300
000000000011f830 000000000011f976 MAG_SaveDDT
000000000011f990 000000000011fa72 MAG_SaveDDT2Buffer
000000000011fa80 000000000011fc94 FUN_0011fa80
000000000011fca0 000000000011fd2d FUN_0011fca0
000000000011fd30 000000000011fd45 FUN_0011fd30
000000000011fd50 00000000001200ad FUN_0011fd50
00000000001200e0 00000000001202fa FUN_001200e0
0000000000120300 00000000001204f9 FUN_00120300
0000000000120550 00000000001205d4 FUN_00120550
00000000001205e0 00000000001205e4 libusb_get_bus_number
00000000001205f0 00000000001205f4 libusb_get_port_number
0000000000120600 0000000000120604 libusb_get_parent
0000000000120610 0000000000120614 libusb_get_device_address
0000000000120620 0000000000120623 libusb_get_device_speed
0000000000120630 0000000000120649 libusb_ref_device
0000000000120650 00000000001206c7 FUN_00120650
00000000001206d0 00000000001206d4 libusb_get_device
00000000001206e0 0000000000120702 libusb_dev_mem_alloc
0000000000120710 000000000012072d libusb_dev_mem_free
0000000000120730 000000000012074d libusb_set_auto_detach_kernel_driver
0000000000120750 0000000000120765 libusb_set_debug
0000000000120770 00000000001207d2 libusb_has_capability
00000000001207e0 0000000000120866 FUN_001207e0
0000000000120870 0000000000120903 FUN_00120870
0000000000120910 00000000001209a4 FUN_00120910
00000000001209b0 0000000000120ccc FUN_001209b0
0000000000120cd0 0000000000120d54 FUN_00120cd0
0000000000120d60 0000000000120dd4 FUN_00120d60
0000000000120de0 0000000000120e7c libusb_get_port_numbers
0000000000120e80 0000000000120e8d libusb_get_port_path
0000000000120e90 0000000000120f02 libusb_get_max_packet_size
0000000000120f10 0000000000120fa3 libusb_get_max_iso_packet_size
0000000000120fb0 0000000000121059 libusb_unref_device
0000000000121060 00000000001210a6 libusb_free_device_list
00000000001210b0 000000000012116e FUN_001210b0
0000000000121170 0000000000121354 libusb_get_device_list
0000000000121360 00000000001213b3 FUN_00121360
00000000001213c0 0000000000121413 FUN_001213c0
0000000000121420 0000000000121599 libusb_wrap_fd
00000000001215a0 0000000000121729 libusb_open
0000000000121730 00000000001217f2 libusb_open_device_with_vid_pid
0000000000121800 0000000000121b49 libusb_close
0000000000121b50 0000000000121c9c libusb_get_configuration
0000000000121ca0 0000000000121ce1 libusb_set_configuration
0000000000121cf0 0000000000121d96 libusb_claim_interface
0000000000121da0 0000000000121e34 libusb_release_interface
0000000000121e40 0000000000121eee libusb_set_interface_alt_setting
0000000000121ef0 0000000000121f53 libusb_clear_halt
0000000000121f60 0000000000121fa6 libusb_reset_device
0000000000121fb0 0000000000122036 libusb_alloc_streams
0000000000122040 00000000001220b6 libusb_free_streams
00000000001220c0 000000000012212e libusb_kernel_driver_active
0000000000122130 000000000012219e libusb_detach_kernel_driver
00000000001221a0 000000000012220e libusb_attach_kernel_driver
0000000000122210 00000000001225f0 libusb_init
0000000000122600 000000000012288b libusb_exit
0000000000122890 00000000001229f7 libusb_error_name
0000000000122a00 0000000000122a07 libusb_get_version
0000000000122a10 0000000000122ab8 FUN_00122a10
0000000000122ac0 0000000000122b10 FUN_00122ac0
0000000000122b20 0000000000122c3a FUN_00122b20
0000000000122c40 000000000012368e FUN_00122c40
0000000000123690 0000000000123739 FUN_00123690
0000000000123740 0000000000123787 libusb_get_device_descriptor
0000000000123790 00000000001238b9 libusb_get_active_config_descriptor
00000000001238c0 0000000000123a21 libusb_get_config_descriptor
0000000000123a30 0000000000123b1f FUN_00123a30
0000000000123b20 0000000000123bb7 libusb_get_config_descriptor_by_value
0000000000123bc0 0000000000123be1 libusb_free_config_descriptor
0000000000123bf0 0000000000123cdf libusb_get_ss_endpoint_companion_descriptor
0000000000123ce0 0000000000123ce4 libusb_free_ss_endpoint_companion_descriptor
0000000000123cf0 0000000000123d46 libusb_free_bos_descriptor
0000000000123d50 00000000001241cc libusb_get_bos_descriptor
00000000001241d0 0000000000124286 libusb_get_usb_2_0_extension_descriptor
0000000000124290 0000000000124294 libusb_free_usb_2_0_extension_descriptor
00000000001242a0 0000000000124356 libusb_get_ss_usb_device_capability_descriptor
0000000000124360 0000000000124364 libusb_free_ss_usb_device_capability_descriptor
0000000000124370 0000000000124426 libusb_get_container_id_descriptor
0000000000124430 0000000000124434 libusb_free_container_id_descriptor
0000000000124440 00000000001245b9 libusb_get_string_descriptor_ascii
00000000001245c0 0000000000124625 FUN_001245c0
0000000000124630 0000000000124705 FUN_00124630
0000000000124710 000000000012481e FUN_00124710
0000000000124820 00000000001248c6 libusb_hotplug_deregister_callback
00000000001248d0 0000000000124aee libusb_hotplug_register_callback
0000000000124af0 0000000000124b6e FUN_00124af0
0000000000124b70 0000000000124bb3 FUN_00124b70
0000000000124bc0 0000000000124cdc FUN_00124bc0
0000000000124ce0 0000000000124d8b FUN_00124ce0
0000000000124d90 0000000000124e0b libusb_alloc_transfer
0000000000124e10 0000000000124e69 libusb_free_transfer
0000000000124e70 00000000001252a7 libusb_submit_transfer
00000000001252b0 00000000001253a0 libusb_cancel_transfer
00000000001253b0 00000000001254ce FUN_001253b0
00000000001254d0 000000000012551b FUN_001254d0
0000000000125520 0000000000125be1 FUN_00125520
0000000000125bf0 0000000000125bf3 libusb_transfer_set_stream_id
0000000000125c00 0000000000125c03 libusb_transfer_get_stream_id
0000000000125c10 0000000000125d5a FUN_00125c10
0000000000125d60 0000000000125dc7 FUN_00125d60
0000000000125dd0 0000000000125e89 FUN_00125dd0
0000000000125e90 0000000000125f2e libusb_try_lock_events
0000000000125f30 0000000000125f63 libusb_lock_events
0000000000125f70 0000000000125fcb libusb_unlock_events
0000000000125fd0 000000000012603b libusb_event_handling_ok
0000000000126040 00000000001260bb libusb_event_handler_active
00000000001260c0 000000000012615e libusb_interrupt_event_handler
0000000000126160 000000000012618d libusb_lock_event_waiters
0000000000126190 00000000001261bd libusb_unlock_event_waiters
00000000001261c0 000000000012621b libusb_wait_for_event
0000000000126220 000000000012624d libusb_pollfds_handle_timeouts
0000000000126250 00000000001264ab libusb_get_next_timeout
00000000001264b0 0000000000126548 FUN_001264b0
0000000000126550 00000000001266c6 libusb_handle_events_timeout_completed
00000000001266d0 00000000001266d6 libusb_handle_events_timeout
00000000001266e0 0000000000126703 libusb_handle_events
0000000000126710 0000000000126734 libusb_handle_events_completed
0000000000126740 00000000001267ab libusb_handle_events_locked
00000000001267b0 00000000001267db libusb_set_pollfd_notifiers
00000000001267e0 00000000001268be FUN_001267e0
00000000001268c0 00000000001269d3 FUN_001268c0
00000000001269e0 0000000000126c1b FUN_001269e0
0000000000126c20 0000000000126cb9 FUN_00126c20
0000000000126cc0 0000000000126d66 libusb_get_pollfds
0000000000126d70 0000000000126d81 libusb_free_pollfds
0000000000126d90 0000000000126ed0 FUN_00126d90
0000000000126ee0 0000000000126f09 FUN_00126ee0
0000000000126f10 0000000000126f84 FUN_00126f10
0000000000126f90 0000000000127129 FUN_00126f90
0000000000127130 00000000001273bb libusb_control_transfer
00000000001273c0 00000000001273d8 libusb_bulk_transfer
00000000001273e0 00000000001273f8 libusb_interrupt_transfer
0000000000127400 00000000001274a8 FUN_00127400
00000000001274b0 0000000000127546 FUN_001274b0
0000000000127550 0000000000127564 FUN_00127550
0000000000127570 0000000000127576 FUN_00127570
0000000000127580 00000000001276f5 FUN_00127580
0000000000127700 00000000001277ca FUN_00127700
00000000001277d0 0000000000127801 FUN_001277d0
0000000000127810 00000000001279e1 FUN_00127810
00000000001279f0 0000000000127b4a FUN_001279f0
0000000000127b50 0000000000127bb6 FUN_00127b50
0000000000127bc0 0000000000127c72 FUN_00127bc0
0000000000127c80 0000000000127cec FUN_00127c80
0000000000127cf0 0000000000127d76 FUN_00127cf0
0000000000127d80 0000000000127dfd FUN_00127d80
0000000000127e00 0000000000127e7a FUN_00127e00
0000000000127e80 0000000000127f24 FUN_00127e80
0000000000127f30 0000000000128032 FUN_00127f30
0000000000128040 0000000000128108 FUN_00128040
0000000000128110 00000000001282a0 FUN_00128110
00000000001282b0 00000000001282e9 FUN_001282b0
00000000001282f0 0000000000128766 FUN_001282f0
0000000000128770 00000000001287b6 FUN_00128770
00000000001287c0 00000000001288d3 FUN_001287c0
00000000001288e0 00000000001288f1 FUN_001288e0
0000000000128900 0000000000128911 FUN_00128900
0000000000128920 00000000001289dd FUN_00128920
00000000001289e0 00000000001289e4 thunk_FUN_0012c710
00000000001289f0 0000000000128a43 FUN_001289f0
0000000000128a50 0000000000128ab9 FUN_00128a50
0000000000128ac0 0000000000128b4a FUN_00128ac0
0000000000128b50 0000000000129042 FUN_00128b50
0000000000129050 0000000000129151 FUN_00129050
0000000000129160 0000000000129550 FUN_00129160
0000000000129560 000000000012959a FUN_00129560
00000000001295a0 0000000000129697 FUN_001295a0
00000000001296a0 00000000001296b4 FUN_001296a0
00000000001296c0 00000000001297f1 FUN_001296c0
0000000000129800 0000000000129899 FUN_00129800
00000000001298a0 00000000001298ca FUN_001298a0
00000000001298d0 000000000012a378 FUN_001298d0
000000000012a380 000000000012a3c8 FUN_0012a380
000000000012a3d0 000000000012a421 FUN_0012a3d0
000000000012a430 000000000012a48a FUN_0012a430
000000000012a490 000000000012a68f FUN_0012a490
000000000012a690 000000000012a6fb FUN_0012a690
000000000012a700 000000000012a796 FUN_0012a700
000000000012a7a0 000000000012a842 FUN_0012a7a0
000000000012a850 000000000012a91d FUN_0012a850
000000000012a920 000000000012ab59 FUN_0012a920
000000000012ab60 000000000012aca5 FUN_0012ab60
000000000012acb0 000000000012afe9 FUN_0012acb0
000000000012aff0 000000000012b039 FUN_0012aff0
000000000012b040 000000000012b1db FUN_0012b040
000000000012b1e0 000000000012b8b3 FUN_0012b1e0
000000000012b8c0 000000000012b941 FUN_0012b8c0
000000000012b950 000000000012b9ff FUN_0012b950
000000000012ba00 000000000012bbc4 FUN_0012ba00
000000000012bbd0 000000000012bc7f FUN_0012bbd0
000000000012bc80 000000000012bcff FUN_0012bc80
000000000012bd00 000000000012c20b FUN_0012bd00
000000000012c210 000000000012c320 FUN_0012c210
000000000012c330 000000000012c639 FUN_0012c330
000000000012c640 000000000012c704 FUN_0012c640
000000000012c710 000000000012c731 FUN_0012c710
000000000012c734 000000000012c73c _fini
0000000000367000 0000000000367000 exp
0000000000367008 0000000000367008 pthread_getspecific
0000000000367010 0000000000367010 pthread_cond_destroy
0000000000367018 0000000000367018 memset
0000000000367020 0000000000367020 ftell
0000000000367028 0000000000367028 close
0000000000367030 0000000000367030 ioctl
0000000000367038 0000000000367038 pthread_setspecific
0000000000367040 0000000000367040 __gmon_start__
0000000000367048 0000000000367048 _Jv_RegisterClasses
0000000000367050 0000000000367050 recvmsg
0000000000367058 0000000000367058 operator.new[]
0000000000367060 0000000000367060 uname
0000000000367068 0000000000367068 fseek
0000000000367070 0000000000367070 pthread_cond_signal
0000000000367078 0000000000367078 operator.delete
0000000000367080 0000000000367080 _M_dispose
0000000000367088 0000000000367088 pthread_mutexattr_destroy
0000000000367090 0000000000367090 __assert_fail
0000000000367098 0000000000367098 __printf_chk
00000000003670a0 00000000003670a0 gettimeofday
00000000003670a8 00000000003670a8 Init
00000000003670b0 00000000003670b0 read
00000000003670b8 00000000003670b8 strncmp
00000000003670c0 00000000003670c0 malloc
00000000003670c8 00000000003670c8 fopen
00000000003670d0 00000000003670d0 pthread_cond_timedwait
00000000003670d8 00000000003670d8 __memcpy_chk
00000000003670e0 00000000003670e0 __cxa_atexit
00000000003670e8 00000000003670e8 setsockopt
00000000003670f0 00000000003670f0 pthread_mutex_init
00000000003670f8 00000000003670f8 fgets
0000000000367100 0000000000367100 __vsnprintf_chk
0000000000367108 0000000000367108 ~Init
0000000000367110 0000000000367110 pthread_attr_destroy
0000000000367118 0000000000367118 getpwuid
0000000000367120 0000000000367120 _ITM_deregisterTMCloneTable
0000000000367128 0000000000367128 operator<<
0000000000367130 0000000000367130 __strdup
0000000000367138 0000000000367138 free
0000000000367140 0000000000367140 strlen
0000000000367148 0000000000367148 _ITM_registerTMCloneTable
0000000000367150 0000000000367150 _M_destroy
0000000000367158 0000000000367158 __asprintf_chk
0000000000367160 0000000000367160 pthread_create
0000000000367168 0000000000367168 opendir
0000000000367170 0000000000367170 __xstat
0000000000367178 0000000000367178 pthread_cond_init
0000000000367180 0000000000367180 __ctype_b_loc
0000000000367188 0000000000367188 __cxa_finalize
0000000000367190 0000000000367190 pthread_key_delete
00000000003671a0 00000000003671a0 readdir
00000000003671a8 00000000003671a8 strrchr
00000000003671b0 00000000003671b0 syscall
00000000003671b8 00000000003671b8 sscanf
00000000003671c0 00000000003671c0 pipe
00000000003671c8 00000000003671c8 pthread_join
00000000003671d0 00000000003671d0 poll
00000000003671d8 00000000003671d8 pthread_mutex_trylock
00000000003671e0 00000000003671e0 pow
00000000003671e8 00000000003671e8 usleep
00000000003671f0 00000000003671f0 strerror
0000000000367200 0000000000367200 fputs
0000000000367208 0000000000367208 lseek
0000000000367210 0000000000367210 strtol
0000000000367218 0000000000367218 readlink
0000000000367220 0000000000367220 __cxa_pure_virtual
0000000000367228 0000000000367228 __strcpy_chk
0000000000367230 0000000000367230 __ostream_insert<char,std::char_traits<char>>
0000000000367238 0000000000367238 memmove
0000000000367240 0000000000367240 strchr
0000000000367248 0000000000367248 socket
0000000000367250 0000000000367250 fread
0000000000367258 0000000000367258 getenv
0000000000367260 0000000000367260 __errno_location
0000000000367270 0000000000367270 pthread_mutexattr_settype
0000000000367278 0000000000367278 __stack_chk_fail
0000000000367280 0000000000367280 strcmp
0000000000367288 0000000000367288 __cxa_allocate_exception
0000000000367290 0000000000367290 assign
0000000000367298 0000000000367298 nanosleep
00000000003672a0 00000000003672a0 getuid
00000000003672a8 00000000003672a8 pthread_cond_wait
00000000003672b0 00000000003672b0 operator.delete[]
00000000003672b8 00000000003672b8 calloc
00000000003672c0 00000000003672c0 munmap
00000000003672c8 00000000003672c8 feof
00000000003672d0 00000000003672d0 __cxa_throw
00000000003672d8 00000000003672d8 fclose
00000000003672e0 00000000003672e0 strncpy
00000000003672e8 00000000003672e8 pthread_attr_init
00000000003672f0 00000000003672f0 localtime_r
00000000003672f8 00000000003672f8 __cxa_end_catch
0000000000367300 0000000000367300 __throw_bad_alloc
0000000000367310 0000000000367310 fscanf
0000000000367318 0000000000367318 closedir
0000000000367320 0000000000367320 __sprintf_chk
0000000000367330 0000000000367330 __snprintf_chk
0000000000367338 0000000000367338 access
0000000000367340 0000000000367340 endl<char,std::char_traits<char>>
0000000000367348 0000000000367348 __pthread_key_create
0000000000367350 0000000000367350 __cxa_begin_catch
0000000000367358 0000000000367358 bind
0000000000367360 0000000000367360 fwrite
0000000000367368 0000000000367368 pthread_mutex_lock
0000000000367370 0000000000367370 realloc
0000000000367378 0000000000367378 timerfd_create
0000000000367380 0000000000367380 pthread_mutexattr_init
0000000000367388 0000000000367388 pthread_key_create
0000000000367390 0000000000367390 __gxx_personality_v0
0000000000367398 0000000000367398 timerfd_settime
00000000003673a0 00000000003673a0 localtime
00000000003673a8 00000000003673a8 pthread_mutex_destroy
00000000003673b0 00000000003673b0 write
00000000003673b8 00000000003673b8 operator.new
00000000003673c0 00000000003673c0 _Unwind_Resume
00000000003673c8 00000000003673c8 pthread_cond_broadcast
00000000003673d0 00000000003673d0 clock_gettime
00000000003673d8 00000000003673d8 sqrt
00000000003673e0 00000000003673e0 strtoul
00000000003673e8 00000000003673e8 pthread_mutex_unlock
00000000003673f0 00000000003673f0 memcpy
00000000003673f8 00000000003673f8 fcntl
0000000000367400 0000000000367400 open
0000000000367408 0000000000367408 __open_2
0000000000367410 0000000000367410 mmap
0000000000367420 0000000000367420 mkdir
0000000000367428 0000000000367428 time
0000000000367430 0000000000367430 fflush
0000000000367438 0000000000367438 sqrtf
0000000000367440 0000000000367440 pthread_attr_setdetachstate
TOTAL 841
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More