Пример #1
0
        public Fernflower(IIBytecodeProvider provider, IIResultSaver saver, Dictionary <string
                                                                                        , object> customProperties, IFernflowerLogger logger)
        {
            Dictionary <string, object> properties = new Dictionary <string, object>(IFernflowerPreferences.Defaults);

            if (customProperties != null)
            {
                Sharpen.Collections.PutAll(properties, customProperties);
            }
            string level = (string)properties.GetOrNull(IFernflowerPreferences.Log_Level);

            if (level != null)
            {
                try
                {
                    logger.SetSeverity(IFernflowerLogger.Severity.ValueOf(level.ToUpper()));
                }
                catch (ArgumentException)
                {
                }
            }
            structContext  = new StructContext(saver, this, new LazyLoader(provider));
            classProcessor = new ClassesProcessor(structContext);
            PoolInterceptor interceptor = null;

            if ("1".Equals(properties.GetOrNull(IFernflowerPreferences.Rename_Entities)))
            {
                helper = LoadHelper((string)properties.GetOrNull(IFernflowerPreferences.User_Renamer_Class
                                                                 ), logger);
                interceptor = new PoolInterceptor();
                converter   = new IdentifierConverter(structContext, helper, interceptor);
            }
            else
            {
                helper    = null;
                converter = null;
            }
            DecompilerContext context = new DecompilerContext(properties, logger, structContext
                                                              , classProcessor, interceptor);

            DecompilerContext.SetCurrentContext(context);
        }
Пример #2
0
 public virtual void ClearContext()
 {
     DecompilerContext.SetCurrentContext(null);
 }