{"id":21997645,"url":"https://github.com/osfunapps/os-android-app-automation-py","last_synced_at":"2025-04-30T21:05:56.110Z","repository":{"id":57449795,"uuid":"332769018","full_name":"osfunapps/os-android-app-automation-py","owner":"osfunapps","description":"Will prepare an Android app by properties defined by a xml file ","archived":false,"fork":false,"pushed_at":"2021-02-07T15:59:56.000Z","size":24,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-19T20:15:27.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osfunapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-25T14:13:11.000Z","updated_at":"2021-12-17T00:05:54.000Z","dependencies_parsed_at":"2022-09-26T17:31:09.583Z","dependency_job_id":null,"html_url":"https://github.com/osfunapps/os-android-app-automation-py","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-android-app-automation-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-android-app-automation-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-android-app-automation-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-android-app-automation-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osfunapps","download_url":"https://codeload.github.com/osfunapps/os-android-app-automation-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227223679,"owners_count":17750386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T22:17:34.104Z","updated_at":"2024-11-29T22:17:34.841Z","avatar_url":"https://github.com/osfunapps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n------------\n\nThis module aim to assist with an Android app buildup.\n\nTo use, create an XML file with your app properties and run.\n\n## Installation\nInstall via pip:\n```python\npip install os-android-app-automation\n```\n## Usage:\n\nCreate an XML file with your app properties:\n\n- [xml example 1](/examples/example_1.xml):\n```xml\n\u003candroid_mapper\u003e\n\n    \u003c!-- will hold all of the project settings --\u003e\n    \u003csettings\u003e\n        \u003c!-- toggle this to true if you want to create a copy of your project and let the automation run on it, instead of the original project --\u003e\n        \u003cwork_on_project_alias\u003efalse\u003c/work_on_project_alias\u003e\n    \u003c/settings\u003e\n\n    \u003c!-- will hold all of the project properties --\u003e\n    \u003cproject_properties\u003e\n        \n        \u003cproject_path\u003e/path/to/Android/studio/project\u003c/project_path\u003e\n\n        \u003c!-- you can also set placeholders here, for any of the below properties, and define them during runtime like so --\u003e\n        \u003c!--\u003cproject_path\u003e$android_project_path\u003c/project_path\u003e--\u003e\n        \n\n        \u003c!-- if you have admob in your app, set here the admob id --\u003e\n        \u003capp_ad_id\u003eca-app-pub-32050407656945904~1094096384\u003c/app_ad_id\u003e\n        \u003cgoogle_services_path\u003e/path/to/google-services.json\u003c/google_services_path\u003e\n        \u003cpackage_name\u003ecom.company_name.product_name\u003c/package_name\u003e\n        \u003capp_name\u003eApp Name\u003c/app_name\u003e\n        \u003cversion_code\u003e1\u003c/version_code\u003e\n        \u003cversion_name\u003e1.0\u003c/version_name\u003e\n\n        \u003c!-- set the launchers you want to copy to your project.\n         The path should be look like so:\n         main::\n            ic_launcher-playstore.png\n            res:\n                mipmap-anydpi-v26:\n                    ic_launcher_round.xml\n                    ic_launcher.xml\n                mipmap-hdpi:\n                    ic_launcher_round.xml\n                    ic_launcher.xml\n                ... all the rest of the mipmaps ....\n                values:\n                    ic_launcher_background.xml\n         --\u003e\n        \u003claunchers_path\u003e/path/to/app/launcher/files/main\u003c/launchers_path\u003e\n\n        \u003c!-- if you want to copy some assets to your project, set it here --\u003e\n        \u003cassets_path\u003e/path/to/assets\u003c/assets_path\u003e\n    \u003c/project_properties\u003e\n\n\n    \u003c!-- set here all of the modules you want to add to the project --\u003e\n    \u003cadded_modules\u003e\n        \u003cmodule\u003emodule_1\u003c/module\u003e\n        \u003cmodule\u003emodule_2\u003c/module\u003e\n        \u003cmodule\u003emodule_3\u003c/module\u003e\n    \u003c/added_modules\u003e\n\n\n    \u003c!-- set any gradle dependencies here --\u003e\n    \u003cgradle_dependencies\u003e\n        implementation 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'\n        implementation 'androidx.core:core-ktx:1.3.2'\n        implementation 'androidx.appcompat:appcompat:1.2.0'\n        implementation 'com.google.android.material:material:1.2.1'\n\n        // gson\n        implementation 'com.google.code.gson:gson:2.8.6'\n\n        // glide\n        implementation 'com.github.bumptech.glide:glide:4.11.0'\n        kapt 'com.github.bumptech.glide:compiler:4.11.0'\n\n        // all of the other dependencies...\n    \u003c/gradle_dependencies\u003e\n\u003c/android_mapper\u003e\n```\nAfter your created the XML file, call it from code:\n```python\nfrom os_android_app_automation import app_automation \n\napp_automation.set_android_project_by_xml(xml_path='path/to/xml/file.xml',\n                              place_holder_map={'$project_path': 'path/to/android/project'}, # optional define in runtime\n                              on_backup=on_backup,                  // optional call back here\n                              on_pre_build=on_pre_build             // optional callback here\n)\n\n# optional callbacks:\n\n# this callback will be fired before the process begins. You can clear files, remove directories and etc...\n# notice that the package name here is the old package name of the project (the automation didn't changed anything yet)\ndef on_backup(project_path, old_package_name):\n    pass\n\n# this callback will be fired right before the build will commence. i.e. after package name change, assets copy and essentially, before apk/bundle creation \ndef on_pre_build(project_path, package_name):\n    pass\n```\n\n# Advanced Usage:\n\nYou can also extend an XML file to another one.\n\nInheritance in this sense can help you if you're interested in sharing a behaviour between a bunch of XML files.\n\n- [child xml](/examples/child_xml_example.xml):\n```xml\n\u003c!-- Notice the extension at the top. Here we will define the path to the parent mapper xml --\u003e\n\u003candroid_mapper extension_mapper_path=\"$android_shared_mapper\"\u003e\n    \u003cproject_properties\u003e\n        \u003capp_ad_id\u003eca-app-pub-12345678798~546\u003c/app_ad_id\u003e\n        \u003cpackage_name\u003ecom.osfunapps.my_package_name\u003c/package_name\u003e\n        \u003capp_name\u003eMyAppName\u003c/app_name\u003e\n        \u003cversion_code\u003e12\u003c/version_code\u003e\n        \u003cversion_name\u003e1.2\u003c/version_name\u003e\n    \u003c/project_properties\u003e\n\n    \u003c!-- will add more modules, they will be merged with the parent modules --\u003e\n    \u003cadded_modules\u003e\n        \u003cmodule\u003eanother_module\u003c/module\u003e\n    \u003c/added_modules\u003e\n\n    \u003c!-- will add more dependencies, they will be merged with the parent modules --\u003e\n    \u003cgradle_dependencies\u003e\n        implementation 'com.squareup.okhttp3:okhttp:4.9.0'\n    \u003c/gradle_dependencies\u003e\n\u003c/android_mapper\u003e\n```\n\n- [parent xml](/examples/parent_xml_example.xml):\n```xml\n\u003candroid_mapper\u003e\n\n    \u003csettings\u003e\n        \u003cwork_on_project_alias\u003efalse\u003c/work_on_project_alias\u003e\n    \u003c/settings\u003e\n\n    \u003cproject_properties\u003e\n        \u003cproject_path\u003e/path/to/project\u003c/project_path\u003e\n        \u003cgoogle_services_path\u003e/path/to/google/services.json\u003c/google_services_path\u003e\n        \u003claunchers_path\u003e/path/to/launcher/directories\u003c/launchers_path\u003e\n        \u003cassets_path\u003e/path/to/assets\u003c/assets_path\u003e\n    \u003c/project_properties\u003e\n\n    \u003cadded_modules\u003e\n        \u003cmodule\u003emodule_1\u003c/module\u003e\n        \u003cmodule\u003emodule_2\u003c/module\u003e\n        \u003cmodule\u003emodule_3\u003c/module\u003e\n        \u003c!-- the rest of the modules will come from the child --\u003e\n    \u003c/added_modules\u003e\n\n    \u003cgradle_dependencies\u003e\n        implementation \"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version\"\n        implementation 'androidx.core:core-ktx:1.3.2'\n        implementation 'androidx.appcompat:appcompat:1.2.0'\n\n        // the rest of the modules dependencies will come from the child\n\n    \u003c/gradle_dependencies\u003e\n\u003c/android_mapper\u003e\n```\n\nThat's it. Now you can just call the xml of the child (if you set placeholders in the xml, don't forget to set them when you call the function).\n\n\nAnd more...\n\n\n## Links\n[GitHub - osapps](https://github.com/osfunapps)\n\n## Licence\nISC","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosfunapps%2Fos-android-app-automation-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosfunapps%2Fos-android-app-automation-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosfunapps%2Fos-android-app-automation-py/lists"}