Ejemplo n.º 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
            }
        }
Ejemplo n.º 2
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);
     }
 }
Ejemplo n.º 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);
            }
        }