PyMobileProvision


NamePyMobileProvision JSON
Version 1.4.5 PyPI version JSON
download
home_pagehttps://github.com/shede333/PyMobileProvision
SummaryPython3, parse ".mobileprovision" file in MacOS System;
upload_time2023-06-25 06:14:50
maintainer
docs_urlNone
authorshede333
requires_python~=3.6
license
keywords mobileprovision mobile provision mobileprovision profile profiles
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyMobileProvision


parse ".mobileprovision" file in MacOS System;      
解析 MacOS 系统里,iOS和Mac开发常用到的".mobileprovision"文件,提取出里面的"plist"格式的内容

仅支持 **Python3**,Python2版本见:[Py2MobileProvision](https://github.com/shede333/Py2MobileProvision)


## Install

```

# 注意:pip要用最新的(version>=21.0),否则,在安装cryptography依赖包时会失败
pip install PyMobileProvision

```

## Example Modules:

```python

from mobileprovision import MobileProvisionModel

mp_file_path = "/Users/shede333/Desktop/test.mobileprovision"
mp_model = MobileProvisionModel(mp_file_path)

# 也支持直接使用mobileprovision文件内容来创建model,AppStore Connect API一般会需要这种情况:
# from pathlib import Path
# file_content = Path(mp_file_path).read_text(encoding="ascii", errors="ignore")
# mp_model = MobileProvisionModel(file_content)

print(mp_model)  # 打印mobileprovision文件的详细信息
print(mp_model.app_id_prefix)  # appID的前缀
print(mp_model.app_id(is_need_prefix=True))  # app的BundleID,带app_id_prefix前缀
print(mp_model["name"])  # mobileprovision的"Name"属性(属性不区分大小写)
print(mp_model.date_is_valid())  # 现在的是否过期
print(mp_model.creation_timestamp)  # 证书创建时间(时间戳,int值)
# ......还有很多其他属性.......

# 将int时间戳 转换为 本地日期时间
from datetime import datetime
local_dt = datetime.fromtimestamp(mp_model.creation_timestamp)
print(local_dt)  

# 打印mobileprovision文件里包含的cer公钥证书信息
print(mp_model.developer_certificates)

# mobileprovision文件是否包含(支持)device_id设备
device_id = "00008020-000XXXXXXXXXXXXXX"  # 设备的唯一ID
print(mp_model.contain_device_id(device_id))  

# 转换为plist格式文件
dst_plist_path = "/Users/shede333/Desktop/test.plist"
mp_model.convert_to_plist_file(dst_plist_path)

# 导出entitlements.plist文件信息
ent_dst_path = "Users/shede333/Desktop/entitlements.plist"
mp_model.export_entitlements_file(ent_dst_path)

```

## Example CLI:

```shell

mobileprovision -h 

输出:

usage: OKEx工程里的多语言国际化相关的便捷操作 [-h] {import,parse,convert,entitlements} ...

positional arguments:
  {import,parse,convert,entitlements}
                        支持的命令如下:
    import              导入mobileprovision文件到系统默认路径里
    parse               解析、打印mobileprovision文件里的内容
    convert             转换mobileprovision文件为plist文件
    entitlements        打印/导出 mobileprovision文件里 entitlements信息

optional arguments:
  -h, --help            show this help message and exit


```


## 公司招聘:

欧科云链招募新同学:  
可分布式`居家办公`,行业龙头,高薪资,年终奖优越,拒绝加班,**1075工作制**,公司提供团建费每人每周200元,还提供各种福利;  
各地同学均可在家办公(**拿北京薪资+社保,在老家工作+生活**),也可在北京公司内(海淀上地)办公;  
支持远程 **线上面试**;  
**web前端、后端、移动端**均在招人,欢迎加入团队~  
**简历**可发送至:<wshw333@gmail.com>  
微信搜索“shede333sw”咨询岗位详情;  

移动端招聘详情如下:  

iOS工程师任职要求:  
1.本科以上学历,可使用英文交流者加分;  
2.三年以上的iOS平台研发经验,良好的代码编写规范。有已上线App开发经验加分,有跨平台开发经验加分;  
3.精通Object-C/Swift语言,熟悉账户Xcode等开发佛能根据,熟练掌握使用iOS SDK,熟悉Go、Python、Ruby语言加分;  
4.有高性能客户端编程经验,有性能调优经历加分;  
5.熟悉iOS主流开源框架,并学习、研究过实现原理和源码;  

Android工程师任职要求:  
1.本科以上学历,可使用英文交流者加分;  
2.三年以上Android开发经验;  
3.熟悉Android常用控件的使用并理解其原理;  
4.熟悉Android Framework原理,阅读过Android源代码者优先;  
5.对java、Kotlin、基本数据结构、计算机网络有较为深入的了解;  

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/shede333/PyMobileProvision",
    "name": "PyMobileProvision",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "~=3.6",
    "maintainer_email": "",
    "keywords": "mobileprovision mobile provision MobileProvision profile profiles",
    "author": "shede333",
    "author_email": "333wshw@163.com",
    "download_url": "https://files.pythonhosted.org/packages/bd/27/d47095f81d77b91f4338b136e5b029361a585d568f3743a6337ea8ac0331/PyMobileProvision-1.4.5.tar.gz",
    "platform": null,
    "description": "# PyMobileProvision\n\n\nparse \".mobileprovision\" file in MacOS System;      \n\u89e3\u6790 MacOS \u7cfb\u7edf\u91cc\uff0ciOS\u548cMac\u5f00\u53d1\u5e38\u7528\u5230\u7684\".mobileprovision\"\u6587\u4ef6\uff0c\u63d0\u53d6\u51fa\u91cc\u9762\u7684\"plist\"\u683c\u5f0f\u7684\u5185\u5bb9\n\n\u4ec5\u652f\u6301 **Python3**\uff0cPython2\u7248\u672c\u89c1\uff1a[Py2MobileProvision](https://github.com/shede333/Py2MobileProvision)\n\n\n## Install\n\n```\n\n# \u6ce8\u610f\uff1apip\u8981\u7528\u6700\u65b0\u7684\uff08version>=21.0\uff09\uff0c\u5426\u5219\uff0c\u5728\u5b89\u88c5cryptography\u4f9d\u8d56\u5305\u65f6\u4f1a\u5931\u8d25\npip install PyMobileProvision\n\n```\n\n## Example Modules:\n\n```python\n\nfrom mobileprovision import MobileProvisionModel\n\nmp_file_path = \"/Users/shede333/Desktop/test.mobileprovision\"\nmp_model = MobileProvisionModel(mp_file_path)\n\n# \u4e5f\u652f\u6301\u76f4\u63a5\u4f7f\u7528mobileprovision\u6587\u4ef6\u5185\u5bb9\u6765\u521b\u5efamodel\uff0cAppStore Connect API\u4e00\u822c\u4f1a\u9700\u8981\u8fd9\u79cd\u60c5\u51b5\uff1a\n# from pathlib import Path\n# file_content = Path(mp_file_path).read_text(encoding=\"ascii\", errors=\"ignore\")\n# mp_model = MobileProvisionModel(file_content)\n\nprint(mp_model)  # \u6253\u5370mobileprovision\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\nprint(mp_model.app_id_prefix)  # appID\u7684\u524d\u7f00\nprint(mp_model.app_id(is_need_prefix=True))  # app\u7684BundleID\uff0c\u5e26app_id_prefix\u524d\u7f00\nprint(mp_model[\"name\"])  # mobileprovision\u7684\"Name\"\u5c5e\u6027\uff08\u5c5e\u6027\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff09\nprint(mp_model.date_is_valid())  # \u73b0\u5728\u7684\u662f\u5426\u8fc7\u671f\nprint(mp_model.creation_timestamp)  # \u8bc1\u4e66\u521b\u5efa\u65f6\u95f4\uff08\u65f6\u95f4\u6233\uff0cint\u503c\uff09\n# ......\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u5c5e\u6027.......\n\n# \u5c06int\u65f6\u95f4\u6233 \u8f6c\u6362\u4e3a \u672c\u5730\u65e5\u671f\u65f6\u95f4\nfrom datetime import datetime\nlocal_dt = datetime.fromtimestamp(mp_model.creation_timestamp)\nprint(local_dt)  \n\n# \u6253\u5370mobileprovision\u6587\u4ef6\u91cc\u5305\u542b\u7684cer\u516c\u94a5\u8bc1\u4e66\u4fe1\u606f\nprint(mp_model.developer_certificates)\n\n# mobileprovision\u6587\u4ef6\u662f\u5426\u5305\u542b\uff08\u652f\u6301\uff09device_id\u8bbe\u5907\ndevice_id = \"00008020-000XXXXXXXXXXXXXX\"  # \u8bbe\u5907\u7684\u552f\u4e00ID\nprint(mp_model.contain_device_id(device_id))  \n\n# \u8f6c\u6362\u4e3aplist\u683c\u5f0f\u6587\u4ef6\ndst_plist_path = \"/Users/shede333/Desktop/test.plist\"\nmp_model.convert_to_plist_file(dst_plist_path)\n\n# \u5bfc\u51faentitlements.plist\u6587\u4ef6\u4fe1\u606f\nent_dst_path = \"Users/shede333/Desktop/entitlements.plist\"\nmp_model.export_entitlements_file(ent_dst_path)\n\n```\n\n## Example CLI:\n\n```shell\n\nmobileprovision -h \n\n\u8f93\u51fa\uff1a\n\nusage: OKEx\u5de5\u7a0b\u91cc\u7684\u591a\u8bed\u8a00\u56fd\u9645\u5316\u76f8\u5173\u7684\u4fbf\u6377\u64cd\u4f5c [-h] {import,parse,convert,entitlements} ...\n\npositional arguments:\n  {import,parse,convert,entitlements}\n                        \u652f\u6301\u7684\u547d\u4ee4\u5982\u4e0b\uff1a\n    import              \u5bfc\u5165mobileprovision\u6587\u4ef6\u5230\u7cfb\u7edf\u9ed8\u8ba4\u8def\u5f84\u91cc\n    parse               \u89e3\u6790\u3001\u6253\u5370mobileprovision\u6587\u4ef6\u91cc\u7684\u5185\u5bb9\n    convert             \u8f6c\u6362mobileprovision\u6587\u4ef6\u4e3aplist\u6587\u4ef6\n    entitlements        \u6253\u5370/\u5bfc\u51fa mobileprovision\u6587\u4ef6\u91cc entitlements\u4fe1\u606f\n\noptional arguments:\n  -h, --help            show this help message and exit\n\n\n```\n\n\n## \u516c\u53f8\u62db\u8058\uff1a\n\n\u6b27\u79d1\u4e91\u94fe\u62db\u52df\u65b0\u540c\u5b66\uff1a  \n\u53ef\u5206\u5e03\u5f0f`\u5c45\u5bb6\u529e\u516c`\uff0c\u884c\u4e1a\u9f99\u5934\uff0c\u9ad8\u85aa\u8d44\uff0c\u5e74\u7ec8\u5956\u4f18\u8d8a\uff0c\u62d2\u7edd\u52a0\u73ed\uff0c**1075\u5de5\u4f5c\u5236**\uff0c\u516c\u53f8\u63d0\u4f9b\u56e2\u5efa\u8d39\u6bcf\u4eba\u6bcf\u5468200\u5143\uff0c\u8fd8\u63d0\u4f9b\u5404\u79cd\u798f\u5229\uff1b  \n\u5404\u5730\u540c\u5b66\u5747\u53ef\u5728\u5bb6\u529e\u516c\uff08**\u62ff\u5317\u4eac\u85aa\u8d44+\u793e\u4fdd\uff0c\u5728\u8001\u5bb6\u5de5\u4f5c+\u751f\u6d3b**\uff09\uff0c\u4e5f\u53ef\u5728\u5317\u4eac\u516c\u53f8\u5185\uff08\u6d77\u6dc0\u4e0a\u5730\uff09\u529e\u516c\uff1b  \n\u652f\u6301\u8fdc\u7a0b **\u7ebf\u4e0a\u9762\u8bd5**\uff1b  \n**web\u524d\u7aef\u3001\u540e\u7aef\u3001\u79fb\u52a8\u7aef**\u5747\u5728\u62db\u4eba\uff0c\u6b22\u8fce\u52a0\u5165\u56e2\u961f~  \n**\u7b80\u5386**\u53ef\u53d1\u9001\u81f3\uff1a<wshw333@gmail.com>  \n\u5fae\u4fe1\u641c\u7d22\u201cshede333sw\u201d\u54a8\u8be2\u5c97\u4f4d\u8be6\u60c5\uff1b  \n\n\u79fb\u52a8\u7aef\u62db\u8058\u8be6\u60c5\u5982\u4e0b\uff1a  \n\niOS\u5de5\u7a0b\u5e08\u4efb\u804c\u8981\u6c42\uff1a  \n1.\u672c\u79d1\u4ee5\u4e0a\u5b66\u5386\uff0c\u53ef\u4f7f\u7528\u82f1\u6587\u4ea4\u6d41\u8005\u52a0\u5206\uff1b  \n2.\u4e09\u5e74\u4ee5\u4e0a\u7684iOS\u5e73\u53f0\u7814\u53d1\u7ecf\u9a8c\uff0c\u826f\u597d\u7684\u4ee3\u7801\u7f16\u5199\u89c4\u8303\u3002\u6709\u5df2\u4e0a\u7ebfApp\u5f00\u53d1\u7ecf\u9a8c\u52a0\u5206\uff0c\u6709\u8de8\u5e73\u53f0\u5f00\u53d1\u7ecf\u9a8c\u52a0\u5206\uff1b  \n3.\u7cbe\u901aObject-C/Swift\u8bed\u8a00\uff0c\u719f\u6089\u8d26\u6237Xcode\u7b49\u5f00\u53d1\u4f5b\u80fd\u6839\u636e\uff0c\u719f\u7ec3\u638c\u63e1\u4f7f\u7528iOS SDK\uff0c\u719f\u6089Go\u3001Python\u3001Ruby\u8bed\u8a00\u52a0\u5206\uff1b  \n4.\u6709\u9ad8\u6027\u80fd\u5ba2\u6237\u7aef\u7f16\u7a0b\u7ecf\u9a8c\uff0c\u6709\u6027\u80fd\u8c03\u4f18\u7ecf\u5386\u52a0\u5206\uff1b  \n5.\u719f\u6089iOS\u4e3b\u6d41\u5f00\u6e90\u6846\u67b6\uff0c\u5e76\u5b66\u4e60\u3001\u7814\u7a76\u8fc7\u5b9e\u73b0\u539f\u7406\u548c\u6e90\u7801\uff1b  \n\nAndroid\u5de5\u7a0b\u5e08\u4efb\u804c\u8981\u6c42\uff1a  \n1.\u672c\u79d1\u4ee5\u4e0a\u5b66\u5386\uff0c\u53ef\u4f7f\u7528\u82f1\u6587\u4ea4\u6d41\u8005\u52a0\u5206\uff1b  \n2.\u4e09\u5e74\u4ee5\u4e0aAndroid\u5f00\u53d1\u7ecf\u9a8c\uff1b  \n3.\u719f\u6089Android\u5e38\u7528\u63a7\u4ef6\u7684\u4f7f\u7528\u5e76\u7406\u89e3\u5176\u539f\u7406\uff1b  \n4.\u719f\u6089Android Framework\u539f\u7406\uff0c\u9605\u8bfb\u8fc7Android\u6e90\u4ee3\u7801\u8005\u4f18\u5148\uff1b  \n5.\u5bf9java\u3001Kotlin\u3001\u57fa\u672c\u6570\u636e\u7ed3\u6784\u3001\u8ba1\u7b97\u673a\u7f51\u7edc\u6709\u8f83\u4e3a\u6df1\u5165\u7684\u4e86\u89e3\uff1b  \n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python3, parse \".mobileprovision\" file in MacOS System;",
    "version": "1.4.5",
    "project_urls": {
        "Homepage": "https://github.com/shede333/PyMobileProvision"
    },
    "split_keywords": [
        "mobileprovision",
        "mobile",
        "provision",
        "mobileprovision",
        "profile",
        "profiles"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c651d72dbd1eabdad7fb931e33424c73184229b4a039495ce630406e624c381",
                "md5": "e5b9b8a321ceb4b09dd88d0d7ea9412b",
                "sha256": "b02592903b3a0c3506f6cde156610b082121f1d563ee3b7cf0389c070f7c390f"
            },
            "downloads": -1,
            "filename": "PyMobileProvision-1.4.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e5b9b8a321ceb4b09dd88d0d7ea9412b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.6",
            "size": 10482,
            "upload_time": "2023-06-25T06:14:48",
            "upload_time_iso_8601": "2023-06-25T06:14:48.096045Z",
            "url": "https://files.pythonhosted.org/packages/1c/65/1d72dbd1eabdad7fb931e33424c73184229b4a039495ce630406e624c381/PyMobileProvision-1.4.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd27d47095f81d77b91f4338b136e5b029361a585d568f3743a6337ea8ac0331",
                "md5": "058bdffbc806b7e0f79e228a6fb4718b",
                "sha256": "6e465a241ae2189ec62497e9d7902247eb1b0dded348bed7b4afbfd0655f717a"
            },
            "downloads": -1,
            "filename": "PyMobileProvision-1.4.5.tar.gz",
            "has_sig": false,
            "md5_digest": "058bdffbc806b7e0f79e228a6fb4718b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.6",
            "size": 9150,
            "upload_time": "2023-06-25T06:14:50",
            "upload_time_iso_8601": "2023-06-25T06:14:50.378026Z",
            "url": "https://files.pythonhosted.org/packages/bd/27/d47095f81d77b91f4338b136e5b029361a585d568f3743a6337ea8ac0331/PyMobileProvision-1.4.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-25 06:14:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shede333",
    "github_project": "PyMobileProvision",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pymobileprovision"
}
        
Elapsed time: 0.09729s