Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
com.github.akhasoft:yakhont-support
Advanced tools
The high-level Android components for data loading, location, lifecycle callbacks and many more
Яхонт делает невозможное | Yakhont - break limits now |
Yakhont is an Android high-level library offering developer-defined callbacks, loader wrappers, fully automatic cache, location-awareness, dynamic permissions handling, lifecycle debug classes, advanced logging and many more helpful developer-oriented issues.
Now you can load data in just one line of code (please refer to the simplified demo for working example):
new Retrofit2CoreLoadBuilder<>(/* your parameters */).create().startLoading();
And take location in just a couple of lines (the working example is in the simplified demo too):
@CallbacksInherited(LocationCallbacks.class)
public class YourActivity extends Activity implements LocationListener {
@Override
public void onLocationChanged(Location location, Date date) {
// your code here
}
}
Yakhont extends the Application.ActivityLifecycleCallbacks approach to support your own callbacks creation, that allows to customize handling of almost every lifecycle state of your Activities and Fragments - and even without changing their sources (especially useful for libraries developers).
The powerful loader wrappers, which (in simplest, but very typical case) allows loading data in one line of code, are abstracting you away from things like loaders management, data binding and caching, progress dialogs (fully customizable), errors handling and low-level threading; don't miss the swipe refresh and both Rx and Rx2 support too.
In short, the data loaders features are:
In addition, there are the location features which includes:
So, the features Yakhont provides are:
All Activities and Fragments are supported: it's not necessary to derive them from any predefined ones (with one exception - you will need it for lifecycle debug).
The Yakhont AAR is about 320 KB (except the full version, which is about 530 KB).
Yakhont supports Android 2.3 (API level 9) and above (core version requires Android 3.0 (API level 11) as a minimum).
Note: Location API requires Android 4.0 (API level 14); please visit Android Developers Blog for more information.
Demo applications are available for download from the latest release.
Add the following to your build.gradle (you can use build.gradle files from demo and simplified demo as working examples).
buildscript {
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'akha.yakhont.weaver:yakhont-weaver:0.9.19'
classpath 'org.javassist:javassist:3.20.0-GA'
}
}
apply plugin: 'com.neenbedankt.android-apt'
dependencies {
compile 'com.google.dagger:dagger:2.10'
apt 'com.google.dagger:dagger-compiler:2.10'
provided 'javax.annotation:jsr250-api:1.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.github.akhasoft:yakhont:0.9.19'
}
If you're using location API, add the line below:
dependencies {
compile 'com.google.android.gms:play-services-location:11.0.4'
}
And for the Retrofit2 the following lines are required:
dependencies {
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
}
android.variantFilter { variant ->
if (variant.buildType.name == 'debug') {
variant.setIgnore(true);
}
}
String[] weaverConfigFiles = null
boolean weaverDebug = false, weaverAddConfig = true
android.registerTransform(new akha.yakhont.weaver.WeaverTransform(weaverDebug, android.defaultConfig.applicationId,
android.bootClasspath.join(File.pathSeparator), weaverConfigFiles, weaverAddConfig))
Or (to avoid using the Transform API) you can try the following:
String[] weaverConfigFiles = null
boolean weaverDebug = false, weaverAddConfig = true
android.applicationVariants.all { variant ->
JavaCompile javaCompile = variant.javaCompile
javaCompile.doLast {
new akha.yakhont.weaver.Weaver().run(weaverDebug, android.defaultConfig.applicationId,
javaCompile.destinationDir.toString(), javaCompile.classpath.asPath,
android.bootClasspath.join(File.pathSeparator), weaverConfigFiles, weaverAddConfig)
}
}
Here the Yakhont Weaver manipulates the Java bytecode just compiled, which makes possible to alternate classes implementation (e.g. add callbacks to Activities and Fragments) without changing their source code.
Note: the Google "Jack and Jill" technology is not supporting bytecode manipulation (at least, for the moment).
By default the Yakhont weaver uses configuration file from it's JAR, but you can specify your own configuration(s) as a parameter (see above). The "weaverAddConfig = true" means adding your configuration (if not null) to the default one; "weaverAddConfig = false" forces the Yakhont weaver to replace default configuration with yours (even if null).
ProGuard directives are included in the Yakhont libraries. The Android Plugin for Gradle automatically appends these directives to your ProGuard configuration.
Anyway, it's strongly advised also to keep your model and Retrofit API as follows (it's just an example from the Yakhont Demo, so please update it according to your application's packages names):
-keep class akha.yakhont.demo.model.** { *; }
-keep interface akha.yakhont.demo.retrofit.** { *; }
To check out and build the Yakhont source, issue the following commands:
$ git clone git@github.com:akhasoft/Yakhont.git
$ cd Yakhont
$ ./gradlew build
To do a clean build, run the commands below:
$ ./gradlew --configure-on-demand yakhont-weaver:clean yakhont-weaver:build
$ ./gradlew --configure-on-demand yakhont:clean yakhont:build
$ ./gradlew --configure-on-demand yakhont-demo:clean yakhont-demo:build
$ ./gradlew --configure-on-demand yakhont-demo-simple:clean yakhont-demo-simple:build
Note: you may need to update your Android SDK before building.
To avoid some lint issues (in Android Studio, when running Analyze -> Inspect Code):
Not yet.
For bugs, questions and discussions please use the Github Issues.
Copyright (C) 2015-2017 akha, a.k.a. Alexander Kharitonov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
FAQs
The high-level Android components for data loading, location, lifecycle callbacks and many more
We found that com.github.akhasoft:yakhont-support demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.