void ProcessAars(string dir)
{
string[] files = Directory.GetFiles(dir, "*.aar");
foreach (string f in files)
{
string dirPath = Path.Combine(dir, Path.GetFileNameWithoutExtension(f));
string targetPath = Path.Combine(dir, Path.GetFileName(f));
if (ShouldExplode(f))
{
ReplaceVariables(ProcessAar(Path.GetFullPath(dir), f));
targetPath = dirPath;
}
else
{
// Clean up previously expanded / exploded versions of the AAR.
if (Directory.Exists(dirPath))
{
PlayServicesSupport.DeleteExistingFileOrDirectory(dirPath);
}
}
aarExplodeData[f].path = targetPath;
aarExplodeData[f].bundleId = PlayerSettings.bundleIdentifier;
}
}