AIWROK软件APP操作类合集
<table cellspacing="0" cellpadding="0" style="table-layout: fixed; width: 979px; font-size: 12px;"><tbody><tr><td class="t_f" id="postmessage_328" style="font-size: 14px; line-height: 24px;"><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第一个方法:代理模式获取当前activity地址</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getAgentCurrenAcitvity());</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">函数 app.getAgentCurrenAcitvity() 来获取当前的活动,并将其输出到控制台。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=4b375e6fabaac5020b27674ebd3a1cca" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第二个方法:getAllApp获取所有app</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getAllApp());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">请求打印设备上安装的所有应用程序的列表。这里的 printl 函数是用于输出信息,而 app.getAllApp() 是获取当前设备所有应用程序的方法。<br style="box-sizing: border-box;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=9167cdbce395710e20aaf569990822e5" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第二个方法:getAppName获取APP名字</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs javascript" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: rgb(198, 120, 221);">function</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(97, 174, 238);">printString</span>(<span class="hljs-params" style="box-sizing: border-box;">str</span>) </span>{
<span class="hljs-built_in" style="box-sizing: border-box; color: rgb(230, 192, 123);">console</span>.log(str);
}
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取当前应用的包名</span>
<span class="hljs-keyword" style="box-sizing: border-box; color: rgb(198, 120, 221);">var</span> packageName = app.getPackName();
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 使用包名获取应用的名称</span>
<span class="hljs-keyword" style="box-sizing: border-box; color: rgb(198, 120, 221);">var</span> appName = app.getAppName(packageName);
printString(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">"Package Name: "</span> + packageName);
printString(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">"App Name: "</span> + appName);
</code></pre><ol style="margin-bottom: 1.5em; padding-left: 2em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><li style="box-sizing: border-box;"><p style="margin-top: 16px; margin-bottom: 1.5em; box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700;">定义函数</span> <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; margin-right: 4px; margin-left: 5px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">printString</code>: 用于在控制台输出字符串。</p></li><li style="box-sizing: border-box;"><p style="margin-top: 16px; margin-bottom: 1.5em; box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700;">获取包名</span> <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; margin-right: 4px; margin-left: 5px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">packageName</code>:</p><ul style="margin-left: 14px; padding-left: 2em; box-sizing: border-box;"><li style="list-style: disc; box-sizing: border-box;">使用 <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">app.getPackName()</code> 方法获取当前应用的包名。</li></ul></li><li style="box-sizing: border-box;"><p style="margin-top: 16px; margin-bottom: 1.5em; box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700;">获取应用名称</span> <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; margin-right: 4px; margin-left: 5px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">appName</code>:</p><ul style="margin-left: 14px; padding-left: 2em; box-sizing: border-box;"><li style="list-style: disc; box-sizing: border-box;">使用 <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">app.getAppName(packageName)</code> 方法,通过包名获取应用的名称。</li></ul></li><li style="box-sizing: border-box;"><p style="margin-top: 16px; margin-bottom: 1.5em; box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700;">打印输出</span>:</p><ul style="margin-left: 14px; padding-left: 2em; box-sizing: border-box;"><li style="list-style: disc; box-sizing: border-box;">使用 <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">printString</code> 函数,分别输出包名和应用名称。</li></ul></li></ol><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">整体流程是先获取包名,再通过包名获取应用名称,最后将结果打印到控制台。<br style="box-sizing: border-box;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=18755b4903847f1112d52724c1b2e99b" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第三个方法:getCurrentActivity无障碍获取当前activity地址</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getCurrentActivity());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">app.getCurrentActivity():这个方法应该返回当前应用正在显示或运行的活动名称。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=ef47f86b0479ea81638ce09620df8649" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第四个方法:getLocalAppName获取自己APP名字,指的是用AIWROK打包的</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getLocalAppName());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">通常,app.getLocalAppName()可能是一个获取应用名称的函数,以下是一般的解释:</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">app.getLocalAppName():</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">该方法用于获取应用程序的本地名称。<br style="box-sizing: border-box;">返回值通常是一个字符串,表示应用的名称。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=f4111e201ecdf9b1316da5d1c346648d" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第五个方法:getLocalVerName获取自己版本号,指的是用AIWROK打包的</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getLocalVerName());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">app.getLocalVerName()是一个方法,用于获取本地应用程序的版本名称。执行这行代码将会输出当前应用程序的版本名称。<br style="box-sizing: border-box;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=06ac57dbc01c840f319959c950ff34c4" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第六个方法:getMemory 获取内存信息,指的是用AIWROK打包的</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getMemory());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">代码中,printl(app.getMemory()); 是用来打印设备内存使用信息的函数调用,可以获取当前应用的内存使用情况。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">下方的日志输出显示了内存信息的结构:</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">Total: 总内存大小<br style="box-sizing: border-box;">Available: 可用内存大小<br style="box-sizing: border-box;">Used: 已使用的内存<br style="box-sizing: border-box;">app: 当前应用使用的内存大小</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">这些信息用于监控内存使用情况,有助于了解应用性能。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=b5fdd7a4d7b560d56e95016042efeedb" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第七个方法:getMemory 获取内存信息,指的是用AIWROK打包的</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getMemoryPercent());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">在使用AIWork打包的应用中,如果需要获取内存信息,你可以使用应用提供的API函数,比如app.getMemoryPercent()来获取当前内存的使用百分比。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=0e59d2cd41273a11e98512d488db0951" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第七个方法:getTopPackName获取当前app包名</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getTopPackName());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">这个代码示例显示如何获取当前顶端应用的包名。getTopPackName()函数用于返回当前运行在最前面的应用的包名。如果代理模式开启,默认会通过agent来获取包名,否则通过无障碍模式来获取。<br style="box-sizing: border-box;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=528f14716f3971c7feff4c9ddb1904f0" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第八个方法:getTopPackNameV2获取当前app包名方法2</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs apache" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-attribute" style="box-sizing: border-box; color: rgb(152, 195, 121);">printl</span>(app.getTopPackNameV<span class="hljs-number" style="box-sizing: border-box; color: rgb(209, 154, 102);">2</span>());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">这个代码示例显示如何获取当前顶端应用的包名。getTopPackName()函数用于返回当前运行在最前面的应用的包名。如果代理模式开启,默认会通过agent来获取包名,否则通过无障碍模式来获取。<br style="box-sizing: border-box;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=528f14716f3971c7feff4c9ddb1904f0" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第九个方法:getVerName 获取版本号名称</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">代码示例显示了一个用于获取应用程序版本名称的函数调用示例:</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getVerName(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.launcher3'</span>));
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">这是调用了一个名为 <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; margin-right: 4px; margin-left: 5px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">getVerName</code> 的函数,传入了参数 <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; margin-right: 4px; margin-left: 5px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">'com.android.launcher3'</code>,是获取该应用包的版本名称。输出结果在日志中显示为 <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; margin-right: 4px; margin-left: 5px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">9</code>。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">一个用于获取当前顶端应用包名称的函数 <code style="box-sizing: border-box; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 3px; margin-right: 4px; margin-left: 5px; background: rgb(249, 249, 249); border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(64, 158, 255);">getTopPackName()</code>。这个函数通过不同模式获取包装名,如果启用了代理模式则通过代理获取,否则通过无障碍模式获取。<br style="box-sizing: border-box;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=d9163d79a80b60ff057484e3a1a8f396" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第十个方法:getVersionCode获取版本号</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getVersionCode(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.launcher3'</span>));
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">如果你想获取“com.android.launcher3”这个应用的版本号并打印出来</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=c807c8b34f8843db63b1614e3203df1d" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第十一个方法:installApp安装app</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.installApp(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">"/sdcard/test_1.apk"</span>));
<span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.installAppV2(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">"/sdcard/test_1.apk"</span>));
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">通常 installApp 方法需要的是一个有效的文件路径或者下载链接用于安装应用。<br style="box-sizing: border-box;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=17741972ec3fa728e2a091f3938ce28d" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第十二个方法:logRunningProcesses获取当前进程信息</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.logRunningProcesses());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">app.logRunningProcesses()是一个返回进程信息的方法</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=f49d15834878b721f2bb39715ec5966d" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第十三个方法:openApp 打开app,两个方法</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.openAppv2(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.browser'</span>));
<span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.openApp(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.browser'</span>));
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">验证’com.android.browser’是否是你想要打开的应用的正确包名<br style="box-sizing: border-box;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=7edfa671ed84b2782231acb1ba047a3e" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第十四个方法:openAppSeting打开app设置</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.openAppSeting(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.browser'</span>));
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">‘com.android.browser’ 是你想要打开的应用的包名。请注意,com.android.browser 在某些Android版本中可能已经被弃用,取而代之的是其他浏览器应用,如 com.android.chrome(Chrome浏览器)。你需要确认这是你要打开的应用的正确包名。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=aadd310d9be3295a6bd1780a3667af30" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第十五个方法:supperKeep开启超级保活,目前试验阶段只能保活安卓8-12</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">app</span><span class="hljs-selector-class" style="box-sizing: border-box; color: rgb(209, 154, 102);">.supperKeep</span>();
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">这个方法只支持我们软件生成的APK</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=49563c007deb0886d2c1019a0c408e5b" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第十六个方法:updatePatch升级补丁</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.updatePatch());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">你可以直接调用 app.updatePatch(),不需要将它嵌入到打印函数中,因为它没有返回值。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=baa0b889b8c970e21514b91ca4ccdebc" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第十七个方法:closeApp关闭app</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.closeApp(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.ss.android.article.news'</span>));
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">确保传递的参数 ‘com.ss.android.article.news’ 是你要关闭应用的正确包名。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=be0d5a07d85b9c09ff4b03a30625f921" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第十八个方法:getCardEndTime 获取卡密对apk有无效</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getCardCode());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">这个是指AIWROK生成的APP获取卡密对apk有无效</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=ebe1b18c27c0b58430f7ac41ded2abb8" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"><br style="box-sizing: border-box;">第十九个方法:getCardEndTime 获取卡密剩余天数卡密apk有效</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; margin-bottom: 1.5em; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><code class="hljs less" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-selector-tag" style="box-sizing: border-box; color: rgb(224, 108, 117);">printl</span>(app.getCardCode());
</code></pre><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">getCardEndTime 获取卡密剩余天数卡密apk有效</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=3430e88cd1a140eb4cb2928f4a047642" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">第二十个方法:resetApp重后app</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">printl(app.resetApp(‘com.ss.android.article.news’));</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">函数定义:resetApp 函数应在你的 API 或软件库中正确定义。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">权限:确保应用程序具有必要的权限来执行重置操作。通常涉及对应用程序数据的清除或重置需要相应的权限。</p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">resetApp 函数没有定义或不具备所需的权限<br style="box-sizing: border-box;"><img src="http://doc.aiwork24.com:91/server/index.php?s=/api/attachment/visitFile&sign=da3f3e979f90cf0361f4e48e892bf95b" alt="" style="box-sizing: border-box; border: 0px; max-width: 100%;"></p><p style="margin-bottom: 1.5em; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">所有代码进行集合:</p><pre style="overflow-wrap: normal; box-sizing: border-box; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 12px; line-height: 1.6; font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; padding: 1em; overflow: auto; background: rgb(56, 69, 72); border-radius: 4px; border: 1px solid rgb(221, 221, 221); position: relative; color: rgb(209, 210, 210);"><span class="btn-pre-copy" style="box-sizing: border-box; display: block; user-select: none; position: absolute; top: 10px; right: 12px; font-size: 11px; line-height: 1; cursor: pointer; color: rgb(153, 153, 153); transition: color 0.1s ease 0s;">复制</span><code class="hljs javascript" style="overflow-wrap: normal; box-sizing: border-box; background: 0px 0px transparent; font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; border-radius: 3px; border: 0px; word-break: normal; display: block; max-width: none; overflow-x: auto; overflow-y: initial; line-height: inherit;"><span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 代理模式获取当前activity地址</span>
printl(app.getAgentCurrenAcitvity());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取所有应用</span>
printl(app.getAllApp());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取当前应用的包名并获取APP名字</span>
<span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: rgb(198, 120, 221);">function</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(97, 174, 238);">printString</span>(<span class="hljs-params" style="box-sizing: border-box;">str</span>) </span>{
<span class="hljs-built_in" style="box-sizing: border-box; color: rgb(230, 192, 123);">console</span>.log(str);
}
<span class="hljs-keyword" style="box-sizing: border-box; color: rgb(198, 120, 221);">var</span> packageName = app.getPackName();
<span class="hljs-keyword" style="box-sizing: border-box; color: rgb(198, 120, 221);">var</span> appName = app.getAppName(packageName);
printString(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">"Package Name: "</span> + packageName);
printString(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">"App Name: "</span> + appName);
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取当前activity地址</span>
printl(app.getCurrentActivity());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取本地APP名字</span>
printl(app.getLocalAppName());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取本地版本号</span>
printl(app.getLocalVerName());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取内存信息</span>
printl(app.getMemory());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取内存使用百分比</span>
printl(app.getMemoryPercent());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取当前app包名</span>
printl(app.getTopPackName());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取当前app包名方法2</span>
printl(app.getTopPackNameV2());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取版本号名称</span>
printl(app.getVerName(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.launcher3'</span>));
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取应用版本号</span>
printl(app.getVersionCode(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.launcher3'</span>));
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 安装应用</span>
printl(app.installApp(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">"/sdcard/test_1.apk"</span>));
printl(app.installAppV2(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">"/sdcard/test_1.apk"</span>));
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取当前进程信息</span>
printl(app.logRunningProcesses());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 打开应用</span>
printl(app.openAppv2(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.browser'</span>));
printl(app.openApp(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.browser'</span>));
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 打开应用设置</span>
printl(app.openAppSeting(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.android.browser'</span>));
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 超级保活</span>
app.supperKeep();
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 升级补丁</span>
app.updatePatch();
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 关闭应用</span>
printl(app.closeApp(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.ss.android.article.news'</span>));
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取卡密对APK有无效</span>
printl(app.getCardCode());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 获取卡密剩余天数</span>
printl(app.getCardCode());
<span class="hljs-comment" style="box-sizing: border-box; color: rgb(170, 170, 170); font-style: italic;">// 重置应用</span>
printl(app.resetApp(<span class="hljs-string" style="box-sizing: border-box; color: rgb(152, 195, 121);">'com.ss.android.article.news'</span>));</code></pre></td></tr></tbody></table><p></p>
页:
[1]