是否可以在 Android 上开发自定义 API?如果是这样,如何? [英] Is it possible to develop a custom API on Android? If so, how?

查看:22
本文介绍了是否可以在 Android 上开发自定义 API?如果是这样,如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于 Android 是开源的,我正在考虑在其上开发自定义 API,主要用于实现 Web 门户登录模块.

Since Android is open-source, I am considering developing a custom API on it, mainly for implementing a web portal login module.

基本功能应包括:

  • 获取无线客户端的 MAC 地址;
  • 重定向他们的 HTTP 请求;
  • 基于 MAC 地址的端口/DNS 过滤/阻止;
  • 并且,将所有这些函数包装到一个自定义 API 中,以便它可以提供给潜在客户.

是否可以在 Android 上开发这样的自定义 API?如果是这样,如何?

Is it possible to develop such a custom API on Android? If so, how?

欢迎任何合理的评论.谢谢.

Any reasonable comments are welcome. Thank you.

推荐答案

您的某些目标至少需要 root 访问权限,或者某种用户交互才能进行设置.

Some of your goals would require root access at the very least, or some kind of user interaction for set up.

总而言之,这是可能的.您最终必须编写自己的应用来读取相关数据,使用 root 修改 IP 表,并让用户设置代理服务来拦截 HTTP 流量.

All in all, it is possible. You'd have to end up writing your own app that reads the relevant data, uses root to modify IP Tables, and has the user set up a proxy service to intercept HTTP traffic.

完成此设置后,您可以通过自己的应用程序将其公开给第三方.

Once you have this set up, you can expose it via your own application to third parties.

如果您打算在没有用户交互的情况下执行此操作,或者需要在设备上安装另一个应用程序,则必须在源代码中执行此操作,并为要在其上运行的每台设备重建 Android 映像,并且需要任何潜在用户在使用之前将您的 Android ROM 映像刷入他们的设备.

If you plan on doing this without user interaction, or needing another app installed on the device, you will have to do it in source code and rebuild the Android image for every device you want to run it on, and will require any potential users to flash your Android ROM image onto their device before using it.

这篇关于是否可以在 Android 上开发自定义 API?如果是这样,如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