All Downloads are FREE. Search and download functionalities are using the official Maven repository.

proguard.obfuscate.NameObfuscationReferenceFixer Maven / Gradle / Ivy

Go to download

ProGuard is a free shrinker, optimizer, obfuscator, and preverifier for Java bytecode

There is a newer version: 7.6.0
Show newest version
/*
 * ProGuard -- shrinking, optimization, obfuscation, and preverification
 *             of Java bytecode.
 *
 * Copyright (c) 2002-2022 Guardsquare NV
 */

package proguard.obfuscate;

import proguard.AppView;
import proguard.Configuration;
import proguard.obfuscate.kotlin.KotlinModuleFixer;
import proguard.pass.Pass;
import proguard.resources.file.visitor.ResourceFileProcessingFlagFilter;
import proguard.util.ProcessingFlags;

/**
 * This pass fixes references between Java code and resource files.
 *
 * @see Obfuscator
 *
 * @author Tim Van Den Broecke
 */
public class NameObfuscationReferenceFixer
implements   Pass
{
    private final Configuration configuration;

    public NameObfuscationReferenceFixer(Configuration configuration)
    {
        this.configuration = configuration;
    }


    @Override
    public void execute(AppView appView)
    {
        if (configuration.keepKotlinMetadata)
        {
            // Fix the Kotlin modules so the filename matches and the class names match.
            appView.resourceFilePool.resourceFilesAccept(
                new ResourceFileProcessingFlagFilter(0, ProcessingFlags.DONT_PROCESS_KOTLIN_MODULE,
                new KotlinModuleFixer()));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy