@@ -14,6 +14,7 @@ import filter from 'licia/filter'
1414import LunaCommandPalette from 'luna-command-palette/react'
1515import find from 'licia/find'
1616import idxOf from 'licia/idxOf'
17+ import truncate from 'licia/truncate'
1718import { Terminal } from '@xterm/xterm'
1819
1920interface IShell {
@@ -90,7 +91,7 @@ export default observer(function Shell() {
9091
9192 const commands = map ( getCommands ( ) , ( [ title , command ] ) => {
9293 return {
93- title : `${ title } (${ command } )` ,
94+ title : `${ title } (${ truncate ( command , 95 - title . length ) } )` ,
9495 handler : ( ) => {
9596 main . writeShell ( selectedShell . sessionId , command )
9697 setTimeout ( ( ) => {
@@ -148,15 +149,24 @@ export default observer(function Shell() {
148149} )
149150
150151function getCommands ( ) {
151- return [
152+ const commands = [
152153 [ t ( 'reboot' ) , 'reboot\n' ] ,
153154 [ t ( 'rebootRecovery' ) , 'reboot recovery\n' ] ,
154155 [ t ( 'rebootBootloader' ) , 'reboot bootloader\n' ] ,
156+ [ t ( 'memInfo' ) , 'dumpsys meminfo\n' ] ,
157+ [ t ( 'batteryInfo' ) , 'dumpsys battery\n' ] ,
155158 [
156159 `${ t ( 'start' ) } shizuku` ,
157160 'sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh\n' ,
158161 ] ,
159- [ t ( 'memInfo' ) , 'dumpsys meminfo\n' ] ,
160- [ t ( 'batteryInfo' ) , 'dumpsys battery\n' ] ,
161162 ]
163+
164+ if ( store . language === 'zh-CN' ) {
165+ commands . push ( [
166+ '授权 GKD' ,
167+ 'pm grant li.songe.gkd android.permission.WRITE_SECURE_SETTINGS; appops set li.songe.gkd ACCESS_RESTRICTED_SETTINGS allow\n' ,
168+ ] )
169+ }
170+
171+ return commands
162172}
0 commit comments