コード例 #1
0
 public DecompilerContext(Dictionary <string, object> properties, IFernflowerLogger
                          logger, StructContext structContext, ClassesProcessor classProcessor, PoolInterceptor
                          interceptor)
 {
     this.properties       = properties;
     this.logger           = logger;
     this.structContext    = structContext;
     this.classProcessor   = classProcessor;
     this.poolInterceptor  = interceptor;
     this.counterContainer = new CounterContainer();
 }
コード例 #2
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);
        }