Loading tools/bit/aapt.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -159,10 +159,11 @@ int inspect_apk(Apk* apk, const string& filename) { // Load the manifest xml Command cmd("aapt"); Command cmd("aapt2"); cmd.AddArg("dump"); cmd.AddArg("xmltree"); cmd.AddArg(filename); cmd.AddArg("--file"); cmd.AddArg("AndroidManifest.xml"); int err; Loading Loading @@ -217,11 +218,11 @@ inspect_apk(Apk* apk, const string& filename) if (current != NULL) { Attribute attr; string str = match[2]; size_t colon = str.find(':'); size_t colon = str.rfind(':'); if (colon == string::npos) { attr.name = str; } else { attr.ns = scope->namespaces[string(str, 0, colon)]; attr.ns.assign(str, 0, colon); attr.name.assign(str, colon+1, string::npos); } attr.value = match[3]; Loading tools/bit/main.cpp +17 −1 Original line number Diff line number Diff line Loading @@ -662,6 +662,7 @@ run_phases(vector<Target*> targets, const Options& options) string dataPath = buildOut + "/target/product/" + buildDevice + "/data/"; bool syncSystem = false; bool alwaysSyncSystem = false; vector<string> systemFiles; vector<InstallApk> installApks; for (size_t i=0; i<targets.size(); i++) { Target* target = targets[i]; Loading @@ -671,6 +672,7 @@ run_phases(vector<Target*> targets, const Options& options) // System partition if (starts_with(file, systemPath)) { syncSystem = true; systemFiles.push_back(file); if (!target->build) { // If a system partition target didn't get built then // it won't change we will always need to do adb sync Loading @@ -693,6 +695,19 @@ run_phases(vector<Target*> targets, const Options& options) get_directory_contents(systemPath, &systemFilesBefore); } if (systemFiles.size() > 0){ print_info("System files:"); for (size_t i=0; i<systemFiles.size(); i++) { printf(" %s\n", systemFiles[i].c_str()); } } if (installApks.size() > 0){ print_info("APKs to install:"); for (size_t i=0; i<installApks.size(); i++) { printf(" %s\n", installApks[i].file.filename.c_str()); } } // // Build // Loading Loading @@ -799,7 +814,8 @@ run_phases(vector<Target*> targets, const Options& options) for (size_t j=0; j<target->module.installed.size(); j++) { string filename = target->module.installed[j]; if (!ends_with(filename, ".apk")) { // Apk in the data partition if (!starts_with(filename, dataPath) || !ends_with(filename, ".apk")) { continue; } Loading tools/bit/print.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,20 @@ print_warning(const char* format, ...) fputc('\n', stderr); } void print_info(const char* format, ...) { fputs(g_escapeBold, stdout); va_list args; va_start(args, format); vfprintf(stdout, format, args); va_end(args); fputs(g_escapeEndColor, stdout); fputc('\n', stdout); } void print_one_line(const char* format, ...) { Loading tools/bit/print.h +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ void print_status(const char* format, ...); void print_command(const Command& command); void print_error(const char* format, ...); void print_warning(const char* format, ...); void print_info(const char* format, ...); void print_one_line(const char* format, ...); void check_error(int err); Loading Loading
tools/bit/aapt.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -159,10 +159,11 @@ int inspect_apk(Apk* apk, const string& filename) { // Load the manifest xml Command cmd("aapt"); Command cmd("aapt2"); cmd.AddArg("dump"); cmd.AddArg("xmltree"); cmd.AddArg(filename); cmd.AddArg("--file"); cmd.AddArg("AndroidManifest.xml"); int err; Loading Loading @@ -217,11 +218,11 @@ inspect_apk(Apk* apk, const string& filename) if (current != NULL) { Attribute attr; string str = match[2]; size_t colon = str.find(':'); size_t colon = str.rfind(':'); if (colon == string::npos) { attr.name = str; } else { attr.ns = scope->namespaces[string(str, 0, colon)]; attr.ns.assign(str, 0, colon); attr.name.assign(str, colon+1, string::npos); } attr.value = match[3]; Loading
tools/bit/main.cpp +17 −1 Original line number Diff line number Diff line Loading @@ -662,6 +662,7 @@ run_phases(vector<Target*> targets, const Options& options) string dataPath = buildOut + "/target/product/" + buildDevice + "/data/"; bool syncSystem = false; bool alwaysSyncSystem = false; vector<string> systemFiles; vector<InstallApk> installApks; for (size_t i=0; i<targets.size(); i++) { Target* target = targets[i]; Loading @@ -671,6 +672,7 @@ run_phases(vector<Target*> targets, const Options& options) // System partition if (starts_with(file, systemPath)) { syncSystem = true; systemFiles.push_back(file); if (!target->build) { // If a system partition target didn't get built then // it won't change we will always need to do adb sync Loading @@ -693,6 +695,19 @@ run_phases(vector<Target*> targets, const Options& options) get_directory_contents(systemPath, &systemFilesBefore); } if (systemFiles.size() > 0){ print_info("System files:"); for (size_t i=0; i<systemFiles.size(); i++) { printf(" %s\n", systemFiles[i].c_str()); } } if (installApks.size() > 0){ print_info("APKs to install:"); for (size_t i=0; i<installApks.size(); i++) { printf(" %s\n", installApks[i].file.filename.c_str()); } } // // Build // Loading Loading @@ -799,7 +814,8 @@ run_phases(vector<Target*> targets, const Options& options) for (size_t j=0; j<target->module.installed.size(); j++) { string filename = target->module.installed[j]; if (!ends_with(filename, ".apk")) { // Apk in the data partition if (!starts_with(filename, dataPath) || !ends_with(filename, ".apk")) { continue; } Loading
tools/bit/print.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,20 @@ print_warning(const char* format, ...) fputc('\n', stderr); } void print_info(const char* format, ...) { fputs(g_escapeBold, stdout); va_list args; va_start(args, format); vfprintf(stdout, format, args); va_end(args); fputs(g_escapeEndColor, stdout); fputc('\n', stdout); } void print_one_line(const char* format, ...) { Loading
tools/bit/print.h +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ void print_status(const char* format, ...); void print_command(const Command& command); void print_error(const char* format, ...); void print_warning(const char* format, ...); void print_info(const char* format, ...); void print_one_line(const char* format, ...); void check_error(int err); Loading