diff --git a/Andriod10/0_Intro_Pixel3_Andriod10.pptx b/Andriod10/0_Intro_Pixel3_Andriod10.pptx index da49422..625ef71 100644 Binary files a/Andriod10/0_Intro_Pixel3_Andriod10.pptx and b/Andriod10/0_Intro_Pixel3_Andriod10.pptx differ diff --git a/Andriod10/1_Pixel3_Image.pptx b/Andriod10/1_Pixel3_Image.pptx index 76907a5..7076db7 100644 Binary files a/Andriod10/1_Pixel3_Image.pptx and b/Andriod10/1_Pixel3_Image.pptx differ diff --git a/Andriod10/1_list_app_name_v1.py b/Andriod10/1_list_app_name_v1.py new file mode 100644 index 0000000..0fb655a --- /dev/null +++ b/Andriod10/1_list_app_name_v1.py @@ -0,0 +1,39 @@ +""" +Explanation of the Code +Listing Package IDs : +- The script uses os.listdir() to list all directories in the Pixel 3/data/data folder. Each directory corresponds to an installed app's package ID. +Fetching App Details : +- For each package ID, the script constructs the Google Play Store URL (https://play.google.com/store/apps/details?id=). +- It uses the requests library to fetch the HTML content of the app's details page. +Parsing the HTML : +- The script uses BeautifulSoup from the bs4 module to parse the HTML response. +- It looks for the

tag with the attribute itemprop="name" to extract the app name. +Output : +- The script prints the app name and its corresponding package ID. +""" +import os +import requests +import re +def get_android_apps(): + package = "com.twitter.android" + # Base URL for Google Play Store app details + base_url = "https://play.google.com/store/apps/details?id=" + try: + # Fetch the app details page + url = base_url + package + print(url) + response = requests.get(url) + if response.status_code != 200: + print(f"Failed to fetch details for package: {package}") + + else: + # Extract the app name using a regular expression + match = re.search(r'itemprop="name">(.*?)', response.text) + app_name = match.group(1) if match else "Unknown" + # Print the app name and package ID + print(f"App Name: {app_name}, Package ID: {package}") + except Exception as e: + print(f"Error processing package {package}: {str(e)}") + +if __name__ == "__main__": + get_android_apps() \ No newline at end of file diff --git a/Andriod10/1_list_app_name_v2.py b/Andriod10/1_list_app_name_v2.py new file mode 100644 index 0000000..1f9153c --- /dev/null +++ b/Andriod10/1_list_app_name_v2.py @@ -0,0 +1,48 @@ +""" +Explanation of the Code +Listing Package IDs : +- The script uses os.listdir() to list all directories in the Pixel 3/data/data folder. Each directory corresponds to an installed app's package ID. +Fetching App Details : +- For each package ID, the script constructs the Google Play Store URL (https://play.google.com/store/apps/details?id=). +- It uses the requests library to fetch the HTML content of the app's details page. +Parsing the HTML : +- The script uses BeautifulSoup from the bs4 module to parse the HTML response. +- It looks for the

tag with the attribute itemprop="name" to extract the app name. +Output : +- The script prints the app name and its corresponding package ID. +""" +import os +import requests +import re +def get_android_apps(): + # Path to the directory containing package IDs + data_dir = "Pixel 3/data/data" + # List all package IDs (directories) in the specified path + try: + packages = [name for name in os.listdir(data_dir) if os.path.isdir(os.path.join(data_dir, name))] + except FileNotFoundError: + print(f"Directory '{data_dir}' not found.") + return + # Base URL for Google Play Store app details + base_url = "https://play.google.com/store/apps/details?id=" + for package in packages: + try: + # Fetch the app details page + url = base_url + package + print(url) + response = requests.get(url) + if response.status_code != 200: + print(f"Failed to fetch details for package: {package}") + continue + # Extract the app name using a regular expression + # print(response.text) + match = re.search(r'itemprop="name">(.*?)', response.text) + app_name = match.group(1) if match else "Unknown" + # Print the app name and package ID + print(f"App Name: {app_name}, Package ID: {package}") + except Exception as e: + print(f"Error processing package {package}: {str(e)}") + +if __name__ == "__main__": + print("Current Working Directory:", os.getcwd()) + get_android_apps() \ No newline at end of file