processMainActivity method
Implementation
Future<void> processMainActivity(File path, String type) async {
var extension = type == 'java' ? 'java' : 'kt';
print('Project is using $type');
print('Updating MainActivity.$extension');
await replaceInFileRegex(
path.path, r'^(package (?:\.|\w)+)', "package ${newPackageName}");
String newPackagePath = newPackageName.replaceAll('.', '/');
String newPath = '${PATH_ACTIVITY}${type}/$newPackagePath';
print('Creating New Directory Structure');
await Directory(newPath).create(recursive: true);
await path.rename(newPath + '/MainActivity.$extension');
print('Deleting old directories');
await deleteEmptyDirs(type);
}