|
|
@@ -15,6 +15,7 @@ import com.baidu.idl.face.platform.FaceSDKManager;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.util.Constant;
|
|
|
import com.sheep.gamegroup.util.DeviceUtil;
|
|
|
+import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.upfile.UpFileListener;
|
|
|
import com.sheep.gamegroup.util.upfile.UpFileUtils;
|
|
|
import com.snail.antifake.jni.EmulatorDetectUtil;
|
|
|
@@ -69,26 +70,25 @@ public class FaceWithQRActivity extends BaseActivity {
|
|
|
}
|
|
|
|
|
|
private void dispatch() {
|
|
|
-// if (CameraUtil.hasCamera()) {
|
|
|
-// if (!useQR) {
|
|
|
- if(!EmulatorDetectUtil.isEmulator()){
|
|
|
+ if (!EmulatorDetectUtil.isEmulator()) {
|
|
|
if (type == Constant.INTENT_DETECT_LIVENESS) {
|
|
|
FaceSDKManager.getInstance().goLivenessCheck(this, FaceSDKManager.NEED_FILEPATH);
|
|
|
} else {
|
|
|
FaceSDKManager.getInstance().goFaceDetect(this, FaceSDKManager.NEED_FILEPATH);
|
|
|
}
|
|
|
} else {
|
|
|
- Intent intent = new Intent(this, QRCodeActivity.class);
|
|
|
- if(type == Constant.INTENT_DETECT_LIVENESS){
|
|
|
- intent.putExtra("req", "sheep://liveness");
|
|
|
- }else{
|
|
|
- intent.putExtra("req", "sheep://facedetect");
|
|
|
- }
|
|
|
- intent.putExtra("message", "检测到你的账号异常,需要人脸识别验证");
|
|
|
- intent.putExtra("token", token);
|
|
|
- intent.putExtra("extra", "");
|
|
|
- startActivityForResult(intent, Constant.INTENT_QRCODE_DATA);
|
|
|
+ showQRCode();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void showQRCode() {
|
|
|
+ String req = null;
|
|
|
+ if (type == Constant.INTENT_DETECT_LIVENESS) {
|
|
|
+ req = "sheep://liveness";
|
|
|
+ } else {
|
|
|
+ req = "sheep://facedetect";
|
|
|
}
|
|
|
+ Jump2View.getInstance().gotoShowQRCode(this, req, token, "检测到你的账号异常,需要人脸识别验证", Constant.INTENT_QRCODE_DATA);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -97,10 +97,12 @@ public class FaceWithQRActivity extends BaseActivity {
|
|
|
if (resultCode == RESULT_OK && data != null) {
|
|
|
if (requestCode == Constant.INTENT_QRCODE_DATA) {
|
|
|
returnResult(data.getStringExtra("result"));
|
|
|
- } else if (requestCode == Constant.INTENT_DETECT_LIVENESS) {
|
|
|
- uploadFace(data.getStringExtra("bestPath"));
|
|
|
- } else if (requestCode == Constant.INTENT_DETECT_FACE) {
|
|
|
- uploadFace(data.getStringExtra("bestPath"));
|
|
|
+ } else if (requestCode == Constant.INTENT_DETECT_LIVENESS || requestCode == Constant.INTENT_DETECT_FACE) {
|
|
|
+ if (data.hasExtra("no_camera")) {
|
|
|
+ showQRCode();
|
|
|
+ } else {
|
|
|
+ uploadFace(data.getStringExtra("bestPath"));
|
|
|
+ }
|
|
|
} else {
|
|
|
finish();
|
|
|
}
|