From e69796e158e0d70cacac25afedeb8899996d5764 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=80=81=E7=9A=AE?=
<14840170+lao-pi123@user.noreply.gitee.com>
Date: Wed, 25 Sep 2024 15:46:52 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=9B=B8=E5=BF=83=E7=BE=8E=E9=A2=9CS?=
=?UTF-8?q?o=E6=96=87=E4=BB=B6=E9=9D=99=E9=BB=98=E5=8A=A0=E8=BD=BD?=
=?UTF-8?q?=EF=BC=8C=E4=BD=86=E6=98=AF=E4=B8=8D=E6=98=BE=E7=A4=BA=E4=B8=8B?=
=?UTF-8?q?=E8=BD=BD=E5=BC=B9=E7=AA=97=202=E3=80=81so=E6=9C=AA=E5=8A=A0?=
=?UTF-8?q?=E8=BD=BD=E6=88=90=E5=8A=9F=E4=B8=BB=E6=92=AD=E5=BC=80=E6=92=AD?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=9A=E8=AF=B7=E7=A8=8D=E7=AD=89....=203?=
=?UTF-8?q?=E3=80=81app=E7=BB=84=E4=BB=B6=E6=B2=A1=E6=9C=89=E4=BE=9D?=
=?UTF-8?q?=E8=B5=96=E5=85=AC=E5=85=B1=E7=BB=84=E4=BB=B6=EF=BC=8C=E4=BE=9D?=
=?UTF-8?q?=E8=B5=96=E4=BA=86main=E7=BB=84=E4=BB=B6,=E7=8E=B0=E7=9B=B4?=
=?UTF-8?q?=E6=8E=A5=E4=BD=BF=E7=94=A8=E7=BB=84=E4=BB=B6=E4=B9=8B=E9=97=B4?=
=?UTF-8?q?=E9=80=9A=E4=BF=A1=E4=BA=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../phonelive/activity/LauncherActivity.java | 18 +++++++++++-------
common/src/main/res/values-zh/strings.xml | 1 +
common/src/main/res/values/strings.xml | 1 +
.../com/yunbao/main/activity/MainActivity.java | 2 ++
.../main/dialog/MainStartDialogFragment.java | 6 ++++++
5 files changed, 21 insertions(+), 7 deletions(-)
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[]{