Kaynağa Gözat

升级app时继承渠道

zengjiebin 7 yıl önce
ebeveyn
işleme
eef27537a2

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/util/SysAppUtil.java

@@ -494,6 +494,15 @@ public class SysAppUtil {
                     .setBtnLeftText(file.exists() ? "立即安装" : "立即更新").setBtnLeftNotDissDialog(true).setBtnLeftOnClickListener(new View.OnClickListener() {
                 private void installApk(File file){
                     if(file != null && file.exists()) {
+                        //升级后继承渠道
+                        String channel = ChannelContent.getInstance().getChannel_name();
+                        try {
+                            if(!TextUtils.isEmpty(channel) && !ZipChannelUtil.isAddQUA(file)){
+                                ZipChannelUtil.writeQUA(file, channel);
+                            }
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        }
                         ApkUtils.installApk(SheepApp.getInstance(), file.getAbsolutePath());
                     }
                 }