diff --git a/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java b/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java index dc4b86fa3..39055c622 100644 --- a/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java +++ b/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java @@ -82,6 +82,7 @@ import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +import myname.pdlive.shayu.BuildConfig; import myname.pdlive.shayu.R; @@ -165,13 +166,12 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL Log.i("downLoad","架构: " + Build.CPU_ABI); if(CommonAppConfig.IS_GOOGLE_PLAY == 0){ - //链接包 下载so库 + //链接包 下载美颜so库 checkFaceUnitySOFile(); // checkAgoraSOFile(); - }else { - //渠道包 - mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000); } + mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000); + } @@ -186,6 +186,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL //解压后的文件数量必须要有2个 //如果文件存在,解压后 文件数量一致,直接进入下一步 if (fileSo.exists() && getFileCount(fileSoList.getAbsolutePath()) == 2){ + MainActivity.faceSDKIsLoadSuceness = true; mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000); return; } @@ -194,10 +195,10 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL Log.i("download", soUrl); if (!fileSo.exists()) { - downloadSo(outputDir.getAbsolutePath(), soUrl,Constants.FaceUnity_SO_Name,true); + downloadSo(outputDir.getAbsolutePath(), soUrl,Constants.FaceUnity_SO_Name,false); }else if (fileSo.exists() && getFileCount(outputDir.getAbsolutePath()) < 3) { fileSo.delete(); - downloadSo(outputDir.getAbsolutePath(), soUrl,Constants.FaceUnity_SO_Name,true); + downloadSo(outputDir.getAbsolutePath(), soUrl,Constants.FaceUnity_SO_Name,false); } } @@ -282,6 +283,10 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL File fileSo = new File(outputDir, fileName); try { unzip(fileSo.getAbsolutePath(), outputDir); + MainActivity.faceSDKIsLoadSuceness = true; + if (BuildConfig.DEBUG){ + ToastUtil.showDebug("美颜SDK加载成功..."); + } } catch (Exception e) { Log.e("ZipCheck", "Error reading ZIP file", e); throw new RuntimeException(e); @@ -316,7 +321,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath)); ZipEntry entry = zipIn.getNextEntry(); while (entry != null) { - String filePath = destDirectory + File.separator + sanitizePath(entry.getName()); Log.d("Unzip", "Extracting: " + filePath); if (!entry.isDirectory()) { diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 7025e1357..e599f31ea 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -826,6 +826,7 @@ 點此輸入回復內容 暫時只對主播開放 + 請稍等,美顏SDK加載中 2011402032399020 959584e054a33614996361f0044e5253 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 31ff8afe0..2b2f2598b 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -786,6 +786,7 @@ Click here to enter the reply For the time being, it is only open to the anchor + Please wait, the beauty SDK is loading. 2011402032399020 959584e054a33614996361f0044e5253 diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index d2d23bf52..f5ecdf256 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -206,6 +206,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene private View floatWarOrder;//战令浮窗 private List startListNotifyList = new ArrayList<>(); private String[] libNameList = new String[]{"agora-core", "agora-ffmpeg", "agora-fdkaac", "agora-soundtouch","agora-rtc-sdk"}; + // 美颜SDK是否已经加载成功 + public static boolean faceSDKIsLoadSuceness = false; @Override diff --git a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java index 4b5f68ad5..aa9da03dd 100644 --- a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java +++ b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java @@ -41,6 +41,7 @@ import com.yunbao.live.activity.LiveAnchorActivity; import com.yunbao.live.activity.LiveSwAnchorActivity; import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.main.R; +import com.yunbao.main.activity.MainActivity; import com.yunbao.main.activity.MyWebViewActivity; import com.yunbao.main.interfaces.MainStartChooseCallback; @@ -167,6 +168,11 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O public void onLiveClick() { boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType(); if (isAnchor) { + // 判断美颜SDK是否加载成功 + if (!MainActivity.faceSDKIsLoadSuceness){ + ToastUtil.show(getString(R.string.wait_face_sdk_load)); + return; + } String[] permissions; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { permissions = new String[]{