简体   繁体   English

将现有的android应用导出为aar(例如库)

[英]Export existing android app as aar (like a library)

Background : I have an android application that has been published in GooglePlay and I want to create SDK from that existing application so that others can use it as a library inside their apps. 背景 :我有一个已在GooglePlay中发布的android应用程序,我想从该现有应用程序创建SDK,以便其他人可以将其用作其应用程序内的库。

So far: I was able to generate .ARR file from the existing app source code with little tweaks. 到目前为止:我已经能够通过少量调整从现有应用程序源代码生成.ARR文件。 and it is working pretty good. 而且效果很好。

The problem : is I have some sensitive information stored inside my app since I made .arr file from my app codebase I'm little worried that they can easily get access to my SharedPreferenceManager (util class of mine to deal with SharedPreference) DataBaseManager so on and they can subclass library class and tweak the behaviors 问题 :自从我的应用程序代码库制作了.arr文件以来,我的应用程序内部存储了一些敏感信息,我担心它们可以轻松访问我的SharedPreferenceManager (我的util类来处理SharedPreference) DataBaseManager等等。他们可以继承库类并调整行为

So How can I avoid library users not to misuse my library to exploit my existing app? 那么,如何避免图书馆用户不滥用图书馆来利用我现有的应用程序呢? is there any other way to export my app as a library? 还有其他方法可以将我的应用程序导出为库吗?

The basic process would be as follows: 基本过程如下:

  1. Figure out what you want to expose in your SDK 找出要在SDK中公开的内容
  2. Move all of this into an android library module 将所有这些移动到android library模块中
  3. Deploy the AAR 部署AAR

Can you explain a little more what you mean by "I'm little worried that they can easily get access to my SharedPreferenceManager (util class of mine to deal with SharedPreference) DataBaseManager so on and they can subclass library class and tweak the behaviors" ? 您能否解释一下“我不担心他们可以轻松访问我的SharedPreferenceManager(我的util类来处理SharedPreference)DataBaseManager等,并且他们可以对库类进行子类化和调整行为”的意思是什么?

You can always utilize obfuscation techniques and finalize classes to make it difficult. 您总是可以利用混淆技术和完成类来使其变得困难。 I don't think you can guarantee absolutely no misuse, but I am not sure how this would effect your application. 我认为您不能保证绝对不会滥用,但是我不确定这将如何影响您的应用程序。 If you have a server, for instance, then you would still control the software there and be able to sanitize and sort through the input. 例如,如果您有一台服务器,那么您仍然可以控制该服务器上的软件,并且可以对输入内容进行清理和分类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM