Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Update Matched V 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RooyeKhat committed Oct 15, 2017
1 parent 1d92ad4 commit 0a4a37a
Show file tree
Hide file tree
Showing 171 changed files with 6,358 additions and 4,978 deletions.
9 changes: 6 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
applicationId "net.iGap"
minSdkVersion 15
targetSdkVersion 25
versionCode 39
versionName "0.3.0"
versionCode 40
versionName "0.3.1"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true

Expand Down Expand Up @@ -111,7 +111,10 @@ dependencies {
compile 'cat.ereza:customactivityoncrash:2.1.0'
compile 'com.vanniktech:emoji-one:0.5.1'
compile 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4'
//compile 'io.realm:android-adapters:2.1.0'
compile 'io.realm:android-adapters:2.1.0'
compile 'org.osmdroid:osmdroid-android:5.6.5'
compile 'io.fotoapparat.fotoapparat:library:1.3.0'
// compile 'me.yokeyword:swipebackfragment:0.3.0'
compile "com.daimajia.swipelayout:library:1.2.0@aar"
compile 'com.github.pchmn:MaterialChipsInput:1.0.8'
}
16 changes: 12 additions & 4 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
###

#Warning:cat.ereza.customactivityoncrash.config.CaocConfig$Builder: can't find referenced class cat.ereza.customactivityoncrash.config.CaocConfig$BackgroundMode
###

#

###Chips
-dontwarn com.beloo.widget.chipslayoutmanager.Orientation
#

###CustomCrash
-keep class cat.ereza.customactivityoncrash.** { *; }
Expand Down Expand Up @@ -76,6 +83,8 @@
-dontwarn org.whispersystems.**
-keep class org.webrtc.** { *; }
-dontwarn org.webrtc.**
-keep class org.chromium.** { *; }
-dontwarn org.chromium.**
###

###protobuf
Expand Down Expand Up @@ -160,7 +169,9 @@
-verbose
#-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep class net.iGap.module.** { *; }
-keepclassmembers class android.support.v4.widget.ViewDragHelper {
private <fields>;
}

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
Expand All @@ -169,9 +180,6 @@
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.hardware.fingerprint.FingerprintManager
-keep public class * extends android.hardware.fingerprint.FingerprintManager.AuthenticationCallback
-keep public class net.iGap.module.FingerprintHandler
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@

<meta-data
android:name="io.fabric.ApiKey"
android:value="your fabric key" />
android:value="Your-Fabric_Key" />

<!--
The API key for Google Maps-based APIs is defined as a string resource.
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/assets/fonts/FontLicense .txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
IRAN Sans-serif fonts are considered a proprietary software.
To gain information about the laws regarding the use of these fonts, please visit www.fontiran.com

