You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor: Improve ShellTool, Helper classes, and other components
- ShellTool:
- Change to singleton mode and optimize logic.
- Throw an exception when the stream is dead or an error occurs during initialization.
- Add `setRoot`, `setShellCommands`, `setExecListener`, `setCommandListener`, `isActive`, `close` static methods.
- Deprecate `addExecListener`, `removeExecListener`, `clearExecListener`, and `setCommandListener` instance methods.
- Change `Builder` to `private`.
- Fix potential `NullPointerException` and `IndexOutOfBoundsException`.
- Helper Classes (ClassHelper, MethodHelper, ConstructorHelper, FieldHelper):
- Standardize method names:
- `withParamTypes` to `withParamClasses`
- `withReturnType` to `withReturnClass`
- `withFieldType` to `withFieldClass`
- `withAnnotation` to `withAnnotations`
- `withGenericParamTypes` to `withGenericParamClasses` (Removed)
- `withExceptionTypes` to `withExceptionClasses`
- `list` to `toArray`
- ClassHelper:
- Remove `includeAndroidClasses` method.
- Add `withFieldClasses` method.
- FieldHelper and ConstructorHelper:
- Add support for multiple annotations.
- MethodHelper and ConstructorHelper:
- Remove `withParamCount` method, use `withParamCountVar` instead.
- DeviceTool:
- Add `getXiaomiVersion`, `getXiaomiMarketName`, `getColorOSVersion`, `getColorOSMarketName` methods.
- Rename `ROM_XXX` to `DEVICE_XXX`.
- Correct `isColorOS` logic and update related version properties.
- HCState:
- Change fields to methods to prevent Proguard optimization issues.
- HCEntrance:
- Modify `initHCState` to use method hooking instead of reflection to set values in `HCState`.
- IPrefsApply:
- Add `registerOnSharedPreferenceChangeListener` and `unregisterOnSharedPreferenceChangeListener` methods.
- PrefsTool:
- Implement `registerOnSharedPreferenceChangeListener` and `unregisterOnSharedPreferenceChangeListener` for both `XPrefs` and `SPrefs`.
- XPrefs: Change `reload` to always reload, respecting `HCData.isAutoReload()`.
- PackageTool:
- Use `ApplicationInfo` instead of `PackageInfo` in `getTargetAppData` for broader compatibility.
- Change `createAppData` to public.
- CoreTool:
- Remove unused `invokeOriginalMethod` overloads.
- ParamTool:
- Add `@NonNull` to `getArgNonNull` method.
- Other:
- Remove `ToolTest.java`.
- Update project version to v.2.2.3.