pybridge-sdk-android 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pybridge_sdk_android-0.3.0/MANIFEST.in +2 -0
- pybridge_sdk_android-0.3.0/PKG-INFO +45 -0
- pybridge_sdk_android-0.3.0/README.md +35 -0
- pybridge_sdk_android-0.3.0/pybridge/__init__.py +9 -0
- pybridge_sdk_android-0.3.0/pybridge/android/__init__.py +1 -0
- pybridge_sdk_android-0.3.0/pybridge/android/context.py +4 -0
- pybridge_sdk_android-0.3.0/pybridge/android/intents.py +9 -0
- pybridge_sdk_android-0.3.0/pybridge/android/permissions.py +7 -0
- pybridge_sdk_android-0.3.0/pybridge/backend.py +13 -0
- pybridge_sdk_android-0.3.0/pybridge/backend_manager.py +69 -0
- pybridge_sdk_android-0.3.0/pybridge/bridge.py +43 -0
- pybridge_sdk_android-0.3.0/pybridge/capabilities.py +29 -0
- pybridge_sdk_android-0.3.0/pybridge/config.py +8 -0
- pybridge_sdk_android-0.3.0/pybridge/device/__init__.py +0 -0
- pybridge_sdk_android-0.3.0/pybridge/device/battery.py +25 -0
- pybridge_sdk_android-0.3.0/pybridge/device/info.py +31 -0
- pybridge_sdk_android-0.3.0/pybridge/exceptions.py +6 -0
- pybridge_sdk_android-0.3.0/pybridge/hardware/__init__.py +1 -0
- pybridge_sdk_android-0.3.0/pybridge/hardware/bluetooth.py +4 -0
- pybridge_sdk_android-0.3.0/pybridge/hardware/camera.py +4 -0
- pybridge_sdk_android-0.3.0/pybridge/hardware/location.py +4 -0
- pybridge_sdk_android-0.3.0/pybridge/hardware/sensors.py +4 -0
- pybridge_sdk_android-0.3.0/pybridge/intents.py +9 -0
- pybridge_sdk_android-0.3.0/pybridge/logger.py +8 -0
- pybridge_sdk_android-0.3.0/pybridge/permissions.py +9 -0
- pybridge_sdk_android-0.3.0/pybridge/shell.py +59 -0
- pybridge_sdk_android-0.3.0/pybridge/shizuku/__init__.py +1 -0
- pybridge_sdk_android-0.3.0/pybridge/shizuku/client.py +13 -0
- pybridge_sdk_android-0.3.0/pybridge/shizuku/executor.py +4 -0
- pybridge_sdk_android-0.3.0/pybridge/system/__init__.py +1 -0
- pybridge_sdk_android-0.3.0/pybridge/system/apps.py +11 -0
- pybridge_sdk_android-0.3.0/pybridge/system/clipboard.py +7 -0
- pybridge_sdk_android-0.3.0/pybridge/system/notifications.py +4 -0
- pybridge_sdk_android-0.3.0/pybridge/system/packages.py +14 -0
- pybridge_sdk_android-0.3.0/pybridge/system/power.py +7 -0
- pybridge_sdk_android-0.3.0/pybridge/system/settings.py +9 -0
- pybridge_sdk_android-0.3.0/pybridge/version.py +2 -0
- pybridge_sdk_android-0.3.0/pybridge_sdk_android.egg-info/PKG-INFO +45 -0
- pybridge_sdk_android-0.3.0/pybridge_sdk_android.egg-info/SOURCES.txt +44 -0
- pybridge_sdk_android-0.3.0/pybridge_sdk_android.egg-info/dependency_links.txt +1 -0
- pybridge_sdk_android-0.3.0/pybridge_sdk_android.egg-info/top_level.txt +1 -0
- pybridge_sdk_android-0.3.0/pyproject.toml +16 -0
- pybridge_sdk_android-0.3.0/setup.cfg +4 -0
- pybridge_sdk_android-0.3.0/setup.py +13 -0
- pybridge_sdk_android-0.3.0/tests/test_030.py +7 -0
- pybridge_sdk_android-0.3.0/tests/test_040.py +9 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pybridge-sdk-android
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A modular Android functionality bridge for Python
|
|
5
|
+
Author: thewhistledev
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Dynamic: requires-python
|
|
10
|
+
|
|
11
|
+
# PyBridge
|
|
12
|
+
|
|
13
|
+
Android functionality bridge for Python.
|
|
14
|
+
|
|
15
|
+
Version: 0.4.0
|
|
16
|
+
|
|
17
|
+
Author: thewhistledev
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- Backend system
|
|
22
|
+
- Root support
|
|
23
|
+
- Shizuku foundation
|
|
24
|
+
- Android intents
|
|
25
|
+
- App management
|
|
26
|
+
- Clipboard foundation
|
|
27
|
+
- Notifications foundation
|
|
28
|
+
- Hardware API foundation
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
from pybridge import bridge
|
|
33
|
+
|
|
34
|
+
bridge.intents.open_url('https://github.com')
|
|
35
|
+
|
|
36
|
+
## Roadmap
|
|
37
|
+
|
|
38
|
+
0.5.0:
|
|
39
|
+
- Real Android API bridge
|
|
40
|
+
- Camera support
|
|
41
|
+
- Bluetooth support
|
|
42
|
+
- Sensors
|
|
43
|
+
|
|
44
|
+
1.0.0:
|
|
45
|
+
Complete Android Python framework.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# PyBridge
|
|
2
|
+
|
|
3
|
+
Android functionality bridge for Python.
|
|
4
|
+
|
|
5
|
+
Version: 0.4.0
|
|
6
|
+
|
|
7
|
+
Author: thewhistledev
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Backend system
|
|
12
|
+
- Root support
|
|
13
|
+
- Shizuku foundation
|
|
14
|
+
- Android intents
|
|
15
|
+
- App management
|
|
16
|
+
- Clipboard foundation
|
|
17
|
+
- Notifications foundation
|
|
18
|
+
- Hardware API foundation
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
from pybridge import bridge
|
|
23
|
+
|
|
24
|
+
bridge.intents.open_url('https://github.com')
|
|
25
|
+
|
|
26
|
+
## Roadmap
|
|
27
|
+
|
|
28
|
+
0.5.0:
|
|
29
|
+
- Real Android API bridge
|
|
30
|
+
- Camera support
|
|
31
|
+
- Bluetooth support
|
|
32
|
+
- Sensors
|
|
33
|
+
|
|
34
|
+
1.0.0:
|
|
35
|
+
Complete Android Python framework.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Android API modules
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
from .backend import Backend
|
|
5
|
+
|
|
6
|
+
from .capabilities import Capabilities
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BackendManager:
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def __init__(self):
|
|
14
|
+
|
|
15
|
+
self.capabilities = Capabilities()
|
|
16
|
+
|
|
17
|
+
self.backend = self.detect()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def detect(self):
|
|
22
|
+
|
|
23
|
+
if self.root():
|
|
24
|
+
|
|
25
|
+
self.capabilities.root = True
|
|
26
|
+
|
|
27
|
+
return Backend.ROOT
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if self.shizuku():
|
|
32
|
+
|
|
33
|
+
self.capabilities.shizuku = True
|
|
34
|
+
|
|
35
|
+
return Backend.SHIZUKU
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
return Backend.SHELL
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def root(self):
|
|
44
|
+
|
|
45
|
+
return os.system(
|
|
46
|
+
"su -c id >/dev/null 2>&1"
|
|
47
|
+
) == 0
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def shizuku(self):
|
|
52
|
+
|
|
53
|
+
return os.system(
|
|
54
|
+
"which rish >/dev/null 2>&1"
|
|
55
|
+
) == 0
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def info(self):
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
"backend":
|
|
64
|
+
self.backend.value,
|
|
65
|
+
|
|
66
|
+
"capabilities":
|
|
67
|
+
self.capabilities.as_dict()
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from .backend_manager import BackendManager
|
|
2
|
+
from .device.info import Device
|
|
3
|
+
from .device.battery import Battery
|
|
4
|
+
|
|
5
|
+
from .android.intents import Intents
|
|
6
|
+
from .android.permissions import Permissions
|
|
7
|
+
|
|
8
|
+
from .system.apps import Apps
|
|
9
|
+
from .system.clipboard import Clipboard
|
|
10
|
+
from .system.notifications import Notifications
|
|
11
|
+
from .system.settings import Settings
|
|
12
|
+
|
|
13
|
+
from .hardware.camera import Camera
|
|
14
|
+
from .hardware.bluetooth import Bluetooth
|
|
15
|
+
from .hardware.sensors import Sensors
|
|
16
|
+
from .hardware.location import Location
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Bridge:
|
|
20
|
+
|
|
21
|
+
def __init__(self):
|
|
22
|
+
|
|
23
|
+
self.backend = BackendManager()
|
|
24
|
+
|
|
25
|
+
self.device = Device()
|
|
26
|
+
self.battery = Battery()
|
|
27
|
+
|
|
28
|
+
self.intents = Intents()
|
|
29
|
+
self.permissions = Permissions()
|
|
30
|
+
|
|
31
|
+
self.apps = Apps()
|
|
32
|
+
self.clipboard = Clipboard()
|
|
33
|
+
self.notifications = Notifications()
|
|
34
|
+
self.settings = Settings()
|
|
35
|
+
|
|
36
|
+
self.camera = Camera()
|
|
37
|
+
self.bluetooth = Bluetooth()
|
|
38
|
+
self.sensors = Sensors()
|
|
39
|
+
self.location = Location()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def info(self):
|
|
43
|
+
return self.backend.info()
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
class Capabilities:
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def __init__(self):
|
|
6
|
+
|
|
7
|
+
self.root = False
|
|
8
|
+
|
|
9
|
+
self.shizuku = False
|
|
10
|
+
|
|
11
|
+
self.android = False
|
|
12
|
+
|
|
13
|
+
self.shell = True
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def as_dict(self):
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
|
|
21
|
+
"root": self.root,
|
|
22
|
+
|
|
23
|
+
"shizuku": self.shizuku,
|
|
24
|
+
|
|
25
|
+
"android": self.android,
|
|
26
|
+
|
|
27
|
+
"shell": self.shell
|
|
28
|
+
|
|
29
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
from pybridge.shell import Shell
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Battery:
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@property
|
|
10
|
+
def level(self):
|
|
11
|
+
|
|
12
|
+
result = Shell.exec(
|
|
13
|
+
"dumpsys battery | grep level"
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
try:
|
|
18
|
+
|
|
19
|
+
return int(
|
|
20
|
+
result.stdout.split(":")[1]
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
except:
|
|
24
|
+
|
|
25
|
+
return None
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
from pybridge.shell import Shell
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Device:
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def prop(self, key):
|
|
10
|
+
|
|
11
|
+
return Shell.exec(
|
|
12
|
+
f"getprop {key}"
|
|
13
|
+
).stdout
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def model(self):
|
|
19
|
+
|
|
20
|
+
return self.prop(
|
|
21
|
+
"ro.product.model"
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def android(self):
|
|
28
|
+
|
|
29
|
+
return self.prop(
|
|
30
|
+
"ro.build.version.release"
|
|
31
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Hardware modules
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
import subprocess
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ShellResult:
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
code,
|
|
12
|
+
stdout,
|
|
13
|
+
stderr
|
|
14
|
+
):
|
|
15
|
+
|
|
16
|
+
self.code = code
|
|
17
|
+
|
|
18
|
+
self.stdout = stdout
|
|
19
|
+
|
|
20
|
+
self.stderr = stderr
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def success(self):
|
|
26
|
+
|
|
27
|
+
return self.code == 0
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class Shell:
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@staticmethod
|
|
36
|
+
def exec(command):
|
|
37
|
+
|
|
38
|
+
result = subprocess.run(
|
|
39
|
+
|
|
40
|
+
command,
|
|
41
|
+
|
|
42
|
+
shell=True,
|
|
43
|
+
|
|
44
|
+
capture_output=True,
|
|
45
|
+
|
|
46
|
+
text=True
|
|
47
|
+
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
return ShellResult(
|
|
52
|
+
|
|
53
|
+
result.returncode,
|
|
54
|
+
|
|
55
|
+
result.stdout.strip(),
|
|
56
|
+
|
|
57
|
+
result.stderr.strip()
|
|
58
|
+
|
|
59
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Shizuku backend
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# System modules
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pybridge-sdk-android
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A modular Android functionality bridge for Python
|
|
5
|
+
Author: thewhistledev
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Dynamic: requires-python
|
|
10
|
+
|
|
11
|
+
# PyBridge
|
|
12
|
+
|
|
13
|
+
Android functionality bridge for Python.
|
|
14
|
+
|
|
15
|
+
Version: 0.4.0
|
|
16
|
+
|
|
17
|
+
Author: thewhistledev
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- Backend system
|
|
22
|
+
- Root support
|
|
23
|
+
- Shizuku foundation
|
|
24
|
+
- Android intents
|
|
25
|
+
- App management
|
|
26
|
+
- Clipboard foundation
|
|
27
|
+
- Notifications foundation
|
|
28
|
+
- Hardware API foundation
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
from pybridge import bridge
|
|
33
|
+
|
|
34
|
+
bridge.intents.open_url('https://github.com')
|
|
35
|
+
|
|
36
|
+
## Roadmap
|
|
37
|
+
|
|
38
|
+
0.5.0:
|
|
39
|
+
- Real Android API bridge
|
|
40
|
+
- Camera support
|
|
41
|
+
- Bluetooth support
|
|
42
|
+
- Sensors
|
|
43
|
+
|
|
44
|
+
1.0.0:
|
|
45
|
+
Complete Android Python framework.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
MANIFEST.in
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
setup.py
|
|
5
|
+
pybridge/__init__.py
|
|
6
|
+
pybridge/backend.py
|
|
7
|
+
pybridge/backend_manager.py
|
|
8
|
+
pybridge/bridge.py
|
|
9
|
+
pybridge/capabilities.py
|
|
10
|
+
pybridge/config.py
|
|
11
|
+
pybridge/exceptions.py
|
|
12
|
+
pybridge/intents.py
|
|
13
|
+
pybridge/logger.py
|
|
14
|
+
pybridge/permissions.py
|
|
15
|
+
pybridge/shell.py
|
|
16
|
+
pybridge/version.py
|
|
17
|
+
pybridge/android/__init__.py
|
|
18
|
+
pybridge/android/context.py
|
|
19
|
+
pybridge/android/intents.py
|
|
20
|
+
pybridge/android/permissions.py
|
|
21
|
+
pybridge/device/__init__.py
|
|
22
|
+
pybridge/device/battery.py
|
|
23
|
+
pybridge/device/info.py
|
|
24
|
+
pybridge/hardware/__init__.py
|
|
25
|
+
pybridge/hardware/bluetooth.py
|
|
26
|
+
pybridge/hardware/camera.py
|
|
27
|
+
pybridge/hardware/location.py
|
|
28
|
+
pybridge/hardware/sensors.py
|
|
29
|
+
pybridge/shizuku/__init__.py
|
|
30
|
+
pybridge/shizuku/client.py
|
|
31
|
+
pybridge/shizuku/executor.py
|
|
32
|
+
pybridge/system/__init__.py
|
|
33
|
+
pybridge/system/apps.py
|
|
34
|
+
pybridge/system/clipboard.py
|
|
35
|
+
pybridge/system/notifications.py
|
|
36
|
+
pybridge/system/packages.py
|
|
37
|
+
pybridge/system/power.py
|
|
38
|
+
pybridge/system/settings.py
|
|
39
|
+
pybridge_sdk_android.egg-info/PKG-INFO
|
|
40
|
+
pybridge_sdk_android.egg-info/SOURCES.txt
|
|
41
|
+
pybridge_sdk_android.egg-info/dependency_links.txt
|
|
42
|
+
pybridge_sdk_android.egg-info/top_level.txt
|
|
43
|
+
tests/test_030.py
|
|
44
|
+
tests/test_040.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pybridge
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ['setuptools>=61', 'wheel']
|
|
3
|
+
build-backend = 'setuptools.build_meta'
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = 'pybridge-sdk-android'
|
|
7
|
+
version = '0.3.0'
|
|
8
|
+
description = 'A modular Android functionality bridge for Python'
|
|
9
|
+
readme = 'README.md'
|
|
10
|
+
requires-python = '>=3.8'
|
|
11
|
+
|
|
12
|
+
authors = [
|
|
13
|
+
{name='thewhistledev'}
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
license = {text='MIT'}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name='pybridge-sdk-android',
|
|
5
|
+
version='0.3.0',
|
|
6
|
+
author='thewhistledev',
|
|
7
|
+
description='A modular Android functionality bridge for Python',
|
|
8
|
+
long_description=open('README.md', encoding='utf-8').read(),
|
|
9
|
+
long_description_content_type='text/markdown',
|
|
10
|
+
packages=find_packages(),
|
|
11
|
+
python_requires='>=3.8',
|
|
12
|
+
license='MIT',
|
|
13
|
+
)
|