Advertisement
Guest User

Untitled

a guest
Sep 20th, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.57 KB | None | 0 0
  1. // ADBSS.cpp : Ten plik zawiera funkcję „main”. W nim rozpoczyna się i kończy wykonywanie programu.
  2. //
  3.  
  4. #include <pch.h>
  5. #include <iostream>
  6. #include <string>
  7. #include <windows.h>
  8. #include <tchar.h>
  9.  
  10. using namespace std;
  11.  
  12. int main(int argc, char** argv) {
  13.     std::string filename;
  14.     filename = "a";
  15.     SetConsoleTitle(_T("*-_ ADB Screenshooter _-*"));
  16.     std::cout << "+---------------------------------+" << endl;
  17.     std::cout << "|ADB Screenshooter   [v1.0]       |" << endl;
  18.     std::cout << "|Take screenshots from your device|" << endl;
  19.     std::cout << "|with a simple CLI tool.          |" << endl;
  20.     std::cout << "+---------------------------------+" << endl;
  21.     cout << "Welcome to ADB Screenshooter." << endl;
  22.     cout << "Please input the filename: (The screenshot will be saved with that name)" << endl;
  23.     cout << "DO NOT INCLUDE ANY SPACES IN THE FILENAME. Use only letters." << endl;
  24.     cin >> filename;
  25.     Sleep(4);
  26.     system("cls");
  27.     SetConsoleTitle(_T("*-_ Taking the screenshot _-*"));
  28.     cout << "Trust your computer now if you haven't before." << endl;
  29.     system("adb shell screencap -p /sdcard/ADBScreenshooter/" + filename.c_str() + ".png");
  30.     Sleep(4);
  31.     system("cls");
  32.     SetConsoleTitle(_T("*-_ Copying to PC! _-*"));
  33.     cout << "The file will now be copied to the location from where you run ADB Screenshooter." << endl;
  34.     system("adb pull /sdcard/" + filename.c_str() + ".png");
  35.     Sleep(4);
  36.     system("cls");
  37.     SetConsoleTitle(_T("*-_ Done! _-*"));
  38.     cout << "Everything is done! Thanks for using ADBSS. Press any key to finish." << endl;
  39.     system("pause>nul");
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement