GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AndroidTestScripts/python/get_current_pkginfo.py at master · wallaceok/AndroidTestScripts

Expand file tree

/

get_current_pkginfo.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
40 lines (30 loc) · 1.09 KB
/

get_current_pkginfo.py

Copy path

File metadata and controls

40 lines (30 loc) · 1.09 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
'''
Created on 2015年1月26日
@author: xuxu
'''
import os
import tempfile
import re
from scriptUtils import utils
#获取设备上当前应用的包信息,结果存放于当前目录下的PackageInfo.txt中
tempFile = tempfile.gettempdir()
def get_aapt():
if "ANDROID_HOME" in os.environ:
rootDir = os.path.join(os.environ["ANDROID_HOME"], "build-tools")
for path, subdir, files in os.walk(rootDir):
if "aapt.exe" in files:
return os.path.join(path, "aapt.exe")
else:
return "ANDROID_HOME not exist"
def get_match_apk(package_name):
list = []
for packages in utils.shell("pm list packages -f %s" %package_name).stdout.readlines():
list.append(packages.split(":")[-1].split("=")[0])
apk_name = list[0].split("/")[-1]
utils.adb("pull %s %s" %(list[0], tempFile)).wait()
return "%s\\%s" %(tempFile, apk_name)
if __name__ == "__main__":
os.popen("%s dump badging %s > PackageInfo.txt" %(get_aapt(), utils.get_current_package_name()))
os.popen("del %s\\*.apk" %tempFile)
print "Completed"
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.