This repository has been archived by the owner on Jan 27, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Mishchenko
committed
Sep 14, 2021
1 parent
1d5f0e8
commit bee516d
Showing
24 changed files
with
427 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from insomniac import activation_controller | ||
|
||
exec(activation_controller.get_extra_feature('action_manage_clones')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from insomniac import activation_controller | ||
|
||
exec(activation_controller.get_extra_feature('management_actions_types')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from insomniac import activation_controller | ||
|
||
exec(activation_controller.get_extra_feature('report')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from insomniac import activation_controller | ||
|
||
exec(activation_controller.get_extra_feature('session_state')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from insomniac import activation_controller | ||
|
||
exec(activation_controller.get_extra_feature('storage')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from insomniac.utils import * | ||
|
||
|
||
class HardBanError(Exception): | ||
pass | ||
|
||
|
||
class HardBanIndicator: | ||
|
||
WEBVIEW_ACTIVITY_NAME = 'com.instagram.simplewebview.SimpleWebViewActivity' | ||
|
||
def detect_webview(self, device): | ||
""" | ||
While "hard banned" Instagram shows you a webview with CAPTCHA and request to confirm your account. So what we | ||
need is to simply detect that topmost activity is a webview. | ||
""" | ||
device_id = device.device_id | ||
app_id = device.app_id | ||
resumed_activity_output = execute_command("adb" + ("" if device_id is None else " -s " + device_id) + | ||
f" shell dumpsys activity | grep 'mResumedActivity'") | ||
|
||
max_attempts = 3 | ||
attempt = 1 | ||
while attempt <= max_attempts: | ||
sleep(1) | ||
full_webview_activity_name = f"{app_id}/{self.WEBVIEW_ACTIVITY_NAME}" | ||
if resumed_activity_output is not None and full_webview_activity_name in resumed_activity_output: | ||
print(COLOR_FAIL + "WebView is shown. Counting that as a hard-ban indicator!" + COLOR_ENDC) | ||
self.indicate_ban() | ||
return | ||
attempt += 1 | ||
|
||
def indicate_ban(self): | ||
raise HardBanError("Hard ban indicated!") | ||
|
||
|
||
hardban_indicator = HardBanIndicator() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.