Skip to content
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

issue116, issue127-130, and issue 133 - Add Android P support, sample app, add RoboElectric; Update documentation; Bug and crash fixes #126

Merged
merged 33 commits into from
May 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6960af3
issue116 WIP
isuPatches Apr 21, 2019
1a73603
issue116 - WIP (Refactor WiseFyConnection class for AndroidP)
isuPatches Apr 25, 2019
d4f5b97
issue116 - More abstraction and Android P work
isuPatches Apr 25, 2019
edb424a
Finish fixing deprecations
isuPatches Apr 26, 2019
c721bcc
Working on updated sample app
isuPatches Apr 27, 2019
a901993
lots of progress on sample app
isuPatches Apr 28, 2019
64e4f03
More sample app and other progress
isuPatches May 1, 2019
6e85b84
issue116 Adding more search UI
isuPatches May 2, 2019
679b5b8
issue116 More search progress with sample app
isuPatches May 3, 2019
a7b6ac8
issue116 - More search sample app updates
isuPatches May 6, 2019
5e29b26
Only add network left now
isuPatches May 7, 2019
ab161a7
More progress on sample and stuff, need to update tests
isuPatches May 8, 2019
dd50fc2
issue116 Ressurect existing tests
isuPatches May 9, 2019
870da5c
issue116 New tests
isuPatches May 10, 2019
f5bc9b4
Another test
isuPatches May 10, 2019
7edc866
test
isuPatches May 10, 2019
c3d952b
dsfdsf
isuPatches May 10, 2019
917e2c5
fsdfsd
isuPatches May 10, 2019
1dd1a64
test
isuPatches May 10, 2019
47682f4
kjk
isuPatches May 10, 2019
a9dd38f
test
isuPatches May 10, 2019
84696c1
testing
isuPatches May 11, 2019
a205b49
fsdfsd
isuPatches May 11, 2019
09744e7
More code coverage
isuPatches May 12, 2019
7440589
More code coverage
isuPatches May 12, 2019
850f1a9
issue116 Update documentation
isuPatches May 12, 2019
ef7d71a
More doc updates
isuPatches May 12, 2019
4d915ef
sfsdfds
isuPatches May 12, 2019
8ef8d50
fdsfdsf
isuPatches May 12, 2019
647f8cd
fsdfds
isuPatches May 12, 2019
9e8d296
fdsfds
isuPatches May 12, 2019
6be5142
test updates
isuPatches May 12, 2019
f23d3c2
Udpate bug template
isuPatches May 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ about: Create a report to help us improve

