Skip to content

Commit

Permalink
unlink from unneeded classes + kill atx agent (#178)
Browse files Browse the repository at this point in the history
* unlink from unneeded classes + kill atx agent

- unlink from unneeded classes to fix the scroll in likers list view
- kill atx agent in the right place

* Update __init__.py

black __init__.py

* update the version of the hotfix

update the version of the hotfix to 1.2.4
  • Loading branch information
mastrolube authored Feb 26, 2021
1 parent e84fdee commit 76ab72a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
3 changes: 3 additions & 0 deletions GramAddict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
random_sleep,
save_crash,
update_available,
kill_atx_agent,
)
from GramAddict.core.views import (
AccountView,
Expand Down Expand Up @@ -190,6 +191,8 @@ def run():
device.screen_off()
logger.info("Screen turned off for sleeping time")

kill_atx_agent(device)

logger.info(
"-------- FINISH: " + str(session_state.finishTime) + " --------",
extra={"color": f"{Style.BRIGHT}{Fore.YELLOW}"},
Expand Down
5 changes: 4 additions & 1 deletion GramAddict/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ def close_instagram(device, screen_record):
).close()
if screen_record:
device.stop_screenrecord()
# close out atx-agent


def kill_atx_agent(device):
logger.info("Kill atx agent")
os.popen(
"adb"
+ ("" if configs.device_id is None else " -s " + configs.device_id)
Expand Down
10 changes: 2 additions & 8 deletions GramAddict/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,20 +873,14 @@ def likePost(self, click_btn_like=False):
return self._isPostLiked()

def _getListViewLikers(self):
return self.device.find(
resourceId=ResourceID.LIST, className=ClassName.LIST_VIEW
)
return self.device.find(resourceId=ResourceID.LIST)

def _getUserCountainer(self):
return self.device.find(
resourceId=ResourceID.ROW_USER_CONTAINER_BASE,
className=ClassName.LINEAR_LAYOUT,
)
return self.device.find(resourceId=ResourceID.ROW_USER_CONTAINER_BASE)

def _getUserName(self, countainer):
return countainer.child(
resourceId=ResourceID.ROW_USER_PRIMARY_NAME,
className=ClassName.TEXT_VIEW,
)

def _isFollowing(self, countainer):
Expand Down
2 changes: 1 addition & 1 deletion GramAddict/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.2.3"
__version__ = "1.2.4"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="gramaddict",
version="1.2.3",
version="1.2.4",
author="GramAddict Team",
author_email="[email protected]",
description="Completely free and open source human-like Instagram bot. Powered by UIAutomator2 and compatible with basically any android device that can run instagram - real or emulated.",
Expand Down

0 comments on commit 76ab72a

Please sign in to comment.