Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstring>
- using namespace std;
- class A
- {
- public:
- begin()
- {
- int j;
- cout << "Choose your option:\n\n";
- cout << "1. List Devices\n";
- cout << "2. Install APK\n";
- cout << "3. Reboot Options\n";
- cout << "4. Screenshot\n";
- cout << "5. Push file to SDCard\n";
- cout << "\n";
- cin >> j;
- cout << "\n";
- switch(j)
- {
- case 1: devices();
- break;
- case 2: install();
- break;
- case 3: reboot();
- break;
- case 4: screenshot();
- break;
- case 5: push();
- break;
- }
- }
- devices()
- {
- system("adb devices");
- }
- reboot()
- {
- int i;
- cout << "Reboot Options\n\n";
- cout << "1. Reboot System\n";
- cout << "2. Reboot into Recovery\n";
- cout << "3. Reboot into Bootloader\n\n";
- cin >> i;
- switch(i)
- {
- case 1: cout << "Rebooting System...";
- system("adb reboot");
- break;
- case 2: cout << "Rebooting into Recovery...";
- system("adb reboot recovery");
- break;
- case 3: cout << "Rebooting into Bootloader...";
- system("adb reboot bootloader");
- break;
- }
- }
- install()
- {
- char path[100], command[100];
- cout << "Drag and Drop an APK file here and press enter to install.\n";
- cin.sync();
- cin.get(path, 100);
- strcpy(command, "adb install ");
- strcat(command, path);
- cout << "Installing APK...";
- system(command);
- }
- screenshot()
- {
- system("adb shell screencap -p /sdcard/Screenshot.png");
- system("adb pull /sdcard/Screenshot.png \"%UserProfile%\\Desktop\\Screenshot.png\"");
- system("adb shell rm /sdcard/Screenshot.png");
- cout << "Screenshot saved to Desktop.";
- }
- push()
- {
- char path[100], command[200];
- cout << "Drag and Drop a file here and press enter to send it to the SD Card.\n";
- cin.sync();
- cin.get(path, 100);
- strcpy(command, "adb push ");
- strcat(command, path);
- strcat(command, " ");
- strcat(command, " /sdcard/");
- system(command);
- }
- };
- int main()
- {
- A a;
- a.begin();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement