这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
5bd9477
test
rubinstory May 12, 2022
7adb5b9
test: git test with change readme
BUYA-GH May 15, 2022
c220eee
Merge pull request #1 from BUYA-GH/master
rubinstory May 15, 2022
eb25e2c
Refactor: Extract method isEmulatorNull
BUYA-GH May 15, 2022
b90cc81
Added|Fixed: Extract Superclass from FieldInvokeResult and
rubinstory May 15, 2022
943a347
Merge pull request #2 from rubinstory/refactor/ReflectionUtils.java
rubinstory May 15, 2022
93d3efe
Changed: Refactor function name intable to isInTable
cyj893 May 15, 2022
a55f1fc
Changed: Extracting boolean variables in function `width()`
cyj893 May 15, 2022
46ddf64
refactor: Extract methods from getDeviceInfoMarkdownString()
rubinstory May 15, 2022
e9a85b8
Merge pull request #3 from rubinstory/refactor/ReflectionUtils.java
rubinstory May 15, 2022
cf20e57
Merge pull request #1 from cyj893/refactor/WcWidth
cyj893 May 15, 2022
51dd6b9
refactor: Add Explaining Variables at appendPropertyToMarkdownIfSet()
rubinstory May 15, 2022
6523497
Merge pull request #5 from rubinstory/refactor/AndroidUtils.java
rubinstory May 15, 2022
e92e0a0
Merge pull request #4 from cyj893/master
rubinstory May 15, 2022
888392c
Changed: Refactor function name intable to isInTable
cyj893 May 15, 2022
d28ccaa
Changed: Extracting boolean variables in function `width()`
cyj893 May 15, 2022
2693133
Changed: Refactor if statement condition with explaining variables
rubinstory May 16, 2022
4795f45
Changed: Replace Error Code with Exception
cyj893 May 16, 2022
815b8ae
Refactor: Extract methods from `setupBootstrapIfNeeded`
eyi-jin May 16, 2022
dbf19ae
Refactor: Extract Control down + num variable to static final
BUYA-GH May 16, 2022
818811f
Merge pull request #1 from BUYA-GH/refactor/TerminalView
BUYA-GH May 16, 2022
c5696a5
Changed: Extract method `getComponentLength()` and `parseRGB()` from …
cyj893 May 16, 2022
5eedc52
Merge pull request #8 from BUYA-GH/master
rubinstory May 16, 2022
4bb0b2f
refactor: extract variable and extract method from `onStartCommand()`
May 16, 2022
7512195
Merge pull request #9 from eyi-jin/refactor/TermuxInstaller.java
rubinstory May 16, 2022
a3777e3
Merge pull request #10 from taehoonkange/refactor/TermuxService.java
rubinstory May 16, 2022
c38dfe8
Refactor: make "" and " " to String blank and blankSpace for more rea…
BUYA-GH May 16, 2022
581ce34
Refactor: extract function addStringOnMenu at setActionModeCallBacks(…
BUYA-GH May 16, 2022
a324e95
Changed: Exception handling in each usage.
cyj893 May 16, 2022
4e576cf
Merge pull request #2 from cyj893/refactor/TerminalColors
cyj893 May 16, 2022
11582d5
Merge branch 'rubinstory:master' into master
cyj893 May 16, 2022
c7e55d4
Merge pull request #11 from cyj893/master
rubinstory May 16, 2022
09bdad4
Refactor: Replace if condition to explaining variable
eyi-jin May 16, 2022
8bbaede
Merge branch 'master' of https://github.com/rubinstory/termux-app int…
eyi-jin May 16, 2022
c5ee897
Changed: Extract `hasPrefixError()` from `setupBootstrapIfNeeded()`
eyi-jin May 16, 2022
b338ebf
Merge pull request #12 from eyi-jin/refactor/TermuxInstaller.java
rubinstory May 16, 2022
2366ca8
Changed: Refactor `isOther()` and `isDevice()` with member functions
rubinstory May 16, 2022
b3ba5ad
Changed: Extract Explaining Variables in `permissions()` in
rubinstory May 16, 2022
da336a2
Merge pull request #13 from rubinstory/refactor/FileAttributes.java
rubinstory May 16, 2022
5a0c88c
Refactor: rename 'reverseVideo' to 'isReverseVideo' for more suitable…
BUYA-GH May 17, 2022
a2ca800
Refactor: simplify boolean expression
BUYA-GH May 17, 2022
691568a
Merge pull request #2 from BUYA-GH/refactor/TextSelectionCurosrContro…
BUYA-GH May 17, 2022
f5a3d9b
Merge pull request #3 from BUYA-GH/refactor/TerminalRendere
BUYA-GH May 17, 2022
55e129f
Merge pull request #14 from BUYA-GH/master
rubinstory May 17, 2022
54002c3
Changed: Refactor `logMessage()` from `Logger.java` with `switch-case`
rubinstory May 17, 2022
8e656e6
Merge pull request #15 from rubinstory/refactor/Logger.java
rubinstory May 17, 2022
f10d16a
Changed: Refactor `logMessage()` from `Logger.java` with `switch-case`
rubinstory May 17, 2022
3bc7a2a
Merge branch 'master' into refactor/Logger.java
rubinstory May 17, 2022
0fd78c4
Merge pull request #16 from rubinstory/refactor/Logger.java
rubinstory May 17, 2022
9ef614d
refactor: extract variable `!mWantsToStop` to `isStop`
May 17, 2022
02348a2
refactor: extract method in function `actionAcquireWakeLock()`
May 17, 2022
b8f7f14
Merge pull request #17 from taehoonkange/refactor/TermuxService.java
rubinstory May 17, 2022
9937826
refactor: extract method in function `killAllTermuxExecutionCommands()`
May 17, 2022
2baf66f
Merge pull request #18 from taehoonkange/refactor/TermuxService.java
rubinstory May 17, 2022
dd71626
refactor: extract method in function`actionReleaseWakeLock()`
May 17, 2022
493133a
Merge pull request #19 from taehoonkange/refactor/TermuxService.java
rubinstory May 17, 2022
31bc372
refactor: extract variable in function ` onTermuxSessionExited()`
May 17, 2022
1bed89d
refactor: extract class `RootPreferencesFragment` from `SettingsActiv…
May 17, 2022
56d453b
Merge pull request #20 from taehoonkange/refactor/TermuxService.java
rubinstory May 18, 2022
3dc6ace
Merge pull request #21 from taehoonkange/refactor/SettingsActivity.java
rubinstory May 18, 2022
3b318e7
Changed: Add explaining variable to `getPid()` in `ShellUtils.java`
rubinstory May 18, 2022
88fedac
refactor: extract class `DebuggingPreferencesDataStore.java` from `De…
May 18, 2022
edf3927
Changed: Extract Explaining Variables in `getSelectedText()`
cyj893 May 18, 2022
73dfe3a
Merge pull request #22 from rubinstory/refactor/ShellUtils.java
rubinstory May 18, 2022
086040e
Refactor: change if-else to switch-case because `displayOrientation` …
BUYA-GH May 18, 2022
3bf892e
Refactor: Make constant so that it can be recycled
eyi-jin May 17, 2022
deba645
Merge pull request #23 from taehoonkange/refactor/SettingsActivity.java
rubinstory May 18, 2022
c3c1467
Refactor: make boolean value for more readable at `isRectAbove()`
BUYA-GH May 18, 2022
9c12ca2
Merge pull request #4 from BUYA-GH/refactor/ViewUtils
BUYA-GH May 18, 2022
0df1ac5
Changed: Extract methods in `getWordAtLocation()`
cyj893 May 18, 2022
24a2eb3
Changed: Extract methods in `resize()`
cyj893 May 18, 2022
4c0d79e
Changed: Add `final` keywords in `updateOldState()`
cyj893 May 18, 2022
7b9e0bd
Changed: Extract Class `TextFinder` from `TerminalBuffer`
cyj893 May 18, 2022
8224ab2
Changed: Extract methods in `getSelectedText()`
cyj893 May 18, 2022
bae7cc2
Merge pull request #24 from BUYA-GH/master
rubinstory May 18, 2022
072ac65
Changed: Extract explaining variables in `updateOldState()`
cyj893 May 18, 2022
1fb7805
Merge branch 'master' of https://github.com/rubinstory/termux-app int…
eyi-jin May 18, 2022
9bdd4cf
Refactor: Extract method `getCurrentWorkingDirectory()` from `TermuxT…
eyi-jin May 18, 2022
5ed8f69
Changed: Extract duplicate statements to methods by `RowColumnPair` c…
cyj893 May 18, 2022
8194778
refactor: extract method from `setLogLevelListPreferenceData()` to `s…
May 18, 2022
f8887b9
Merge pull request #25 from taehoonkange/refactor/SettingsActivity.java
rubinstory May 18, 2022
4c27ac1
Changed: Extract method in `updateOldState()`
cyj893 May 18, 2022
cfb811a
Merge pull request #3 from cyj893/refactor/TerminalBuffer
cyj893 May 18, 2022
e8e2447
Merge pull request #26 from cyj893/master
rubinstory May 18, 2022
bbd7850
Merge pull request #27 from eyi-jin/refactor/TermuxTerminalSessionCli…
rubinstory May 18, 2022
4e018b3
Refactor: Extract `showNonFinishedSessionToast()` from `TermuxTermina…
eyi-jin May 18, 2022
51e034d
Changed: Refactor `getResultPendingIntentVariablesLogString()` in `Re…
rubinstory May 18, 2022
274739c
Merge pull request #28 from rubinstory/refactor/ResultConfig.java
rubinstory May 18, 2022
9d349ff
Changed: Extract method `getErrorsListString()` from
rubinstory May 18, 2022
a9b30f1
Merge pull request #29 from rubinstory/refactor/ResultData.java
rubinstory May 18, 2022
8560140
Refactor: make boolean value for more readable at `shouldEnableDarkTh…
BUYA-GH May 18, 2022
beb87fa
Refactor: remove getSystemAttrColor(Context, attr), because it wasn't…
BUYA-GH May 18, 2022
d83ba91
Merge pull request #5 from BUYA-GH/refactor/ThemeUtils
BUYA-GH May 18, 2022
d4cfe26
Merge branch 'rubinstory:master' into master
BUYA-GH May 18, 2022
127d96a
Merge pull request #30 from BUYA-GH/master
rubinstory May 19, 2022
3587979
Refactor: Extract `getIndexWithDirection()`, `isSessionPendingResult()`
eyi-jin May 19, 2022
d321ff9
Refactor: Extract `setCurrentSession()` from `TermuxTerminalSessionCl…
eyi-jin May 19, 2022
af93076
Refactor: Modify function call, Extract method from `TermuxTerminalSe…
eyi-jin May 19, 2022
40a0383
Merge branch 'master' of https://github.com/rubinstory/termux-app int…
eyi-jin May 19, 2022
f1dd3e9
Merge pull request #31 from eyi-jin/refactor/TermuxTerminalSessionCli…
rubinstory May 19, 2022
6f615db
Changed: Fixed Typo in `ExtraKeysInfo.java`
rubinstory May 19, 2022
acf7284
Merge pull request #32 from rubinstory/refactor/ExtraKeysInfo.java
rubinstory May 19, 2022
2766de2
Refactor: make boolean Value for more readable
BUYA-GH May 19, 2022
c7963c6
Refactor: delete the boolean method `isTitleEmpty` may produce 'NullP…
BUYA-GH May 19, 2022
edcc173
Refactor: delete the variation of `sendCrashReportNotification()` bec…
BUYA-GH May 19, 2022
ab749b8
Refactor: extract method `makeNewReportInfo()`
BUYA-GH May 19, 2022
a6945cd
Refactor: delete unnecessary semicolon ';' at enum Type
BUYA-GH May 19, 2022
b23c86a
Merge pull request #6 from BUYA-GH/refactor/TermuxCrashUtils
BUYA-GH May 19, 2022
51a82d3
Merge pull request #33 from BUYA-GH/master
rubinstory May 20, 2022
dae4d02
refactor: extract method and change switch case to conditional operator
May 20, 2022
2a28914
refactor: extract `TerminalIOPreferencesDataStore`class from ``
May 20, 2022
d2a6fd0
refactor : extract method and change switch case to condtional operator
May 20, 2022
669a642
refactor: extract `TerminalIOPreferencesDataStore.java`class
May 20, 2022
43e7704
refactor: extract method `isDisability()`
May 20, 2022
f88b81f
Refactor: extract method `isStringHasValue()` which check string has …
BUYA-GH May 20, 2022
e9d148e
Refactor: extract and move method `buildScript()` to TermuxConstants
BUYA-GH May 20, 2022
1d3881c
Refactor: extract method `runningScript()`
BUYA-GH May 20, 2022
c99c330
Refactor: extract method `buildOutputScript()`
BUYA-GH May 20, 2022
b126950
Refactor: extract method `buildOutputMarkdown()`
BUYA-GH May 20, 2022
578bd57
Merge pull request #38 from BUYA-GH/refactor/TermuxCrashUtils
rubinstory May 20, 2022
33d8acf
refactor: extract class `TerminalViewPreferencesDataStore.java`
May 20, 2022
9a65e78
refactor: extract method `isDisability()`
May 20, 2022
2f92445
refactor: change switch case to conditional operator
May 20, 2022
443802f
fix: delete `}`
May 20, 2022
f28b1e6
refactor: delete duplicated class `DebuggingPreferencesDataStore.java`
May 20, 2022
8ae988b
fix: not delete but extract class
May 20, 2022
b014be4
Refactor: extract constant value for more readable
BUYA-GH May 20, 2022
f3551bc
refactor: extract class `DebuggingPreferencesDataStore.java`
May 20, 2022
67c4626
Changed: Extract explaining variables
cyj893 May 20, 2022
5d7eeec
refactor: extract class `DebuggingPreferencesDataStore.java`
May 20, 2022
54490d1
refactor: extract class `DebuggingPreferencesDataStore.java`
May 20, 2022
a6903fc
Changed: Rename boolean variables
cyj893 May 20, 2022
aa03995
Update DebuggingPreferencesDataStore.java
May 20, 2022
0fb4273
refactor: extract method and change switch case to conditional operator
May 20, 2022
5a5d5e8
Refactor: extract boolean value for more readable
BUYA-GH May 20, 2022
3e615bc
refactor: extract method and change switch case to conditional operator
May 20, 2022
fcb1bcf
Update DebuggingPreferencesDataStore.java
May 20, 2022
caee324
Changed: Define class `Cursor`
cyj893 May 20, 2022
319719c
Changed: Extract method and Rename Variables in `setOrClearEffect()`
cyj893 May 20, 2022
b7591b0
Changed: Delete unnecessary variable `isNewCursorPlaced` in `updateOl…
cyj893 May 20, 2022
f800fe7
Fixed: Set order of the variables properly
cyj893 May 20, 2022
64b0f8a
Changed: Extract method in `updateOldState()`
cyj893 May 20, 2022
669e4f5
Refactor: Rename too long variable to shorter one in `TermuxTerminalV…
eyi-jin May 20, 2022
b171239
Merge pull request #4 from cyj893/refactor/TerminalBuffer2
cyj893 May 20, 2022
3104e3e
Refactor: Extract methods from `TermuxTerminalViewClient.java`
eyi-jin May 20, 2022
00d900f
Refactor: Extract methods from `TermuxTerminalViewClient.java`
eyi-jin May 20, 2022
a2941d2
Refactor: delete overloading function `sendPluginCommandErrorNotifica…
BUYA-GH May 20, 2022
5c7fac1
Refactor: Extract Variable from `TermuxTerminalViewClient.java`
eyi-jin May 20, 2022
c86e902
Merge branch 'master' of https://github.com/rubinstory/termux-app int…
eyi-jin May 20, 2022
6008d6f
Changed: Extract resizing methods to class in `ResizeBuffer`
cyj893 May 20, 2022
4d77ed6
Merge pull request #34 from taehoonkange/DebuggingPreferencesDataStore
rubinstory May 20, 2022
acb3859
Merge pull request #5 from cyj893/refactor/ResizeBuffer
cyj893 May 20, 2022
e27de12
Merge branch 'master' into refactor/DebuggingPreferencesDataStore
rubinstory May 20, 2022
e3892d4
Merge pull request #35 from taehoonkange/refactor/DebuggingPreference…
rubinstory May 20, 2022
a31aa7e
Merge branch 'master' into refactor/TerminalIOPreferencesFragment
rubinstory May 20, 2022
00664cc
Merge pull request #36 from taehoonkange/refactor/TerminalIOPreferenc…
rubinstory May 20, 2022
6e00576
Merge pull request #37 from taehoonkange/refactor/TerminalIOPreferenc…
rubinstory May 20, 2022
9149f3b
Merge pull request #39 from taehoonkange/refactor/TerminalViewPrefere…
rubinstory May 20, 2022
5176d62
Merge pull request #40 from taehoonkange/refactor/DebuggingPreference…
rubinstory May 20, 2022
60f05f8
Merge pull request #41 from taehoonkange/refactor/termux_float/Debugg…
rubinstory May 20, 2022
3e96a05
Merge pull request #42 from BUYA-GH/refactor/TextInputDialogUtils
rubinstory May 20, 2022
0fc534e
Merge pull request #43 from taehoonkange/refactor/terumx_tasker/Debug…
rubinstory May 20, 2022
369a7b7
Merge pull request #44 from taehoonkange/refactor/termux_widget/Debug…
rubinstory May 20, 2022
2b7eb00
Merge pull request #45 from taehoonkange/refactor/termux_widget/Debug…
rubinstory May 20, 2022
3be12f5
Merge pull request #46 from taehoonkange/refactor/termux_tasker/Debug…
rubinstory May 20, 2022
1008fa3
Merge pull request #47 from taehoonkange/refactor/termux_float/Debugg…
rubinstory May 20, 2022
c0cfd3c
Merge pull request #48 from BUYA-GH/refactor/TermuxNotificationUtils
rubinstory May 20, 2022
a838d25
Merge pull request #49 from taehoonkange/refactor/termux_api/Debuggin…
rubinstory May 20, 2022
a6880e1
Merge pull request #50 from cyj893/master
rubinstory May 20, 2022
33feb5e
Merge pull request #51 from eyi-jin/refactor/TermuxTerminalViewClient…
rubinstory May 20, 2022
12388ae
Fixed: Set order of the variables properly
cyj893 May 20, 2022
c085e44
Changed: Refactor `initExtraKeysInfo()` in `ExtraKeysInfo.java`
rubinstory May 20, 2022
7c0bc91
Added: Add `getLogVariableList()` at `LocalSocketRunConfig.java`
rubinstory May 20, 2022
872a8bb
Merge pull request #52 from rubinstory/refactor/ExtraKeysInfo.java
rubinstory May 20, 2022
07cdcb3
Merge pull request #53 from rubinstory/refactor/LocalSocketRunConfig.…
rubinstory May 20, 2022
dadb69c
Docs: Add Comments at `getLogVariableList()` in
rubinstory May 20, 2022
aa173f0
Changed: Extract class `BufferStyler`
cyj893 May 20, 2022
43b5dfc
Added: Add `getLogVariableList()` at `LocalClientSocket.java`
rubinstory May 20, 2022
a6aa010
Changed: Delete `localVariableList` in `getLogString()` and
rubinstory May 20, 2022
054171a
Merge pull request #54 from rubinstory/refactor/LocalCientSocket.java
rubinstory May 20, 2022
4b3fb6c
Merge branch 'master' into refactor/LocalSocketRunConfig.java
rubinstory May 20, 2022
45c0ac6
Merge pull request #55 from rubinstory/refactor/LocalSocketRunConfig.…
rubinstory May 20, 2022
cc5d934
Added: Add `getLogVariableList()` at `ReportInfo.java`
rubinstory May 20, 2022
bb9fbd9
Merge pull request #56 from rubinstory/refactor/ReportInfo.java
rubinstory May 20, 2022
434ebe9
Merge pull request #6 from cyj893/refactor/TerminalBuffer3
cyj893 May 20, 2022
4f7a056
Refactor: extract boolean method
BUYA-GH May 20, 2022
5f581ca
Changed: Extract methods in `updateWith()` and handle exception
cyj893 May 20, 2022
6310063
Refactor: make function `isSharedPreferenceNull()` for extract duplic…
BUYA-GH May 20, 2022
fdc0389
Merge pull request #57 from BUYA-GH/refactor/ReflectionUtils
rubinstory May 21, 2022
60145c9
Merge pull request #58 from BUYA-GH/refactor/SharedPreferenceUtils
rubinstory May 21, 2022
b19f59f
Refactor: implement MVC model on TextSelectionCursorController
BUYA-GH May 21, 2022
8fc2d21
Refactor: rename `TextSelectionModel` to `TextSelectionCursorModel`
BUYA-GH May 21, 2022
82a568e
Refactor: remove dependency between model and view
BUYA-GH May 21, 2022
fca8f61
Merge pull request #7 from cyj893/refactor/TerminalColorScheme
cyj893 May 21, 2022
f9f1ecf
Changed: Reduce parameters in `parseRGB()`
cyj893 May 21, 2022
3f0a05e
Refactor: Extract methods from `TermuxSessionsListViewController.java`
eyi-jin May 22, 2022
60fb107
Merge branch 'master' of https://github.com/rubinstory/termux-app int…
eyi-jin May 22, 2022
3fa2c87
Refactor: Move position of variable,log from `TermuxActivityRootView.…
eyi-jin May 22, 2022
654cf61
Refactor: Extract methods from `TermuxActivityRootView.java`
eyi-jin May 22, 2022
477e9c7
Merge pull request #59 from BUYA-GH/refactor/terminal-view
rubinstory May 22, 2022
c9820c1
Merge pull request #60 from cyj893/master
rubinstory May 22, 2022
6e25078
Merge pull request #61 from eyi-jin/refactor/TermuxSessionsListViewCo…
rubinstory May 22, 2022
bb4c484
Added: Add `getResultPendingIntentVariableList()` and `getDirectoryVa…
rubinstory May 22, 2022
361d2b4
Merge pull request #62 from rubinstory/refactor/ResultConfig.java
rubinstory May 22, 2022
79cce85
Refactor: Extract methods, variable from `TermuxActivityRootView.java`
eyi-jin May 22, 2022
81f8509
Refactor: Rename variable from `TermuxActivityRootView.java`
eyi-jin May 22, 2022
3cf4717
Refactor: Seperate Logic and Inline Method from `TermuxActivityRootVi…
eyi-jin May 22, 2022
254a634
Merge branch 'master' of https://github.com/rubinstory/termux-app int…
eyi-jin May 22, 2022
4fc47b9
Merge pull request #63 from eyi-jin/refactor/TermuxActivityRootView.java
rubinstory May 22, 2022
ed22191
Added: Add `getLogVariableList()` in `PeerCred.java`
rubinstory May 22, 2022
2f1cfc6
Changed: Refactor `getLogString()` with `for-loop`
rubinstory May 22, 2022
0571ce6
Changed: Refactor `getMarkDownString()` with `for-loop`
rubinstory May 22, 2022
d9d7aa4
Merge pull request #64 from rubinstory/refactor/PeerCred.java
rubinstory May 22, 2022
1677e24
Changed: Add explaining variables to `getLogString()` and
rubinstory May 22, 2022
88693de
Refactor: Replace Magic Number with Symbolic Constant from `RunComman…
eyi-jin May 22, 2022
b61240d
Refactor: Extract methods from `RunCommandService.java`
eyi-jin May 22, 2022
0522a27
Merge branch 'master' of https://github.com/rubinstory/termux-app int…
eyi-jin May 22, 2022
7d2d73e
Merge pull request #65 from eyi-jin/refactor/RunCommandService.java
rubinstory May 22, 2022
973ee62
Added: Add `ErrnoBuilder` for `Errno.java`
rubinstory May 23, 2022
2549146
Merge pull request #66 from rubinstory/pattern/Errno.java
rubinstory May 23, 2022
77280fc
Revert "Added: Add `ErrnoBuilder` for `Errno.java`"
rubinstory May 25, 2022
38f5f39
Merge pull request #67 from rubinstory/revert-66-pattern/Errno.java
rubinstory May 25, 2022
54763d1
Added: Add ErrorBuilder for Error.java
rubinstory May 25, 2022
67ee159
Merge pull request #68 from rubinstory/pattern/Error.java
rubinstory May 25, 2022
43d2a6d
Changed: Apply State pattern with EscapeState
cyj893 May 25, 2022
1a65a92
Changed: Moving functions into each EscapeState
cyj893 May 25, 2022
559e485
Added: Add `configureTermuxPreference.java` for `RootPreferencesFragm…
May 26, 2022
786501a
Merge pull request #8 from cyj893/pattern/TerminalEmulator
cyj893 May 26, 2022
d2112d3
Added: extract class `configureTermuxAPIPreference()`
May 26, 2022
0bb9652
Merge pull request #69 from taehoonkange/pattern/RootPreferencesFragm…
rubinstory May 26, 2022
27b5674
Merge pull request #70 from cyj893/master
rubinstory May 26, 2022
62a06e4
Merge pull request #71 from taehoonkange/pattern/configureTermuxAPIPr…
rubinstory May 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Termux application

Git Test for Jeon SeungYoon

[![Build status](https://github.com/termux/termux-app/workflows/Build/badge.svg)](https://github.com/termux/termux-app/actions)
[![Testing status](https://github.com/termux/termux-app/workflows/Unit%20tests/badge.svg)](https://github.com/termux/termux-app/actions)
[![Join the chat at https://gitter.im/termux/termux](https://badges.gitter.im/termux/termux.svg)](https://gitter.im/termux/termux)
Expand Down
272 changes: 170 additions & 102 deletions app/src/main/java/com/termux/app/RunCommandService.java

Large diffs are not rendered by default.

79 changes: 40 additions & 39 deletions app/src/main/java/com/termux/app/TermuxInstaller.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ static void setupBootstrapIfNeeded(final Activity activity, final Runnable whenD
if (FileUtils.directoryFileExists(TERMUX_PREFIX_DIR_PATH, true)) {
File[] PREFIX_FILE_LIST = TERMUX_PREFIX_DIR.listFiles();
// If prefix directory is empty or only contains the tmp directory
if(PREFIX_FILE_LIST == null || PREFIX_FILE_LIST.length == 0 || (PREFIX_FILE_LIST.length == 1 && TermuxConstants.TERMUX_TMP_PREFIX_DIR_PATH.equals(PREFIX_FILE_LIST[0].getAbsolutePath()))) {
boolean hasEmptyPrefixDirectory = PREFIX_FILE_LIST == null || PREFIX_FILE_LIST.length == 0;
boolean hasTmpDirectoryOnly = PREFIX_FILE_LIST.length == 1 && TermuxConstants.TERMUX_TMP_PREFIX_DIR_PATH.equals(PREFIX_FILE_LIST[0].getAbsolutePath());

if(hasEmptyPrefixDirectory || hasTmpDirectoryOnly) {
Logger.logInfo(LOG_TAG, "The termux prefix directory \"" + TERMUX_PREFIX_DIR_PATH + "\" exists but is empty or only contains the tmp directory.");
} else {
whenDone.run();
Expand All @@ -110,38 +113,12 @@ static void setupBootstrapIfNeeded(final Activity activity, final Runnable whenD
new Thread() {
@Override
public void run() {
try {
Logger.logInfo(LOG_TAG, "Installing " + TermuxConstants.TERMUX_APP_NAME + " bootstrap packages.");

Error error;

// Delete prefix staging directory or any file at its destination
error = FileUtils.deleteFile("termux prefix staging directory", TERMUX_STAGING_PREFIX_DIR_PATH, true);
if (error != null) {
showBootstrapErrorDialog(activity, whenDone, Error.getErrorMarkdownString(error));
return;
}

// Delete prefix directory or any file at its destination
error = FileUtils.deleteFile("termux prefix directory", TERMUX_PREFIX_DIR_PATH, true);
if (error != null) {
showBootstrapErrorDialog(activity, whenDone, Error.getErrorMarkdownString(error));
return;
}
try {Error error;

// Create prefix staging directory if it does not already exist and set required permissions
error = TermuxFileUtils.isTermuxPrefixStagingDirectoryAccessible(true, true);
if (error != null) {
showBootstrapErrorDialog(activity, whenDone, Error.getErrorMarkdownString(error));
return;
}
if (hasPrefixError(activity, whenDone)) return;
Logger.logInfo(LOG_TAG, "Installing " + TermuxConstants.TERMUX_APP_NAME + " bootstrap packages.");

// Create prefix directory if it does not already exist and set required permissions
error = TermuxFileUtils.isTermuxPrefixDirectoryAccessible(true, true);
if (error != null) {
showBootstrapErrorDialog(activity, whenDone, Error.getErrorMarkdownString(error));
return;
}


Logger.logInfo(LOG_TAG, "Extracting bootstrap zip to prefix staging directory \"" + TERMUX_STAGING_PREFIX_DIR_PATH + "\".");

Expand All @@ -164,21 +141,15 @@ public void run() {
symlinks.add(Pair.create(oldPath, newPath));

error = ensureDirectoryExists(new File(newPath).getParentFile());
if (error != null) {
showBootstrapErrorDialog(activity, whenDone, Error.getErrorMarkdownString(error));
return;
}
if (hasBootstrapError(error, activity, whenDone)) return;
}
} else {
String zipEntryName = zipEntry.getName();
File targetFile = new File(TERMUX_STAGING_PREFIX_DIR_PATH, zipEntryName);
boolean isDirectory = zipEntry.isDirectory();

error = ensureDirectoryExists(isDirectory ? targetFile : targetFile.getParentFile());
if (error != null) {
showBootstrapErrorDialog(activity, whenDone, Error.getErrorMarkdownString(error));
return;
}
if (hasBootstrapError(error, activity, whenDone)) return;

if (!isDirectory) {
try (FileOutputStream outStream = new FileOutputStream(targetFile)) {
Expand Down Expand Up @@ -227,6 +198,36 @@ public void run() {
}.start();
}



private static boolean hasPrefixError(Activity activity, Runnable whenDone) {
Error error;
// Delete prefix staging directory or any file at its destination
error = FileUtils.deleteFile("termux prefix staging directory", TERMUX_STAGING_PREFIX_DIR_PATH, true);
if (hasBootstrapError(error, activity, whenDone)) return true;

// Delete prefix directory or any file at its destination
error = FileUtils.deleteFile("termux prefix directory", TERMUX_PREFIX_DIR_PATH, true);
if (hasBootstrapError(error, activity, whenDone)) return true;

// Create prefix staging directory if it does not already exist and set required permissions
error = TermuxFileUtils.isTermuxPrefixStagingDirectoryAccessible(true, true);
if (hasBootstrapError(error, activity, whenDone)) return true;

// Create prefix directory if it does not already exist and set required permissions
error = TermuxFileUtils.isTermuxPrefixDirectoryAccessible(true, true);
if (hasBootstrapError(error, activity, whenDone)) return true;
return false;
}

private static boolean hasBootstrapError(Error error, Activity activity, Runnable whenDone) {
if (error != null) {
showBootstrapErrorDialog(activity, whenDone, Error.getErrorMarkdownString(error));
return true;
}
return false;
}

public static void showBootstrapErrorDialog(Activity activity, Runnable whenDone, String message) {
Logger.logErrorExtended(LOG_TAG, "Bootstrap Error:\n" + message);

Expand Down
121 changes: 82 additions & 39 deletions app/src/main/java/com/termux/app/TermuxService.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,20 @@ public int onStartCommand(Intent intent, int flags, int startId) {
// Run again in case service is already started and onCreate() is not called
runStartForeground();

String action = null;
if (intent != null) {
Logger.logVerboseExtended(LOG_TAG, "Intent Received:\n" + IntentUtils.getIntentString(intent));
action = intent.getAction();
}
String chooseAction = null;

chooseAction = getAction(intent, chooseAction);
ExecuteAction(intent, chooseAction);

// If this service really do get killed, there is no point restarting it automatically - let the user do on next
// start of {@link Term):
return Service.START_NOT_STICKY;
}

if (action != null) {
switch (action) {
private void ExecuteAction(Intent intent, String chooseAction) {
boolean isAction = chooseAction != null;
if (isAction) {
switch (chooseAction) {
case TERMUX_SERVICE.ACTION_STOP_SERVICE:
Logger.logDebug(LOG_TAG, "ACTION_STOP_SERVICE intent received");
actionStopService();
Expand All @@ -162,24 +168,33 @@ public int onStartCommand(Intent intent, int flags, int startId) {
actionServiceExecute(intent);
break;
default:
Logger.logError(LOG_TAG, "Invalid action: \"" + action + "\"");

Logger.logError(LOG_TAG, "Invalid action: \"" + chooseAction + "\"");
break;
}
}
}

// If this service really do get killed, there is no point restarting it automatically - let the user do on next
// start of {@link Term):
return Service.START_NOT_STICKY;
private String getAction(Intent intent, String chooseAction) {
boolean isIntent = intent != null;
if (isIntent) {
String getActionMessage = "Intent Received:\n" + IntentUtils.getIntentString(intent);
Logger.logVerboseExtended(LOG_TAG, getActionMessage);
chooseAction = intent.getAction();
}
return chooseAction;
}

@Override
public void onDestroy() {
boolean isStop = !mWantsToStop;
Logger.logVerbose(LOG_TAG, "onDestroy");

TermuxShellUtils.clearTermuxTMPDIR(true);

actionReleaseWakeLock(false);
if (!mWantsToStop)

if (isStop)
killAllTermuxExecutionCommands();
runStopForeground();
}
Expand Down Expand Up @@ -262,25 +277,19 @@ private void actionStopService() {
*
* We make copies of each list since items are removed inside the loop.
*/

// Need to apply Design Pattern
private synchronized void killAllTermuxExecutionCommands() {
boolean processResult;

Logger.logDebug(LOG_TAG, "Killing TermuxSessions=" + mTermuxSessions.size() + ", TermuxTasks=" + mTermuxTasks.size() + ", PendingPluginExecutionCommands=" + mPendingPluginExecutionCommands.size());

List<TermuxSession> termuxSessions = new ArrayList<>(mTermuxSessions);
for (int i = 0; i < termuxSessions.size(); i++) {
ExecutionCommand executionCommand = termuxSessions.get(i).getExecutionCommand();
processResult = mWantsToStop || executionCommand.isPluginExecutionCommandWithPendingResult();
termuxSessions.get(i).killIfExecuting(this, processResult);
}

List<AppShell> termuxTasks = new ArrayList<>(mTermuxTasks);
for (int i = 0; i < termuxTasks.size(); i++) {
ExecutionCommand executionCommand = termuxTasks.get(i).getExecutionCommand();
if (executionCommand.isPluginExecutionCommandWithPendingResult())
termuxTasks.get(i).killIfExecuting(this, true);
}
killTerumxSessions();
killtermuxTasks();
killpendingPluginExecutionCommands();
}

private void killpendingPluginExecutionCommands() {
List<ExecutionCommand> pendingPluginExecutionCommands = new ArrayList<>(mPendingPluginExecutionCommands);
for (int i = 0; i < pendingPluginExecutionCommands.size(); i++) {
ExecutionCommand executionCommand = pendingPluginExecutionCommands.get(i);
Expand All @@ -292,8 +301,27 @@ private synchronized void killAllTermuxExecutionCommands() {
}
}

private void killtermuxTasks() {
List<AppShell> termuxTasks = new ArrayList<>(mTermuxTasks);
for (int i = 0; i < termuxTasks.size(); i++) {
ExecutionCommand executionCommand = termuxTasks.get(i).getExecutionCommand();
if (executionCommand.isPluginExecutionCommandWithPendingResult())
termuxTasks.get(i).killIfExecuting(this, true);
}
}

private void killTerumxSessions() {
boolean processResult;
List<TermuxSession> termuxSessions = new ArrayList<>(mTermuxSessions);
for (int i = 0; i < termuxSessions.size(); i++) {
ExecutionCommand executionCommand = termuxSessions.get(i).getExecutionCommand();
processResult = mWantsToStop || executionCommand.isPluginExecutionCommandWithPendingResult();
termuxSessions.get(i).killIfExecuting(this, processResult);
}
}


//Need to apply Design Pattern
/** Process action to acquire Power and Wi-Fi WakeLocks. */
@SuppressLint({"WakelockTimeout", "BatteryLife"})
private void actionAcquireWakeLock() {
Expand All @@ -304,14 +332,10 @@ private void actionAcquireWakeLock() {

Logger.logDebug(LOG_TAG, "Acquiring WakeLocks");

PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TermuxConstants.TERMUX_APP_NAME.toLowerCase() + ":service-wakelock");
mWakeLock.acquire();
powerMangerAcquireWakeLock();

// http://tools.android.com/tech-docs/lint-in-studio-2-3#TOC-WifiManager-Leak
WifiManager wm = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
mWifiLock = wm.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, TermuxConstants.TERMUX_APP_NAME.toLowerCase());
mWifiLock.acquire();
wifiMangerAcquireWakeLock();

if (!PermissionUtils.checkIfBatteryOptimizationsDisabled(this)) {
PermissionUtils.requestDisableBatteryOptimizations(this);
Expand All @@ -323,6 +347,18 @@ private void actionAcquireWakeLock() {

}

private void powerMangerAcquireWakeLock() {
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TermuxConstants.TERMUX_APP_NAME.toLowerCase() + ":service-wakelock");
mWakeLock.acquire();
}

private void wifiMangerAcquireWakeLock() {
WifiManager wm = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
mWifiLock = wm.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, TermuxConstants.TERMUX_APP_NAME.toLowerCase());
mWifiLock.acquire();
}

/** Process action to release Power and Wi-Fi WakeLocks. */
private void actionReleaseWakeLock(boolean updateNotification) {
if (mWakeLock == null && mWifiLock == null) {
Expand All @@ -332,6 +368,15 @@ private void actionReleaseWakeLock(boolean updateNotification) {

Logger.logDebug(LOG_TAG, "Releasing WakeLocks");

releaseWakeLockAndWifiLock();

if (updateNotification)
updateNotification();

Logger.logDebug(LOG_TAG, "WakeLocks released successfully");
}

private void releaseWakeLockAndWifiLock() {
if (mWakeLock != null) {
mWakeLock.release();
mWakeLock = null;
Expand All @@ -341,11 +386,6 @@ private void actionReleaseWakeLock(boolean updateNotification) {
mWifiLock.release();
mWifiLock = null;
}

if (updateNotification)
updateNotification();

Logger.logDebug(LOG_TAG, "WakeLocks released successfully");
}

/** Process {@link TERMUX_SERVICE#ACTION_SERVICE_EXECUTE} intent to execute a shell command in
Expand Down Expand Up @@ -618,20 +658,23 @@ public synchronized int removeTermuxSession(TerminalSession sessionToRemove) {
/** Callback received when a {@link TermuxSession} finishes. */
@Override
public void onTermuxSessionExited(final TermuxSession termuxSession) {
if (termuxSession != null) {
boolean isTermuxSession = termuxSession != null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These and all the other if conditions extracted to boolean are useless and server no purpose, using an if condition already implies that one or more conditions will be supplied in it. Do not do this. If there are multiple conditions that are too complex, they can be split on multiple lines, in some case extraction to boolean is indeed fine.

if (isTermuxSession) {
ExecutionCommand executionCommand = termuxSession.getExecutionCommand();

Logger.logVerbose(LOG_TAG, "The onTermuxSessionExited() callback called for \"" + executionCommand.getCommandIdAndLabelLogString() + "\" TermuxSession command");

// If the execution command was started for a plugin, then process the results
if (executionCommand != null && executionCommand.isPluginExecutionCommand)
boolean isExecutionCommand = executionCommand != null;
if (isExecutionCommand && executionCommand.isPluginExecutionCommand)
TermuxPluginUtils.processPluginExecutionCommandResult(this, LOG_TAG, executionCommand);

mTermuxSessions.remove(termuxSession);

// Notify {@link TermuxSessionsListViewController} that sessions list has been updated if
// activity in is foreground
if (mTermuxTerminalSessionClient != null)
boolean isTermuxTerminalSessionClient = mTermuxTerminalSessionClient != null;
if (isTermuxTerminalSessionClient)
mTermuxTerminalSessionClient.termuxSessionListNotifyUpdated();
}

Expand Down
Loading