org.tizen.web.sign_2.0.0.201311011708

16:50:47.543 INFO  jd.cli.Main - Decompiling org.tizen.web.sign_2.0.0.201311011708.jar
package org.tizen.web.sign;

import org.tizen.common.Surrogate;

class Activator$1
  implements Surrogate<Activator>
{
  public Activator getAdapter()
  {
    return Activator.access$0();
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.Activator.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign;

import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.tizen.common.CommonPlugin;
import org.tizen.common.Surrogate;
import org.tizen.common.core.command.Prompter;

public class Activator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.web.sign";
  private static Activator plugin;
  protected static Surrogate<Activator> surrogate = new Surrogate()
  {
    public Activator getAdapter()
    {
      return Activator.plugin;
    }
  };
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
    initializeDefaultPreferences();
  }
  
  private void initializeDefaultPreferences()
  {
    new DefaultScope().getNode("org.tizen.web.sign");
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
  
  public static ImageDescriptor getImageDescriptor(String path)
  {
    return imageDescriptorFromPlugin("org.tizen.web.sign", path);
  }
  
  public static void setSurrogate(Surrogate<Activator> surrogate)
  {
    surrogate = surrogate;
  }
  
  public static Surrogate<Activator> getSurrogate()
  {
    return surrogate;
  }
  
  public Prompter getPrompter()
  {
    return CommonPlugin.getDefault().getPrompter();
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.Activator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign;

class WebSigningPrompter$1
  implements Runnable
{
  WebSigningPrompter$1(WebSigningPrompter paramWebSigningPrompter) {}
  
  public void run() {}
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.WebSigningPrompter.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.core.runtime.OperationCanceledException;
import org.tizen.common.sign.SigningPrompter;
import org.tizen.common.util.SWTUtil;

public class WebSigningPrompter
  extends SigningPrompter
{
  public Object password(String message)
  {
    Map<String, char[]> result = new HashMap();
    AtomicBoolean isNotOK = new AtomicBoolean();
    
    SWTUtil.syncExec(new Runnable()
    {
      public void run() {}
    });
    if (isNotOK.get()) {
      throw new OperationCanceledException("Canceled sign process.");
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.WebSigningPrompter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign.developer;

import java.io.IOException;
import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.tizen.common.core.command.CommandCancelException;
import org.tizen.common.rds.DeltaResourceInfo;
import org.tizen.common.sign.exception.CertificationException;
import org.tizen.common.sign.model.DeltaListResource;
import org.tizen.web.sign.signing.GenerateSignatureXML;

public class DeveloperSignUtil
{
  private static final DeveloperSignUtil INSTANCE = new DeveloperSignUtil();
  
  public static DeveloperSignUtil getInstance()
  {
    return INSTANCE;
  }
  
  public void signForDebug(IResource root)
    throws CoreException
  {
    GenerateSignatureXML generateXML = new GenerateSignatureXML();
    try
    {
      generateXML.setSelectedProject(root);
      generateXML.run();
    }
    catch (IOException e)
    {
      throw createErrorMsg(e, Messages.DeveloperSignUtil_0);
    }
    catch (CertificationException e)
    {
      throw createErrorMsg(e, Messages.DeveloperSignUtil_0);
    }
    catch (CommandCancelException localCommandCancelException)
    {
      throw new OperationCanceledException("Canceled sign process.");
    }
  }
  
  public void signForRDS(IProject project, IContainer workingFolder, List<DeltaResourceInfo> deltaInfoList)
    throws CoreException
  {
    GenerateSignatureXML generateXML = new GenerateSignatureXML();
    DeltaListResource deltaRes = new DeltaListResource(project, workingFolder);
    try
    {
      int deltaCount = deltaRes.createListResource(deltaInfoList);
      if (deltaCount == 0) {
        return;
      }
      generateXML.setSelectedProject(deltaRes.getCurrentWorkingFolder());
      generateXML.run(true);
    }
    catch (IOException e)
    {
      throw createErrorMsg(e, Messages.DeveloperSignUtil_0);
    }
    catch (CertificationException e)
    {
      throw createErrorMsg(e, Messages.DeveloperSignUtil_0);
    }
    catch (CommandCancelException localCommandCancelException) {}finally
    {
      deltaRes.removeListResource();
    }
    deltaRes.removeListResource();
  }
  
  private CoreException createErrorMsg(Exception e, String msg)
  {
    return new CoreException(new Status(4, "org.tizen.web.sign", msg + e.getMessage()));
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.developer.DeveloperSignUtil
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign.developer;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.tizen.web.sign.developer.messages";
  public static String DeveloperSignUtil_0;
  
  static
  {
    NLS.initializeMessages("org.tizen.web.sign.developer.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.developer.Messages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign.messages;

import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.tizen.common.util.SWTUtil;
import org.tizen.web.sign.signing.Messages;

public class DetailsMessageDialog
  extends MessageDialog
{
  private String detail;
  private int detailButtonID = -1;
  private Text text;
  private int defaultButtonIndex = 0;
  private static final int TEXT_LINE_COUNT = 15;
  
  public DetailsMessageDialog(String dialogMessage, String message, int imageType, String[] buttonLables, int defaultIndex)
  {
    this(SWTUtil.getActiveShell(), Messages.DIALOG_TITLE, null, dialogMessage, message, imageType, buttonLables, defaultIndex);
  }
  
  public DetailsMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, String message, int dialogImageType, String[] dialogButtonLabels, int defaultIndex)
  {
    super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
    defaultButtonIndex = defaultIndex;
    detail = message;
    setShellStyle(getShellStyle() | 0x10000);
  }
  
  public int open()
  {
    create();
    Button b = getButton(defaultButtonIndex);
    b.setFocus();
    b.getShell().setDefaultButton(b);
    return super.open();
  }
  
  public void setDetailButton(int index)
  {
    detailButtonID = index;
  }
  
  protected void buttonPressed(int buttonId)
  {
    if (buttonId == detailButtonID) {
      toggleDetailsArea();
    } else {
      super.buttonPressed(buttonId);
    }
  }
  
  private void toggleDetailsArea()
  {
    Point windowSize = getShell().getSize();
    Point oldSize = getContents().computeSize(-1, -1);
    if (text != null)
    {
      text.dispose();
      text = null;
      getButton(detailButtonID).setText(IDialogConstants.SHOW_DETAILS_LABEL);
    }
    else
    {
      createDropDownText((Composite)getContents());
      getButton(detailButtonID).setText(IDialogConstants.HIDE_DETAILS_LABEL);
    }
    Point newSize = getContents().computeSize(-1, -1);
    getShell()
      .setSize(
      new Point(x, y + (
      y - y)));
  }
  
  protected void createDropDownText(Composite parent)
  {
    text = new Text(parent, 2816);
    text.setFont(parent.getFont());
    text.setText(detail);
    text.setEditable(false);
    GridData data = new GridData(1808);
    heightHint = (text.getLineHeight() * 15);
    horizontalSpan = 2;
    text.setLayoutData(data);
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.messages.DetailsMessageDialog
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign.messages;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class UIMessages
{
  private static final String BUNDLE_NAME = "org.tizen.web.sign.messages.UIMessages";
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.tizen.web.sign.messages.UIMessages");
  
  public static String getString(String key)
  {
    try
    {
      return RESOURCE_BUNDLE.getString(key);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + key + '!';
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.messages.UIMessages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign.signing;

import java.io.IOException;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.tizen.common.core.command.ExecutionContext;
import org.tizen.common.core.command.Prompter;
import org.tizen.common.sign.exception.CertificationException;
import org.tizen.common.sign.exception.ComplicatedCertificationException;
import org.tizen.common.sign.preferences.SigningProfile;
import org.tizen.common.sign.signer.SignatureGenerator;
import org.tizen.web.sign.messages.DetailsMessageDialog;
import org.tizen.web.sign.messages.UIMessages;

public class GenerateSignatureXML
  extends SignatureGenerator
  implements IObjectActionDelegate
{
  protected String selectedLocation;
  
  public void setActivePart(IAction action, IWorkbenchPart targetPart) {}
  
  public void run(IAction action)
  {
    try
    {
      run();
    }
    catch (ComplicatedCertificationException e)
    {
      DetailsMessageDialog dialog = new DetailsMessageDialog(
        UIMessages.getString("org.tizen.web.sign.certificatevalidityerror"), 
        e.getMessage(), 
        1, 
        new String[] { IDialogConstants.OK_LABEL, IDialogConstants.SHOW_DETAILS_LABEL }, 
        0);
      
      dialog.setDetailButton(1);
      dialog.open();
    }
    catch (CertificationException e)
    {
      newCtx.getPrompter().error(e.getMessage());
    }
    catch (IOException e)
    {
      newCtx.getPrompter().error(e.getMessage());
    }
  }
  
  public void run(boolean bRDS)
    throws CertificationException, IOException
  {
    setRDSMode(bRDS);
    run();
  }
  
  public void run()
    throws CertificationException, IOException
  {
    SigningProfile loadedProfiles = loadProfiles();
    
    sign(selectedLocation, loadedProfiles);
  }
  
  public void setSelectedProject(IResource selectedRoot)
  {
    if ((selectedRoot instanceof IProject))
    {
      selectedLocation = (selectedRoot.getName() + '/');
    }
    else
    {
      IPath fullPath = selectedRoot.getFullPath();
      IPath baseFullPath = selectedRoot.getProject().getParent().getFullPath();
      selectedLocation = fullPath.makeRelativeTo(baseFullPath).toString();
    }
  }
  
  public void selectionChanged(IAction action, ISelection selection)
  {
    if (!(selection instanceof IStructuredSelection)) {
      return;
    }
    Object selectedObject = ((IStructuredSelection)selection).getFirstElement();
    if (!(selectedObject instanceof IProject)) {
      return;
    }
    setSelectedProject((IProject)selectedObject);
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.signing.GenerateSignatureXML
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign.signing;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = Messages.class.getName();
  public static String DIALOG_TITLE;
  public static String ERROR_NO_ACTIVE_PROFILE;
  public static String FileBrowserCellEditor_2;
  public static String DIALOG_INPUT_PASSWORD;
  
  static
  {
    NLS.initializeMessages(BUNDLE_NAME, Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.signing.Messages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign.signing;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URL;
import org.apache.xml.security.signature.XMLSignatureInput;
import org.apache.xml.security.utils.resolver.ResourceResolverException;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
import org.tizen.common.util.IOUtil;
import org.w3c.dom.Attr;

public class SafeResolverLocalFilesystem
  extends ResolverLocalFilesystem
{
  public XMLSignatureInput engineResolve(Attr uri, String baseURI)
    throws ResourceResolverException
  {
    try
    {
      URL url = new URL(new URL(baseURI), uri.getValue());
      
      ByteArrayInputStream in = new ByteArrayInputStream(IOUtil.getBytes(url.openStream(), true));
      
      XMLSignatureInput input = new XMLSignatureInput(in);
      input.setSourceURI(url.toString());
      
      return input;
    }
    catch (IOException e)
    {
      throw new ResourceResolverException("generic.EmptyMessage", e, uri, baseURI);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.signing.SafeResolverLocalFilesystem
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign.signing;

import org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart;

public class SignatureEditor
  extends XMLMultiPageEditorPart
{}

/* Location:
 * Qualified Name:     org.tizen.web.sign.signing.SignatureEditor
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.sign.util;

import java.net.URLDecoder;
import java.net.URLEncoder;

public class UriUtil
{
  private static final char slash = '/';
  private static final char colon = ':';
  
  public static String encode(String uri)
  {
    StringBuilder builder = new StringBuilder();
    
    int start = 0;
    int i = 0;
    for (int length = uri.length(); i < length; i++)
    {
      char pos = uri.charAt(i);
      if (pos == '/')
      {
        String part = uri.substring(start, i);
        builder.append(URLEncoder.encode(part)).append('/');
        start = i + 1;
      }
      else if (pos == ':')
      {
        String part = uri.substring(start, i);
        builder.append(URLEncoder.encode(part)).append(':');
        start = i + 1;
      }
    }
    String part = uri.substring(start, uri.length());
    builder.append(URLEncoder.encode(part));
    
    return builder.toString().replace("+", "%20");
  }
  
  public static String decode(String val)
  {
    return URLDecoder.decode(val);
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.sign.util.UriUtil
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd