Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase performance/speed #21

Open
MustafaBalti opened this issue May 28, 2019 · 0 comments
Open

Increase performance/speed #21

MustafaBalti opened this issue May 28, 2019 · 0 comments

Comments

@MustafaBalti
Copy link

Working perfectly but taking 1:30 to 2:00 mints for Apk extraction/response .How to improve the performance/speed?
MyCode

        Stream stream = System.IO.File.OpenRead(filePath);
        using (ICSharpCode.SharpZipLib.Zip.ZipInputStream zip = new ICSharpCode.SharpZipLib.Zip.ZipInputStream(stream))
        {
            using (var filestream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
            {
                ICSharpCode.SharpZipLib.Zip.ZipFile zipfile = new ICSharpCode.SharpZipLib.Zip.ZipFile(filestream);
                ICSharpCode.SharpZipLib.Zip.ZipEntry item;

                foreach (ICSharpCode.SharpZipLib.Zip.ZipEntry entry in zipfile)
                {
                    if (entry.Name.ToLower() == "androidmanifest.xml")
                    {
                        Stream stream1 = zipfile.GetInputStream(entry);
                        manifestData = new byte[50 * 1024];
                        stream1.Read(manifestData, 0, manifestData.Length);
                    }
                    if (entry.Name.ToLower() == "resources.arsc")
                    {
                        Stream stream2 = zipfile.GetInputStream(entry);
                        BinaryReader binaryReader = new BinaryReader(stream2);
                        resourcesData = binaryReader.ReadBytes((int)entry.Size);
                    }
                }
            }

            ApkReader apkReader = new ApkReader();
            ApkInfo info = apkReader.extractInfo(manifestData, resourcesData);
            model.packageName = string.Format("Package Name: {0}", info.packageName);
            model.VersionName = string.Format("Version Name: {0}",info.versionName);
            model.VersionCode = string.Format("Version Code: {0}",info.versionCode);

        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant