Exemplo n.º 1
0
        public static bool BuildMap(string apkFileName, bool isDebugLog = false) {

            Clear();

            if (string.IsNullOrEmpty(apkFileName))
                return false;

            m_IsDebugLog = isDebugLog;

            // 使用解压线程
            if (m_IsDebugLog) {
                Debug.Log("=========>>>>>>开始解压APK>>>>>>>>======");
            }

            string exportDir = string.Format("{0}/{1}", Path.GetDirectoryName(apkFileName), Path.GetFileNameWithoutExtension(apkFileName));
            m_UnZipSoDir = exportDir.Replace('\\', '/');

            try {
                // 删除目录
                if (Directory.Exists(m_UnZipSoDir)) {
                    AssetBundleBuild.DeleteDirectorAndFiles(m_UnZipSoDir, m_IsDebugLog);
                }
            } catch (Exception e){
                Debug.LogError(e.ToString());
                return false;
            }

            EditorApplication.update += OnTimeUpdate;
            m_UnZipThread = new UnZipThread(apkFileName, m_UnZipSoDir, false, OnUnZipEnd);

            return true;
        }
Exemplo n.º 2
0
        private static void DisposeUnZipThread() {
            if (m_UnZipThread != null) {
                m_UnZipThread.Dispose();
                m_UnZipThread = null;
            }

            EditorApplication.update -= OnTimeUpdate;
            m_LastUnZipProcess = string.Empty;
        }