content: package com.example.vault;
  
  import android.hardware.Sensor;
  import android.hardware.SensorEvent;
  import android.hardware.SensorEventListener;
  import android.hardware.SensorManager;
  import android.os.Bundle;
  import androidx.annotation.Nullable;
  import androidx.appcompat.app.AppCompatActivity;
  import java.io.File;
  import java.io.IOException;
  import com.example.vault.panicswitch.AccelerometerListener;
  import com.example.vault.panicswitch.AccelerometerManager;
  import com.example.vault.panicswitch.PanicSwitchActivityMethods;
  import com.example.vault.panicswitch.PanicSwitchCommon;
  import com.example.vault.securitylocks.SecurityLocksCommon;
  import com.example.vault.storageoption.StorageOptionsCommon;
  import com.example.vault.utilities.Common;
  import com.example.vault.utilities.FileUtils;
  
  public class BaseActivity extends AppCompatActivity implements AccelerometerListener, SensorEventListener {
      private static BaseActivity baseActivity;
      private SensorManager sensorManager;
  
      public void onAccelerationChanged(float f, float f2, float f3) {
      }
  
      public void onAccuracyChanged(Sensor sensor, int i) {
      }
  
      public static BaseActivity getBaseActivity() {
          return baseActivity;
      }
  
  
      public void onCreate(@Nullable Bundle bundle) {
          super.onCreate(bundle);
          baseActivity = this;
          this.sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
          if (!Common.imageLoader.isInited()) {
              Common.initImageLoader(this);
          }
      }
  
  
      public void onPause() {
          super.onPause();
          if (SecurityLocksCommon.IsAppDeactive) {
              StringBuilder sb = new StringBuilder();
              sb.append(StorageOptionsCommon.STORAGEPATH);
              sb.append("/");
              sb.append(StorageOptionsCommon.AUDIOS_TEMP_FOLDER);
              File file = new File(sb.toString());
              if (file.exists() && file.isDirectory()) {
                  try {
                      FileUtils.deleteDirectory(file);
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
          }
          this.sensorManager.unregisterListener(this);
          if (AccelerometerManager.isListening()) {
              AccelerometerManager.stopListening();
          }
      }
  
  
      public void onResume() {
          super.onResume();
          if (AccelerometerManager.isSupported(this)) {
              AccelerometerManager.startListening(this);
          }
          SensorManager sensorManager2 = this.sensorManager;
          sensorManager2.registerListener(this, sensorManager2.getDefaultSensor(8), 3);
      }
  
      public void onSensorChanged(SensorEvent sensorEvent) {
          if (sensorEvent.sensor.getType() == 8 && sensorEvent.values[0] == 0.0f && PanicSwitchCommon.IsPalmOnFaceOn) {
              PanicSwitchActivityMethods.SwitchApp(this);
          }
      }
  
      public void onShake(float f) {
          if (PanicSwitchCommon.IsFlickOn || PanicSwitchCommon.IsShakeOn) {
              PanicSwitchActivityMethods.SwitchApp(this);
          }
      }
  }
  