コード例 #1
0
        internal static ApkInfo Merge(ApkInfo init, IEnumerable <ApkInfo> apks)
        {
            if (init == null)
            {
                init = new ApkInfo();
            }

            var appApk = apks.FirstOrDefault(a => a.AppName.Length > 0);

            if (appApk != null)
            {
                init.AppName = appApk.AppName;
            }

            var pckApk = apks.FirstOrDefault(a => a.PackageName.Length > 0);

            if (pckApk != null)
            {
                init.Version     = pckApk.Version;
                init.PackageName = pckApk.PackageName;
            }

            var sdkApk = apks.FirstOrDefault(a => !SDKInfo.Unknown.Equals(a.MinSDK));

            if (sdkApk != null)
            {
                init.MinSDK    = sdkApk.MinSDK;
                init.TargetSDK = sdkApk.TargetSDK;
            }

            var perApk = apks.FirstOrDefault(a => a.Permissions.Count > 0);

            if (perApk != null)
            {
                init.Permissions = perApk.Permissions;
            }

            var scrApk = apks.FirstOrDefault(a => a.SupportScreens.Count > 0);

            if (scrApk != null)
            {
                init.SupportScreens = scrApk.SupportScreens;
            }

            var iconApk = apks.FirstOrDefault(a => !Icon.Default.Equals(a.Icon));

            if (iconApk != null)
            {
                init.Icon = iconApk.Icon;
            }

            var pathApk = apks.FirstOrDefault(a => a.FullPath.Length > 0);

            if (pathApk != null)
            {
                init.FullPath = pathApk.FullPath;
            }

            return(init);
        }
コード例 #2
0
        internal ApkInfo megre(params ApkInfo[] apks)
        {
            if (apks.Any(a => a == null))
            {
                throw new ArgumentNullException();
            }

            return(ApkInfo.Merge(this, apks));
        }
コード例 #3
0
 internal static ApkInfo Merge(IEnumerable <ApkInfo> apks)
 {
     return(ApkInfo.Merge(null, apks));
 }