Thank you for creating an issue to improve this library! Please check Please check [the current issues](https://github.com/isuPatches/WiseFy/issues) to make sure that the improvement isn't already being worked on.

It will be _EXTREMELY_ helpful if you also take a look at the [sample app](/wisefysample) to see how it behalves and if you can reproduce there.

**Description**
A clear and concise description of the bug.

Expand All @@ -27,10 +29,13 @@ A description of what you expected to happen.
**Actual behavior**
A description of what actually happened

**Android Information**
**Additional Information**
- Device (i.e. Nexus 5x):
- OS Version (i.e. Android 8.1):
- Rooted:
- Rooted:
- Using legacy connection logic?:
- Using legacy search logic?:
- Reproducible with sample app?:

**Logs**
Please include logs from WiseFy if at all possible. They can be found with `logging(true)` set on the WiseFy instance and by filtering on 'WiseFy'
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
*.iml
.gradle
/local.properties
/.idea
/build
.DS_Store
.DS_Store

/.idea/*.xml
/.idea/caches/*
/.idea/libraries/*
12 changes: 12 additions & 0 deletions .idea/dictionaries/patches.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 2 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,19 @@ env:
global:
- TARGET_SDK=28
- BUILD_TOOLS_VERSION=28.0.3
matrix:
- EMULATOR_SDK=android-19 ABI=armeabi-v7a
- EMULATOR_SDK=android-22 ABI=armeabi-v7a

android:
components:
- tools
- platform-tools
- tools
- android-${TARGET_SDK}
- android-19
- android-22
- build-tools-${BUILD_TOOLS_VERSION}
- extra-google-m2repository
- extra-android-m2repository

before_script:
- android-update-sdk --components=sys-img-$ABI-$EMULATOR_SDK --accept-licenses='android-sdk-license-[0-9a-f]{8}'
- echo no | android create avd --force -n test -t $EMULATOR_SDK --abi $ABI
- emulator -avd test -no-audio -no-window &
- ./gradlew clean assembleDebug assembleDebugAndroidTest
- android-wait-for-emulator
- adb shell input keyevent 82 &

script:
- ./gradlew clean assembleDebug assembleDebugAndroidTest
- travis_wait 60 ./gradlew makeGoodChoices

after_success:
Expand Down
4 changes: 3 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ WiseFy upon each new major release will start a brand new change log.

[2.x Changes](/changes/2.x.md)

[3.x Changes](/changes/3.x.md)
[3.x Changes](/changes/3.x.md)

[3.x Changes](/changes/4.x.md)
78 changes: 38 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,44 @@
Wifi configuration and util library built for Android.

> <br/>*Developed by Patches 04/24/2016 - present* <br/>
> <br/> Logo/icon created by mansya (2018)<br/>
> <br/>Supports Android SDK levels 16-27<br/><br/>
> <br/>Logo/icon created by mansya (2018)<br/>
> <br/>Supports Android SDK levels 16-28<br/><br/>

[![Build Status](https://travis-ci.org/isuPatches/WiseFy.svg?branch=master)](https://travis-ci.org/isuPatches/WiseFy) [ ![Download](https://api.bintray.com/packages/isupatches/Maven/wisefy/images/download.svg) ](https://bintray.com/isupatches/Maven/wisefy/_latestVersion) [![codecov](https://codecov.io/gh/isuPatches/WiseFy/branch/3.x/graph/badge.svg)](https://codecov.io/gh/isuPatches/WiseFy)

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-WiseFy-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6011) [![Android Weekly](https://img.shields.io/badge/Android%20Weekly-%23230-blue.svg)](http://androidweekly.net/issues/issue-230)

## What's New in 3.x

- Rewritten in Kotlin
- Static analysis tools added
- Ability to get the IP of a device
- Additional details in callbacks for adding a network:
- The new id of the network
- The WifiConfiguration of the network that was added
- isNetworkInConfigurationList renamed isNetworkSaved
- brains renamed Brains
- Nullability issues will be more visible
- Definitions for NetworkTypes and WiseFyCodes
- Immutability throughout the library
- Improved architecture
- Updated dependencies
- Updated to Gradle 4.x and AGP 3.x
- Target now is set to API 27
- Less duplicate code
- Improved testing
- Updated documentation with new Kotlin examples
- Other improvements and adjustments!

## What's New in 2.0.x

- Asynchronous API
- Certain methods have callbacks and are run on a WiseFy specific background thread
- Ability to search by regex for:
- Nearby access points
- Saved Configurations
- SSIDs
- Ability to query for RSSI
- Ability to query for if the device is roaming
- Additional methods to query for network security
- Full fledged documentation directory
- Tested against Android O
## What's New in 4.x

- Android P Support
- New isDeviceRoaming logic
- New logic for SDK 23 and above
- WiseFySearch rewritten to remove deprecated APIs from Android OS
- WiseFyConnection rewritten to remove deprecated APIs from Android OS
- Ability to use legacy search logic
- Ability to use legacy connection logic
- Update to Android X
- Improved annotations for required permissions
- Update to gradle 5.x
- Static analysis tools updated
- WEP is now deprecated due to security and other issues with this network type and will be phased out
- Introduction of [RoboElectric](https://github.com/robolectric/robolectric) for better unit testing
- This may be controversial, but please check this [issue](https://github.com/isuPatches/WiseFy/issues/133) for rationale
- Removal of Checkstyle and FindBugs since project is no longer Java
- Removal of GCM support due to GCM being sunset
- New [sample app](/wisefysample) included as part of the repo
- This replaces the previous permissions example
- Crash fixes for:
- Async api with null current network
- Async api with null current network info
- Async api with null nearby access points
- Fix for searching when empty list returned from OS
- More tests
- Removal of some generic variable names from documentation for clarity

Previous updates:
- [What's New in 3.x](/changes/whatsnew/3.x.md)
- [What's New in 2.x](/changes/whatsnew/2.x.md)

## Adding to your project

Expand Down Expand Up @@ -125,6 +121,8 @@ _With Java_
WiseFy wisefy = new WiseFy.Brains(getActivity()).logging(true).getSmarts();
```

By default, legacy logic is disabled on devices with SDK 23 or higher. If you want to use or test against the legacy search or connection logic, please see: [Using Legacy Classes And Logic](/documentation/using_legacy_classes_and_logic.md).

## Cleanup

Since the Async API of WiseFy is run on a background thread, it is necessary to make sure it is exited and cleanup up properly.
Expand All @@ -134,7 +132,7 @@ To stop the WiseFy thread and nullify it along with it's handler please call:
_With Kotlin_

```kotlin
wisefy.dump();
wisefy.dump()
```

_With Java_
Expand All @@ -160,14 +158,14 @@ For the sake of transparency and because you're probably curious as to what perm

If access points or SSIDs are not being returned on >= 6.x devices but there are visible networks, it's most likely because you haven't asked in your application for the `Manifest.permission.ACCESS_COARSE_LOCATION` permission which is what allows us to see the access points nearby. This permission request will not be added to the WiseFy library to reduce package bloat and so users can determine their own UI/UX.

Please check [the permssions example](/documentation/permissions_example.md) for a sample of how to request permissions for WiseFy.
Please check [the sample app](/wisefysample) for an example of how to request permissions for WiseFy.

## Usage

Please check [the documentation markdown directory](/documentation) for usage examples and details about both the synchronous and asynchronous API.

## License ##
Copyright 2018 Patches Klinefelter
Copyright 2019 Patches Klinefelter

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
Expand Down
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ buildscript {
project.ext {
agp_version = '3.4.0'
bintray_version = '1.8.4'
cpd_version = '1.3'
cpd_version = '2.0-SNAPSHOT'
dokka_version = '0.9.18'
dexcount_version = '0.8.5'
jacoco_version = '0.8.3'
kotlin_version = "1.3.30"
kotlin_version = "1.3.31"
maven_version = '2.1'
}

repositories {
jcenter()
google()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

dependencies {
Expand Down Expand Up @@ -140,7 +141,7 @@ task makeGoodChoices {

outputs.upToDateWhen { false }

dependsOn 'staticAnalysisSanityCheck', 'jacocoAllCombinedTests'
dependsOn 'staticAnalysisSanityCheck', ':wisefy:jacocoDebugUnitTest'
doLast {
println "\n#############################################" +
"\n# All checks passed! You are doing so good! #" +
Expand Down
1 change: 1 addition & 0 deletions changes/4.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## v4.0.0 - 05/x/2019
13 changes: 13 additions & 0 deletions changes/whatsnew/2.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## What's New in 2.0.x

- Asynchronous API
- Certain methods have callbacks and are run on a WiseFy specific background thread
- Ability to search by regex for:
- Nearby access points
- Saved Configurations
- SSIDs
- Ability to query for RSSI
- Ability to query for if the device is roaming
- Additional methods to query for network security
- Full fledged documentation directory
- Tested against Android O
21 changes: 21 additions & 0 deletions changes/whatsnew/3.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## What's New in 3.x

- Rewritten in Kotlin
- Static analysis tools added
- Ability to get the IP of a device
- Additional details in callbacks for adding a network:
- The new id of the network
- The WifiConfiguration of the network that was added
- isNetworkInConfigurationList renamed isNetworkSaved
- brains renamed Brains
- Nullability issues will be more visible
- Definitions for NetworkTypes and WiseFyCodes
- Immutability throughout the library
- Improved architecture
- Updated dependencies
- Updated to Gradle 4.x and AGP 3.x
- Target now is set to API 27
- Less duplicate code
- Improved testing
- Updated documentation with new Kotlin examples
- Other improvements and adjustments!
4 changes: 2 additions & 2 deletions config/detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ complexity:
ignoreDefaultParameters: false
LongMethod:
active: true
threshold: 20
threshold: 50
LargeClass:
active: true
threshold: 150
Expand All @@ -83,7 +83,7 @@ complexity:
threshold: 5
NestedBlockDepth:
active: true
threshold: 5
threshold: 6
TooManyFunctions:
active: true
thresholdInFiles: 50
Expand Down
Loading