protected void enableJnlp(
     OperaPreferences paramOperaPreferences,
     File paramFile1,
     File paramFile2,
     boolean paramBoolean)
     throws IOException {
   if (paramOperaPreferences == null) paramOperaPreferences = getPreferences(paramFile1);
   if (paramOperaPreferences != null) {
     float f = 5.0F;
     String str = paramOperaPreferences.get("INSTALL", "OVER");
     if (str != null)
       try {
         f = Float.parseFloat(str.trim());
       } catch (NumberFormatException localNumberFormatException) {
         Trace.println(
             "Unable to determine Opera version from the preference file; assuming 5.0 or higher.",
             TraceLevel.BASIC);
       }
     if (f < 5.0F) {
       paramOperaPreferences.put("File Types Section Info", "Version", "1");
     } else if (!paramOperaPreferences.containsKey("File Types Section Info", "Version")) {
       if (f > 7.11F)
         Trace.println(
             "Setting '[File Types Section Info]Version=2' in the Opera preference file.",
             TraceLevel.BASIC);
       paramOperaPreferences.put("File Types Section Info", "Version", "2");
     }
     if ((paramBoolean == true)
         || (!paramOperaPreferences.containsKey("File Types", "application/x-java-jnlp-file"))) {
       Object[] arrayOfObject = {null, null};
       if ((f < 5.0F) || (!this.useDefault)) {
         arrayOfObject[0] = "3";
         try {
           arrayOfObject[1] = paramFile2.getCanonicalPath();
         } catch (IOException localIOException) {
           arrayOfObject[1] = paramFile2.getAbsolutePath();
         }
       } else {
         arrayOfObject[0] = "4";
         arrayOfObject[1] = "";
       }
       paramOperaPreferences.put(
           "File Types",
           "application/x-java-jnlp-file",
           MessageFormat.format("{0},{1},,,jnlp,|", arrayOfObject));
     }
     if ((f >= 5.0F)
         && (!paramOperaPreferences.containsKey(
             "File Types Extension", "application/x-java-jnlp-file")))
       paramOperaPreferences.put("File Types Extension", "application/x-java-jnlp-file", ",0");
     paramOperaPreferences.store(new FileOutputStream(paramFile1));
   }
 }
 public static int show(
     String paramString1,
     String paramString2,
     String paramString3,
     String paramString4,
     String paramString5,
     String paramString6,
     String paramString7,
     String paramString8,
     String paramString9,
     String paramString10,
     String paramString11,
     String paramString12) {
   if (_isMainToolkitThread())
     return showImmediately(
         paramString1,
         paramString2,
         paramString3,
         paramString4,
         paramString5,
         paramString6,
         paramString7,
         paramString8,
         paramString9,
         paramString10,
         paramString11,
         paramString12);
   String[] arrayOfString = {
     Environment.getJavaHome() + "/bin/java",
     "-cp",
     Environment.getJavaHome() + "/lib/deploy.jar",
     "com.sun.deploy.uitoolkit.ui.NativeMixedCodeDialog",
     paramString12
   };
   Trace.println(
       "NativeMixedCodeDialog executes the command in a separate process:", TraceLevel.UI);
   for (int i = 0; i < arrayOfString.length; i++)
     Trace.println("    args[" + i + "]=" + arrayOfString[i], TraceLevel.UI);
   i = -1;
   try {
     Process localProcess = Runtime.getRuntime().exec(arrayOfString);
     i = localProcess.waitFor();
     _activateCurrentProcess();
   } catch (Throwable localThrowable) {
     Trace.ignored(localThrowable);
     i = -1;
   }
   return i;
 }
 /*     */ private static void report(JSObject js, Record r) /*     */ {
   /* 179 */ long now = System.nanoTime();
   /* 180 */ long offset = (r.tm - now) / 1000000L;
   /* 181 */ String label = r.label;
   /*     */
   /* 183 */ if (lastReported == 0L) {
     /* 184 */ firstReported = now;
     /*     */ }
   /*     */
   /* 188 */ if (lastReported != 0L) {
     /* 189 */ label =
         "["
             + (now - firstReported + 500000L) / 1000000L
             + " ms"
             + "(delta="
             + (now - lastReported + 500000L) / 1000000L
             + ")] "
             + label;
     /*     */ }
   /*     */
   /* 196 */ Trace.println("PERFLOG: report [" + label + "]");
   /* 197 */ js.eval(
       "if (typeof perfLog == 'function') {    perfLog(" + offset + ", '" + label + "');}");
   /*     */
   /* 199 */ lastReported = now;
   /*     */ }
 public synchronized void instantiateApplet(Class paramClass)
     throws InstantiationException, IllegalAccessException {
   Trace.println("TextAppletAdapter instantiateApplet(): " + paramClass, TraceLevel.UI);
   if (null != this.applet) throw new IllegalStateException();
   if (!Applet2.class.isAssignableFrom(paramClass)) throw new IllegalArgumentException();
   this.applet = paramClass.newInstance();
 }
 /*     */ public PerfLoggerThread() {
   /*  68 */ super();
   /*  69 */ setDaemon(true);
   /*  70 */ if (DeployPerfLogger.PERF_LOG_ENABLED) {
     /*  71 */ Trace.println("Starting perf tracing thread");
     /*  72 */ start();
     /*     */ }
   /*     */ }
 public DesktopEntryFile(String paramString) {
   if (null == paramString) throw new NullPointerException("uri is null!");
   if (paramString.indexOf("://") == 0)
     throw new IllegalArgumentException("Invalid URI[" + paramString + "]!");
   this.uri = paramString;
   this.desktopEntries = new ArrayList();
   Trace.println("new DesktopEntryFile uri = [" + paramString + "]", TraceLevel.BASIC);
 }
  public static final void main(String[] paramArrayOfString) {
    int i = -1;
    try {
      TraceListener local1 =
          new TraceListener() {
            public void flush() {
              System.err.flush();
            }

            public void print(String paramAnonymousString) {
              System.err.print(paramAnonymousString);
            }
          };
      Trace.addTraceListener(local1);
      Trace.println("NativeMixedCodeDialog.main enter");
      Platform.get();
      String str1 = ResourceManager.getString("security.dialog.nativemixcode.title");
      String str2 = ResourceManager.getString("security.dialog.nativemixcode.masthead");
      String str3 = ResourceManager.getString("security.dialog.nativemixcode.message");
      String str4 = ResourceManager.getString("security.dialog.nativemixcode.info");
      String str5 = ResourceManager.getString("security.dialog.nativemixcode.blockBtnStr");
      String str6 = ResourceManager.getString("security.dialog.nativemixcode.dontBlockBtnStr");
      String str7 = ResourceManager.getString("security.dialog.nativemixcode.helpBtnStr");
      String str8 = ResourceManager.getString("security.dialog.nativemixcode.closeBtnStr");
      String str9 = ResourceManager.getString("security.dialog.nativemixcode.helpTitle");
      String str10 = ResourceManager.getString("security.dialog.nativemixcode.helpMessage");
      String str11 = ResourceManager.getString("security.dialog.nativemixcode.appLabelStr");
      String str12 = paramArrayOfString[0];
      if (isSupported()) {
        i =
            showImmediately(
                str1, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12);
        Trace.println("NativeMixedCodeDialog.show(...) returns " + i);
      } else {
        Trace.println("NativeMixedCodeDialog isn't supported");
      }
      Trace.println("NativeMixedCodeDialog.main exit");
      Trace.ensureMessageQueueProcessingStarted();
    } catch (Throwable localThrowable) {
      Trace.ignored(localThrowable);
      i = -1;
    }
    System.exit(i);
  }
 public boolean deleteToNonEmptyParent() {
   for (DesktopEntryFile localDesktopEntryFile = this;
       (null != localDesktopEntryFile)
           && (localDesktopEntryFile.exists())
           && (!localDesktopEntryFile.getURI().matches(".*://"))
           && (localDesktopEntryFile.delete());
       localDesktopEntryFile = localDesktopEntryFile.getParentDesktopEntryFile())
     Trace.println("file deleted " + localDesktopEntryFile.toString(), TraceLevel.BASIC);
   return true;
 }
 public void init() {
   markAlive(true);
   Trace.println("TextAppletAdapter init()", TraceLevel.UI);
   try {
     getApplet2().init(getApplet2Context());
   } catch (Throwable localThrowable) {
     Trace.ignored(localThrowable);
     throw new RuntimeException("Call to applet2.init() failed", localThrowable);
   }
 }
 public void preverifyJARs() {
   if (!ResourceProvider.get().canCache(null)) return;
   long l1 = System.currentTimeMillis();
   for (int i = 0; i < this._jarsInURLClassLoader.size(); i++) {
     JARDesc localJARDesc = (JARDesc) this._jarsInURLClassLoader.get(i);
     ResourceProvider.get()
         .preverifyCachedJar(localJARDesc.getLocation(), localJARDesc.getVersion(), this);
   }
   long l2 = System.currentTimeMillis();
   Trace.println(
       "PreverificationCL, Cached JAR preverification took (ms): " + (l2 - l1), TraceLevel.CACHE);
 }
 private void writeEntryInternal() throws IOException {
   DesktopEntryFile localDesktopEntryFile = getParentDesktopEntryFile();
   ArrayList localArrayList = new ArrayList();
   while ((null != localDesktopEntryFile) && (!localDesktopEntryFile.exists())) {
     localArrayList.add(localDesktopEntryFile);
     localDesktopEntryFile = localDesktopEntryFile.getParentDesktopEntryFile();
   }
   for (int i = localArrayList.size() - 1; i >= 0; i--) {
     localDesktopEntryFile = (DesktopEntryFile) localArrayList.get(i);
     Trace.println(
         "writeEntryInternal mkdir " + localDesktopEntryFile.toString(), TraceLevel.BASIC);
     localDesktopEntryFile.mkdir();
   }
   StringBuffer localStringBuffer = new StringBuffer();
   Iterator localIterator = this.desktopEntries.iterator();
   while (localIterator.hasNext()) {
     localStringBuffer.append(localIterator.next());
     localStringBuffer.append("\n");
   }
   Trace.println("gnome_vfs_write_file [" + this.uri.toString() + "]", TraceLevel.BASIC);
   boolean bool = gnome_vfs_write_file(this.uri.toString(), localStringBuffer.toString());
 }
 protected OperaPreferences getPreferences(File paramFile) throws IOException {
   OperaPreferences localOperaPreferences = null;
   if (paramFile.exists()) {
     if (paramFile.canRead()) {
       if (paramFile.canWrite()) {
         localOperaPreferences = new OperaPreferences();
         localOperaPreferences.load(new FileInputStream(paramFile));
       } else {
         Trace.println(
             "No write access to the Opera preference file (" + paramFile.getAbsolutePath() + ").",
             TraceLevel.BASIC);
       }
     } else
       Trace.println(
           "No read access to the Opera preference file (" + paramFile.getAbsolutePath() + ").",
           TraceLevel.BASIC);
   } else
     Trace.println(
         "The Opera preference file (" + paramFile.getAbsolutePath() + ") does not exist.",
         TraceLevel.BASIC);
   return localOperaPreferences;
 }
 public synchronized Preloader instantiatePreloader(Class paramClass) {
   Trace.println("TextAppletAdapter createCustomProgress " + paramClass, TraceLevel.UI);
   if (paramClass != null)
     try {
       Class[] arrayOfClass = {Applet2Context.class};
       Object[] arrayOfObject = {null};
       Constructor localConstructor = null;
       localConstructor = paramClass.getConstructor(arrayOfClass);
       this.preloader = ((Preloader) localConstructor.newInstance(arrayOfObject));
     } catch (Exception localException) {
       Trace.ignored(localException);
     }
   if (this.preloader == null) this.preloader = new TextPreloader();
   return this.preloader;
 }
 /*     */ public void run() {
   /*     */ try {
     /*  78 */ boolean doRun = true;
     /*  79 */ long tm = System.currentTimeMillis();
     /*  80 */ while (doRun) {
       /*  81 */ if (DeployPerfLogger.access$000() != null) {
         /*     */ try {
           /*  83 */ DeployPerfLogger.access$100();
           /*  84 */ DeployPerfLogger.access$202(false);
           /*     */ } catch (Exception e) {
           /*  86 */ if (DeployPerfLogger.gotError)
           /*     */ {
             /*  88 */ doRun = false;
             /*  89 */ Trace.ignoredException(e);
             /*     */ } else {
             /*  91 */ DeployPerfLogger.access$202(true);
             /*     */ }
           /*  93 */ synchronized (DeployPerfLogger.class) {
             /*  94 */ DeployPerfLogger.access$302(null);
             /*     */ }
           /*     */ }
         /*     */ }
       /*  98 */ else if (System.currentTimeMillis() - tm > 5000L) {
         /*  99 */ Trace.println("Stop perf tracing as could not get JS object");
         /*     */
         /* 101 */ doRun = false;
         /*     */ }
       /*     */
       /* 104 */ synchronized (DeployPerfLogger.queue)
       /*     */ {
         /*     */ try {
           /* 107 */ DeployPerfLogger.queue.wait(10000L);
           /*     */ } catch (InterruptedException ie) {
           /* 109 */ doRun = false;
           /*     */ }
         /*     */ }
       /*     */ }
     /*     */ } catch (Throwable t) {
     /* 114 */ Trace.ignored(t);
     /*     */ } finally {
     /* 116 */ synchronized (this) {
       /* 117 */ this.isActive = false;
       /*     */ }
     /*     */ }
   /*     */ }
 public void abort() {
   Trace.println("TextAppletAdapter.abort() called");
   this.applet = null;
 }
 public void start() {
   markAlive(true);
   Trace.println("TextAppletAdapter start()", TraceLevel.UI);
   getApplet2().start();
 }
 public void stop() {
   Trace.println("TextAppletAdapter stop()", TraceLevel.UI);
   getApplet2().stop();
   markAlive(false);
 }
 public void destroy() {
   Trace.println("TextAppletAdapter destroy()", TraceLevel.UI);
   getApplet2().destroy();
 }
 public void instantiateSerialApplet(ClassLoader paramClassLoader, String paramString) {
   Trace.println("Request to load serial applet from " + paramString + ". Noop.");
 }
 public void resize(int paramInt1, int paramInt2) {
   Trace.println("TextAppletAdapter resize()", TraceLevel.UI);
 }
 public void doClearAppletArea() {
   Trace.println("TextAppletAdapter removeApplet()", TraceLevel.UI);
 }
 public void doShowApplet() {
   Trace.println("TextAppletAdapter showApplet()", TraceLevel.UI);
 }
 public void doShowPreloader() {
   Trace.println("TextAdapter: request to show preloader", TraceLevel.UI);
 }
 public void setParentContainer(Window paramWindow) {
   Trace.println("TextAppletAdapter setParentContainer(): " + paramWindow, TraceLevel.UI);
   this.parent = paramWindow;
 }
 public void doShowError(String paramString, Throwable paramThrowable, boolean paramBoolean) {
   Trace.println(
       "TextAdapter: request to show error (offerReload=" + paramBoolean + ")", TraceLevel.UI);
   if (paramThrowable != null) Trace.ignored(paramThrowable);
 }
  private Object openLockFileObject(int paramInt1, String paramString, int paramInt2, boolean paramBoolean1, boolean paramBoolean2)
    throws IOException
  {
    int i = paramInt2 == 0 ? 1 : 0;
    boolean bool = paramString.equals("r");
    SyncAccess.Lock localLock = this.fileAccSync.lock(bool ? 2 : 4);
    Object localObject1 = null;
    try
    {
      while (null == localObject1)
      {
        if (paramBoolean1)
          localObject1 = AccessController.doPrivileged(new PrivilegedAction(paramInt1, paramString, paramBoolean2)
          {
            private final int val$type;
            private final String val$mode;
            private final boolean val$fopt1;

            public Object run()
            {
              Object localObject = null;
              try
              {
                switch (this.val$type)
                {
                case 1:
                  localObject = new RandomAccessFile(SyncFileAccess.this.file, this.val$mode);
                  break;
                case 2:
                  localObject = new FileInputStream(SyncFileAccess.this.file);
                  break;
                case 3:
                  localObject = new FileOutputStream(SyncFileAccess.this.file.getPath(), this.val$fopt1);
                  break;
                default:
                  throw new InternalError("wrong fobj type: " + this.val$type);
                }
              }
              catch (FileNotFoundException localFileNotFoundException)
              {
                Trace.ignoredException(localFileNotFoundException);
              }
              return localObject;
            }
          });
        else
          try
          {
            switch (paramInt1)
            {
            case 1:
              localObject1 = new RandomAccessFile(this.file, paramString);
              break;
            case 2:
              localObject1 = new FileInputStream(this.file);
              break;
            case 3:
              localObject1 = new FileOutputStream(this.file.getPath(), paramBoolean2);
              break;
            default:
              throw new InternalError("wrong fobj type: " + paramInt1);
            }
          }
          catch (FileNotFoundException localFileNotFoundException)
          {
            Trace.ignoredException(localFileNotFoundException);
          }
        if (null == localObject1)
          throw new FileNotFoundException("index file not found");
        if (!Config.isJavaVersionAtLeast14())
        {
          if (localObject1 != null)
          {
            localObject2 = FObjLock.createFObjLock(paramInt1, localObject1, localLock);
            return localObject2;
          }
          localObject2 = null;
          return localObject2;
        }
        Object localObject2 = null;
        switch (paramInt1)
        {
        case 1:
          localObject2 = ((RandomAccessFile)localObject1).getChannel();
          break;
        case 2:
          localObject2 = ((FileInputStream)localObject1).getChannel();
          break;
        case 3:
          localObject2 = ((FileOutputStream)localObject1).getChannel();
          break;
        default:
          throw new InternalError("wrong fobj type: " + paramInt1);
        }
        if (!((FileChannel)localObject2).isOpen())
        {
          localObject2 = null;
          localObject1 = null;
          if ((i == 0) && (paramInt2 <= 0))
            throw new IOException("index file could not be opened, timeout reached");
          Trace.println("SyncFileAccess.openLock: index file not opened, remaining TO : " + paramInt2, TraceLevel.NETWORK);
          try
          {
            if (i == 0)
            {
              Thread.sleep(paramInt2);
              paramInt2 -= 100;
            }
            else
            {
              Thread.sleep(100L);
            }
          }
          catch (Exception localException1)
          {
          }
          continue;
        }
        try
        {
          FileLock localFileLock = null;
          while (localFileLock == null)
            try
            {
              localFileLock = ((FileChannel)localObject2).lock(0L, 9223372036854775807L, bool);
            }
            catch (OverlappingFileLockException localOverlappingFileLockException)
            {
              if ((i == 0) && (paramInt2 <= 0))
                throw new IOException("handled OverlappingFileLockException, timeout reached", localOverlappingFileLockException);
              Trace.println("SyncFileAccess.openLock: handled OverlappingFileLockException, remainint TO : " + paramInt2, TraceLevel.NETWORK);
              try
              {
                if (i == 0)
                {
                  Thread.sleep(paramInt2);
                  paramInt2 -= 100;
                }
                else
                {
                  Thread.sleep(100L);
                }
              }
              catch (Exception localException3)
              {
              }
              localFileLock = null;
            }
            catch (IOException localIOException)
            {
              localObject1 = null;
              Object localObject3 = null;
              if (localObject1 == null)
                localLock.release();
              return localObject3;
            }
        }
        catch (ClosedChannelException localClosedChannelException)
        {
          localObject2 = null;
          localObject1 = null;
          if ((i == 0) && (paramInt2 <= 0))
            throw new IOException("handled ClosedChannelException, timeout reached", localClosedChannelException);
          Trace.println("SyncFileAccess.openLock: handled ClosedChannelException, remaining TO: " + paramInt2, TraceLevel.NETWORK);
          try
          {
            if (i == 0)
            {
              Thread.sleep(paramInt2);
              paramInt2 -= 100;
            }
            else
            {
              Thread.sleep(100L);
            }
          }
          catch (Exception localException2)
          {
          }
        }
      }
    }
    finally
    {
      if (localObject1 == null)
        localLock.release();
    }
    if (localObject1 != null)
      return FObjLock.createFObjLock(paramInt1, localObject1, localLock);
    return null;
  }
  private static int showImmediately(
      String paramString1,
      String paramString2,
      String paramString3,
      String paramString4,
      String paramString5,
      String paramString6,
      String paramString7,
      String paramString8,
      String paramString9,
      String paramString10,
      String paramString11,
      String paramString12) {
    if ((paramString1 == null)
        || (paramString2 == null)
        || (paramString3 == null)
        || (paramString4 == null)
        || (paramString5 == null)
        || (paramString6 == null)
        || (paramString7 == null)
        || (paramString8 == null)
        || (paramString9 == null)
        || (paramString10 == null)
        || (paramString11 == null)
        || (paramString12 == null)) {
      Trace.println("parameters shouldn't be null", TraceLevel.UI);
      return -1;
    }
    PrivilegedAction local2 =
        new PrivilegedAction() {
          private final String val$title;
          private final String val$masthead;
          private final String val$message;
          private final String val$info;
          private final String val$blockBtnStr;
          private final String val$dontBlockBtnStr;
          private final String val$helpBtnStr;
          private final String val$closeBtnStr;
          private final String val$helpTitle;
          private final String val$helpMessage;
          private final String val$appLabelStr;
          private final String val$appTitle;

          public Object run() {
            int i =
                NativeMixedCodeDialog._show(
                    this.val$title,
                    this.val$masthead,
                    this.val$message,
                    this.val$info,
                    this.val$blockBtnStr,
                    this.val$dontBlockBtnStr,
                    this.val$helpBtnStr,
                    this.val$closeBtnStr,
                    this.val$helpTitle,
                    this.val$helpMessage,
                    this.val$appLabelStr,
                    this.val$appTitle);
            return new Integer(i);
          }
        };
    try {
      return ((Integer) AccessController.doPrivileged(local2)).intValue();
    } catch (Throwable localThrowable) {
      Trace.ignored(localThrowable);
    }
    return -1;
  }