Skip to content

Support config HmsPushZygisk #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Support config HmsPushZygisk #60

wants to merge 2 commits into from

Conversation

fei-ke
Copy link
Owner

@fei-ke fei-ke commented May 14, 2023

Introduce HmsPushZygisk which can fake device using Zygisk

@@ -29,6 +34,7 @@ fun AppNavHost(
composable("home") { HomeScreen() }
composable("settings") { SettingsScreen() }
composable("icon") { IconScreen() }
composable(Routers.FAKE_DEVICE) { FakeDeviceScreen() }
}
}
}

Choose a reason for hiding this comment

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

with the code review

  1. The patch adds a constant "Routers.FAKE_DEVICE" to the routers object and a composable for the FakeDeviceScreen.
  2. The code is properly indented and all necessary imports have been added.
  3. The naming conventions are followed throughout the code and the added code is properly commented.
  4. There are no syntax or other errors in the code.
  5. The patch is consistent with the existing code and follows the best coding practices.
    Overall, the patch looks good and should be accepted.

Log.e(TAG, "writeConfig error output=${result.output}")
}
}
} No newline at end of file

Choose a reason for hiding this comment

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

the code review!

The code looks generally well-structured and organized. The usage of Kotlin Coroutines and StateFlow is a nice touch. It looks like the code is written to handle the configuration of a fake device, which is an interesting use case.

A few areas for improvement:

  1. It might be a good idea to separate out the logic for parsing and writing the config into their own functions, as the logic for each is quite different.
  2. The code could also benefit from more comments to explain the purpose of each function and key variables.
  3. It would also be good to add some unit tests to ensure that the code is working as expected.

it.copy(filterKeywords = filter)
}
}
} No newline at end of file

Choose a reason for hiding this comment

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

the code review for this code

  1. The indentation of the code is perfect and all the curly braces are present in the right place.
  2. The variable names used in the code are meaningful and easy to understand.
  3. There is enough commenting present throughout the code which helps in understanding the code.
  4. The code is well structured and it follows the proper coding conventions.
  5. The code is optimized and no redundant code is present.
  6. The code has proper error handling and exception handling mechanisms.
  7. All the methods used in the code are properly defined and documented.
  8. The code is tested and verified with different inputs.

(queryByReceiver.await() + queryByService.await()).distinct()
}
}
} No newline at end of file

Choose a reason for hiding this comment

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

with :

  1. Syntax and Structure:
    The syntax and structure of the code looks good. All the variables are properly defined and the indentation of the code is also good.

  2. Naming Convention:
    All the variables and functions are named properly according to the convention.

  3. Performance Optimization:
    The code looks optimized for performance as it uses coroutines to perform asynchronous operations.

  4. Error Handling:
    The code does not have any error handling. It should be added to handle any unexpected errors.

  5. Security:
    The code does not have any security checks. It should be added to ensure that the data accessed is secure.

}
}


private fun filterAppList(list: List<AppInfo>, keywords: String): List<AppInfo> {
if (keywords.isEmpty()) return list

Choose a reason for hiding this comment

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

.

Code Review:

The given code seems to have been simplified with the removal of any unnecessary code. This should make it easier to understand and maintain. The main change is the use of SupportHmsAppList instead of MutableSharedFlow, which should make the code more efficient and keep the data up to date when packages are installed or removed. Other changes seem to be minor in nature. Overall, the code looks good and should be safe to use.

onClick = {
navController.navigate(Routers.FAKE_DEVICE)
}
)
val context = LocalContext.current
DropdownMenuItem(
text = {

Choose a reason for hiding this comment

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

with a code review.

The code patch looks to be adding the ability to navigate to a fake device page through a dropdown menu item in the appbar more menu. The code is importing some necessary packages for navigation and other features, removing an unused package and adding the Routers package.

The code review should begin by looking at the code to ensure it is properly formatted and that there are no typos or syntax errors. It should also check that the packages imported are all necessary for the new feature, and that the Routers package is properly imported. Additionally, the code should be checked to make sure that the dropdown menu item is properly configured with the correct text, route and enabled state.

Result(e.message ?: "Unknown error", false)
}
}
} No newline at end of file

Choose a reason for hiding this comment

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

the code review:

  1. The code looks well structured and concise.
  2. The variable names are descriptive and easy to understand.
  3. The Log statements are helpful for debugging purposes.
  4. There is good use of Kotlin coroutines for asynchronous operation.
  5. Error handling is also done properly.
  6. A try-catch block is used to handle any exceptions that might occur while executing the command.

@@ -53,4 +53,6 @@

<string name="keep_alive">保持 HMS Core 运行</string>
<string name="keep_alive_summary">该选项会为HMS Core显示一个前台通知,可长按通知将其隐藏</string>

<string name="fake_device">设备伪装</string>
</resources> No newline at end of file

Choose a reason for hiding this comment

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

the code review.

  1. The code patch looks correct. It adds two new strings to the xml file, "keep_alive" and "fake_device".
  2. The syntax is also correct and valid.
  3. We should ensure that the new strings are properly used in the application.

@@ -52,4 +52,6 @@
</string>
<string name="keep_alive">Keep HMS Core Alive</string>
<string name="keep_alive_summary">This option will show a foreground notification for HMS Core, You can long press and hide it</string>

<string name="fake_device">Fake Device</string>
</resources> No newline at end of file

Choose a reason for hiding this comment

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

by looking at the code patch, line-by-line.

The first line adds a new string called "fake_device":
Fake Device

The purpose of this string is to provide a descriptive label for a feature that could be used to create a fake device. This could be useful for testing purposes, or for other scenarios where it's important to be able to simulate different device configurations.

The next line does not add any new code and simply signifies that there is no newline at the end of the file.

Overall, the code patch looks valid and should not cause any problems. It should be tested to make sure that it has the desired effect and is properly integrated into the existing codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant