public EncodeHandler(SolutionProperties properties)
 {
     _javaFile = CrcsSettings.Current.JavaFile;
     _apkToolFile = properties.ApkToolFile;
     _verbose = properties.ApkToolVerbose;
     _canDecodeAndEncode = properties.CanDecodeAndEncode;
 }
 public SignApkHandler(SolutionProperties properties)
 {
     _javaFile = CrcsSettings.Current.JavaFile;
     _canSign = properties.CanSign;
     if (!_canSign) return;
     _signApkFile = properties.SignApkFile;
     _certificateFile = properties.Certificate.CertificateFile;
     _certificateKeyFile = properties.Certificate.CertificateKeyFile;
 }
 protected SmaliBaksmaliBase(SolutionProperties properties)
 {
     _javaFile = CrcsSettings.Current.JavaFile;
     _baksmaliFile = properties.BaksmaliFile;
     _canDecompile = properties.CanDecompile;
     _smaliFile = properties.SmaliFile;
     _useSmaliApiLevel = GetSmaliVersion() == "1.3.0";
     _useBaksmaliApiLevel = GetBaksmaliVersion() == "1.3.0";
     _canRecompile = properties.CanRecompile;
 }
Esempio n. 4
0
 private CrcsSolution(string fileSystemPath)
 {
     SetValuesFromFileSystemPath(fileSystemPath);
     _properties = new SolutionProperties(this);
     _properties.PropertyChanged += PropertiesPropertyChanged;
 }
 public OptiPngHandler(SolutionProperties properties)
 {
     _canOptimizePng = properties.CanOptimizePng;
     _optiPngFile = properties.OptiPngFile;
 }
        public static IEnumerable<IFileHandler> CreateFileHandlers(ProcessingOptions processingOptions,
            SolutionProperties properties)
        {
            bool optimizePng = (ProcessingOptions.OptimizePng & processingOptions) != 0;
            bool packageModified = false;

            var fileHandlers = new List<IFileHandler>();
            fileHandlers.Add(new BackupFilesHandler());

            if ((ProcessingOptions.DeOdex & processingOptions) != 0)
            {
                fileHandlers.Add(new DeOdexHandler(properties));
                packageModified = true;
                if (optimizePng)
                {
                    fileHandlers.Add(new UnPackHandler());
                    fileHandlers.Add(new OptiPngHandler(properties));
                    fileHandlers.Add(new RePackPngHandler());
                }
            }
            else
            {
                if ((ProcessingOptions.Decompile & processingOptions) != 0)
                {
                    fileHandlers.Add(new BaksmaliHandler(properties));
                }

                if ((ProcessingOptions.Decode & processingOptions) != 0)
                {
                    fileHandlers.Add(new DecodeHandler(properties));
                }
                else if (optimizePng)
                {
                    fileHandlers.Add(new UnPackHandler());
                }

                if ((ProcessingOptions.ProcessModifications & processingOptions) != 0)
                {
                    fileHandlers.Add(new ModPlugInHandler());
                }

                if (optimizePng)
                {
                    fileHandlers.Add(new OptiPngHandler(properties));
                }

                if ((ProcessingOptions.Encode & processingOptions) != 0)
                {
                    fileHandlers.Add(new EncodeHandler(properties));
                    packageModified = true;
                }
                else if (optimizePng)
                {
                    fileHandlers.Add(new RePackPngHandler());
                    packageModified = true;
                }

                if ((ProcessingOptions.Recompile & processingOptions) != 0)
                {
                    fileHandlers.Add(new SmaliHandler(properties));
                    packageModified = true;
                }

                if ((ProcessingOptions.ReSignApkFiles & processingOptions) != 0 && packageModified)
                {
                    fileHandlers.Add(new SignApkHandler(properties));
                }
            }
            if (packageModified)
            {
                fileHandlers.Add(new ZipAlignHandler(properties));
            }
            return fileHandlers;
        }
 public BaksmaliHandler(SolutionProperties properties)
     : base(properties)
 {
 }
 private CrcsSolution(string fileSystemPath)
 {
     SetValuesFromFileSystemPath(fileSystemPath);
     _properties = new SolutionProperties(this);
     _properties.PropertyChanged += PropertiesPropertyChanged;
 }
 public UpdateZipHandler(SolutionProperties properties)
 {
     _zipFileName = Path.Combine(properties.OutputUpdateZip);
     FileUtility.DeleteFile(_zipFileName);
     _zipFile = new ZipFile(_zipFileName);
 }
 public DeOdexHandler(SolutionProperties properties)
     : base(properties)
 {
 }
 public ZipAlignHandler(SolutionProperties properties)
 {
     _zipAlignFile = properties.ZipAlignFile;
     _canZipAlign = properties.CanZipAlign;
 }