Android : Github 在 Android Studio 中使用的库

Android : Github library using in Android Studio

在我的应用程序中,我想使用 github 库:-https://github.com/greenfrvr/hashtag-view

我知道一种使用方法是在 gradle 文件中添加依赖项:-

dependencies {
compile 'com.github.greenfrvr:hashtag-view:1.2.1'
}

这样我就可以使用库了,但是我想对库代码做一些修改,根据我的使用情况进行修改。

所以我的问题是:-

  1. 根据我的使用修改github库代码是否合法;
  2. 如果是那么如何在android studio
  3. 中修改库代码

这个github库许可文档说---

The MIT License (MIT)

Copyright (c) 2015 greenfrvr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Is it legal to modify github library code according to my use;

是的,只要您符合许可协议并提供原作者的正确署名。

If yes then how to modify library code in android studio

如果将其添加为依赖项,则无法修改原始库。要修改,您可以执行以下操作之一:

  • 分叉存储库并根据需要修改代码并在您的应用程序中使用
  • 从原始存储库下载代码,在本地修改并在您的代码中使用。