This set of fonts are used in this project under the license: (CKXUL)

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
فونت های ايران سن‌سریف يک نرم افزار مالکيتی محسوب می شود جهت آگاهی از قوانين استفاده از اين فونت‌ها لطفاً به وبسايت
www.fontiran.com
مراجعه نماييد
اين مجموعه فونت تحت اجازه نامه
(CKXUL)
در اين پروژه استفاده می شود

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
5 changes: 4 additions & 1 deletion app/src/main/java/net/iGap/G.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
import net.iGap.interfaces.OnUserUsernameToId;
import net.iGap.interfaces.OnUserVerification;
import net.iGap.interfaces.OnVerifyNewDevice;
import net.iGap.interfaces.OneFragmentIsOpen;
import net.iGap.interfaces.OpenFragment;
import net.iGap.interfaces.TwoStepSecurityConfirmEmail;
import net.iGap.interfaces.UpdateListAfterKick;
Expand Down Expand Up @@ -228,10 +229,12 @@ public class G extends MultiDexApplication {
public static ArrayList<String> unLogin = new ArrayList<>();// list of actionId that can be doing without secure
public static ArrayList<String> waitingActionIds = new ArrayList<>();
public static ArrayList<String> generalImmovableClasses = new ArrayList<>();
public static ArrayList<Integer> forcePriorityActionId = new ArrayList<>();

public static HashMap<Integer, String> lookupMap = new HashMap<>();
public static HashMap<String, ArrayList<Object>> requestQueueRelationMap = new HashMap<>();
public static HashMap<Long, HelperLogMessage.StructLog> logMessageUpdatList = new HashMap<>();
public static HashMap<Integer, Integer> priorityActionId = new HashMap<>();

public static Activity currentActivity;
public static FragmentActivity fragmentActivity;
Expand Down Expand Up @@ -482,7 +485,7 @@ public class G extends MultiDexApplication {
public static Typeface typeface_neuropolitical;
public static boolean isPassCode;
public static FingerPrint fingerPrint;

public static OneFragmentIsOpen oneFragmentIsOpen;
public static boolean isFragmentMapActive = false; // for check network
public static boolean isRestartActivity = false; // for check passCode
public static boolean isFirstPassCode = true; // for check passCode
Expand Down
51 changes: 19 additions & 32 deletions app/src/main/java/net/iGap/WebSocketClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public void onDisconnected(WebSocket websocket, com.neovisionaries.ws.client.Web
allowForReconnecting = true;
G.socketConnection = false;
RequestQueue.timeOutImmediately(null, true);
RequestQueue.clearPriorityQueue();
resetMainInfo();
reconnect(true);
super.onDisconnected(websocket, serverCloseFrame, clientCloseFrame, closedByServer);
Expand Down Expand Up @@ -202,23 +203,22 @@ public static void reconnect(boolean force) {
G.handler.postDelayed(new Runnable() {
@Override
public void run() {

if (timeDifference(latestConnectionTryTiming) && connectionState != WebSocketState.CONNECTING && (connectionState != WebSocketState.OPEN || (HelperTimeOut.timeoutChecking(0, latestConnectionOpenTime, Config.CONNECTION_OPEN_TIME_OUT)))) {
if (retryConnectionAllowing(latestConnectionTryTiming) && connectionState != WebSocketState.CONNECTING && (connectionState != WebSocketState.OPEN || (HelperTimeOut.timeoutChecking(0, latestConnectionOpenTime, Config.CONNECTION_OPEN_TIME_OUT)))) {
if (reconnectQueueLimitation > 0) {
reconnectQueueLimitation--;
}

if (allowForReconnecting) {
allowForReconnecting = false;
HelperConnectionState.connectionState(ConnectionState.CONNECTING);
if (G.allowForConnect) {
latestConnectionTryTiming = System.currentTimeMillis();
waitingForReconnecting = false;
resetWebsocketInfo();
WebSocketClient.getInstance();
checkSocketConnection();
}
//if (allowForReconnecting) { // i checked this step, due to the other changes this clause not need
// allowForReconnecting = false;
HelperConnectionState.connectionState(ConnectionState.CONNECTING);
if (G.allowForConnect) {
latestConnectionTryTiming = System.currentTimeMillis();
waitingForReconnecting = false;
resetWebsocketInfo();
WebSocketClient.getInstance();
checkSocketConnection();
}
//}
} else {
if (reconnectQueueLimitation < Config.TRY_CONNECTION_COUNT) {
reconnectQueueLimitation++;
Expand All @@ -244,7 +244,7 @@ private static void checkSocketConnection() {
G.handler.postDelayed(new Runnable() {
@Override
public void run() {
if (timeDifference(latestConnectionTryTiming)) {
if (retryConnectionAllowing(latestConnectionTryTiming)) {
allowForReconnecting = true;
waitingForReconnecting = false;
reconnect(false);
Expand All @@ -267,38 +267,27 @@ public void run() {
* compute time difference between latest try for connecting to socket and current time
*
* @param beforeTime when try for connect to socket (currentTimeMillis)
* @return return true if difference is bigger than 10 second
* @return return true if difference is bigger than ALLOW_RECONNECT_AGAIN_NORMAL second
*/

private static boolean timeDifference(long beforeTime) {
private static boolean retryConnectionAllowing(long beforeTime) {
long difference;
long currentTime = System.currentTimeMillis();
difference = (currentTime - beforeTime);

return difference >= ALLOW_RECONNECT_AGAIN_NORMAL;
}

public static boolean checkConnection() {
if (webSocketClient != null && webSocketClient.isOpen()) {
return true;
}
/**
* set allowForReconnecting = true; for allow that to reconnecting
*/
waitingForReconnecting = false;
allowForReconnecting = true;
reconnect(false);
return false;
}

/**
* role back main data for preparation reconnecting to socket
*/

private static void resetWebsocketInfo() {
count = 0;
G.canRunReceiver = true;
G.symmetricKey = null;

if (webSocketClient != null && webSocketClient.isOpen()) {
webSocketClient.disconnect();
}
webSocketClient = null;
/**
* when secure is false set useMask true otherwise set false
Expand All @@ -311,15 +300,13 @@ private static void resetWebsocketInfo() {
/**
* reset some info after connection is lost
*/

private static void resetMainInfo() {
HelperSetAction.clearAllActions();
}

/**
* if not secure yet send fake message to server for securing preparation
*/

private static void checkFirstResponse() {

Thread thread = new Thread(new Runnable() {
Expand Down
9 changes: 4 additions & 5 deletions app/src/main/java/net/iGap/activities/ActivityCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import net.iGap.proto.ProtoFileDownload;
import net.iGap.realm.RealmAttachment;
import net.iGap.realm.RealmRegisteredInfo;
import net.iGap.realm.RealmRegisteredInfoFields;
import net.iGap.request.RequestSignalingGetLog;
import net.iGap.request.RequestSignalingLeave;
import net.iGap.request.RequestUserInfo;
Expand Down Expand Up @@ -535,7 +534,7 @@ public void onClick(View v) {
@Override
public void onClick(View v) {

if (btnSpeaker.getText().toString().equals(G.context.getResources().getString(R.string.md_Mute))) {
if (btnSpeaker.getText().toString().equals(G.fragmentActivity.getResources().getString(R.string.md_Mute))) {
btnSpeaker.setText(R.string.md_unMuted);
setSpeakerphoneOn(true);
} else {
Expand All @@ -550,7 +549,7 @@ public void onClick(View v) {
@Override
public void onClick(View v) {

if (btnMic.getText().toString().equals(G.context.getResources().getString(R.string.md_mic))) {
if (btnMic.getText().toString().equals(G.fragmentActivity.getResources().getString(R.string.md_mic))) {
btnMic.setText(R.string.md_mic_off);
WebRTC.muteSound();
} else {
Expand Down Expand Up @@ -744,7 +743,7 @@ private void setAnimation() {

private void setPicture() {
Realm realm = Realm.getDefaultInstance();
RealmRegisteredInfo registeredInfo = realm.where(RealmRegisteredInfo.class).equalTo(RealmRegisteredInfoFields.ID, userId).findFirst();
RealmRegisteredInfo registeredInfo = RealmRegisteredInfo.getRegistrationInfo(realm, userId);

if (registeredInfo != null) {
loadOrDownloadPicture(registeredInfo);
Expand All @@ -754,7 +753,7 @@ private void setPicture() {
@Override
public void run() {
Realm realm = Realm.getDefaultInstance();
RealmRegisteredInfo registeredInfo = realm.where(RealmRegisteredInfo.class).equalTo(RealmRegisteredInfoFields.ID, userId).findFirst();
RealmRegisteredInfo registeredInfo = RealmRegisteredInfo.getRegistrationInfo(realm, userId);

if (registeredInfo != null) {
loadOrDownloadPicture(registeredInfo);
Expand Down
20 changes: 8 additions & 12 deletions app/src/main/java/net/iGap/activities/ActivityEnhanced.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

public class ActivityEnhanced extends AppCompatActivity {

public boolean isOnGetPermistion = false;
public boolean isOnGetPermission = false;

@Override
protected void attachBaseContext(Context newBase) {
Expand All @@ -73,10 +73,9 @@ public void onCreate(Bundle savedInstanceState) {

SharedPreferences sharedPreferences = getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);

boolean allwScrren = sharedPreferences.getBoolean(SHP_SETTING.KEY_SCREEN_SHOT_LOCK, true);

if (G.isPassCode && !allwScrren) {
boolean allowScreen = sharedPreferences.getBoolean(SHP_SETTING.KEY_SCREEN_SHOT_LOCK, true);

if (G.isPassCode && !allowScreen) {
try {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
} catch (Exception e) {
Expand All @@ -90,8 +89,6 @@ public void onCreate(Bundle savedInstanceState) {
}
}



super.onCreate(savedInstanceState);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Expand All @@ -100,13 +97,11 @@ public void onCreate(Bundle savedInstanceState) {

makeDirectoriesIfNotExist();

//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

boolean checkedEnableDataShams = sharedPreferences.getBoolean(SHP_SETTING.KEY_AUTO_ROTATE, true);
if (!checkedEnableDataShams) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
} else {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER);
}

AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
Expand Down Expand Up @@ -194,15 +189,15 @@ private void checkFont() {

private void makeDirectoriesIfNotExist() {

if (isOnGetPermistion) {
if (isOnGetPermission) {
return;
}

if (this instanceof ActivityRegisteration) {
return;
}

isOnGetPermistion = true;
isOnGetPermission = true;

try {
HelperPermision.getStoragePermision(this, new OnGetPermission() {
Expand All @@ -223,7 +218,7 @@ public void deny() {

private void checkIsDirectoryExist() {

isOnGetPermistion = false;
isOnGetPermission = false;

if (new File(G.DIR_APP).exists() && new File(G.DIR_IMAGES).exists() && new File(G.DIR_VIDEOS).exists() && new File(G.DIR_AUDIOS).exists() && new File(G.DIR_DOCUMENT).exists() && new File(G.DIR_CHAT_BACKGROUND).exists() && new File(G.DIR_IMAGE_USER).exists() && new File(G.DIR_TEMP).exists()) {
return;
Expand Down Expand Up @@ -267,6 +262,7 @@ public void onConfigurationChanged(Configuration newConfig) {

public void checkLanguage() {
try {
G.context = getApplicationContext();
String selectedLanguage = G.selectedLanguage;
if (selectedLanguage == null) return;
Locale locale = new Locale(selectedLanguage);
Expand Down
Loading

0 comments on commit 0a4a37a

Please sign in to comment.