コード例 #1
0
        /// <summary>
        /// Try loading the jar file to see if we have a stub jar.
        /// </summary>
        private void jarLoader_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            importCode = true;
            libName    = string.Empty;
            var jarPath = (string)e.Argument;

            try
            {
                var hasJarPath = !string.IsNullOrEmpty(jarPath) && File.Exists(jarPath);
                if (hasJarPath)
                {
                    var       jf = new JarFile(File.OpenRead(jarPath), jarPath, null);
                    ClassFile result;
                    if (jf.TryLoadClass("com/google/android/maps/MapActivity", out result))
                    {
                        importCode = false;
                        libName    = "com.google.android.maps";
                    }
                }
            }
            catch (Exception)
            {
                // Ignore
            }
        }
コード例 #2
0
ファイル: OpenJarFileTests.cs プロジェクト: Xtremrules/dot42
 public void Test()
 {
     var jf = new JarFile(new MemoryStream(Resources.android), "test", null);
     foreach (var name in jf.ClassNames)
     {
         ClassFile cf;
         jf.TryLoadClass(name, out cf);
     }
 }
コード例 #3
0
        public void Test()
        {
            var jf = new JarFile(new MemoryStream(Resources.android), "test", null);

            foreach (var name in jf.ClassNames)
            {
                ClassFile cf;
                jf.TryLoadClass(name, out cf);
            }
        }