Featured image of post Autojs获取APP图标

Autojs获取APP图标

Autojs 获取任意图标代码:

Autojs 获取任意图标代码:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19


|  | importClass(java.io.File); |
| --- | --- |
|  | importClass(java.io.FileOutputStream); |
|  | importClass(android.graphics.Bitmap); |
|  | pm = context.getPackageManager(); |
|  | importClass(android.util.DisplayMetrics) |
|  | var name = rawInput("请输入你想要获取的应用图标的应用名", "QQ"); |
|  | packageName = app.getPackageName(name); |
|  | appInfo = pm.getApplicationInfo(packageName, 0); |
|  | bmp = appInfo.loadIcon(pm).getBitmap(); |
|  | files.create("/sdcard/"+name+".jpg"); |
|  | f = new File("/sdcard/"+name+".jpg"); |
|  | fOut = new FileOutputStream(f); |
|  | bmp.compress(Bitmap.CompressFormat.JPEG, 100, fOut); |
|  | fOut.flush(); |
|  | fOut.close(); |
|  | app.viewFile("sdcard/"+name+".jpg") |
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
使用 Hugo 构建
主题 StackJimmy 设计