Fixed security token

master
Keith 2016-07-14 13:32:46 -04:00
parent 78352d3c2d
commit 5b6be4b3bc
3 changed files with 13 additions and 8 deletions

View File

@ -119,7 +119,7 @@ public class LocationService extends Service implements GoogleApiClient.Connecti
Log.d(TAG, "LowPowerReceiver activated");
mUserID = sharedPref.getString("loggedInUserId", null);
mUserSK = sharedPref.getString("loggedInUserId", null);
mUserSK = sharedPref.getString("loggedInUserSk", null);
final String SERVER_ADDRESS = "https://tracman.org/";
// Connect to socket

View File

@ -34,7 +34,7 @@ import okhttp3.Response;
public class LoginActivity extends AppCompatActivity implements
GoogleApiClient.OnConnectionFailedListener,
View.OnClickListener {
private static final String TAG = "SignInActivity";
private static final String TAG = "LoginActivity";
private static final int RC_SIGN_IN = 9001;
private final String SERVER_ADDRESS = "https://tracman.org/";
private static final String GOOGLE_WEB_CLIENT_ID = "483494341936-hrn0ms1tebgdtfs5f4i6ebmkt3qmo16o.apps.googleusercontent.com";
@ -45,6 +45,7 @@ public class LoginActivity extends AppCompatActivity implements
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.v(TAG, "Created...");
// Set up layout
setContentView(R.layout.activity_login);
@ -75,13 +76,15 @@ public class LoginActivity extends AppCompatActivity implements
@Override
public void onStart() {
super.onStart();
Log.v(TAG, "Started. Checking for intent method");
if (getIntent().hasExtra("method")) {
Log.v(TAG, "Intent has method extra");
if (getIntent().getStringExtra("method").equals("signOut")) {
Log.d(TAG, "Got intent to sign out");
}
} else { // Try to sign in
Log.v(TAG, "Trying to sign in...");
OptionalPendingResult<GoogleSignInResult> opr = Auth.GoogleSignInApi.silentSignIn(mGoogleApiClient);
if (opr.isDone()) {
// If the user's cached credentials are valid, the OptionalPendingResult will be "done"

View File

@ -24,23 +24,25 @@ public class MainActivity extends AppCompatActivity implements
AboutFragment.OnBackButtonPressedListener {
private static final String TAG = "MainActivity";
private CharSequence mTitle;
// private CharSequence mTitle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (BuildConfig.DEBUG){ Log.d(TAG,"Started in debug mode"); }
if (BuildConfig.DEBUG){ Log.d(TAG, "Created in debug mode"); }
NavigationDrawerFragment mNavigationDrawerFragment = (NavigationDrawerFragment)
getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
mTitle = getTitle();
// mTitle = getTitle();
// Set up the drawer.
Log.d(TAG, "Setting up drawer");
mNavigationDrawerFragment.setUp(
R.id.navigation_drawer,
(DrawerLayout) findViewById(R.id.drawer_layout));
// Check if gps enabled and start location service
Log.d(TAG, "Checking if gps enabled");
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
if (sharedPref.getBoolean("gps_switch", false)) {
Log.d(TAG, "Starting LocationService");
@ -107,7 +109,7 @@ public class MainActivity extends AppCompatActivity implements
public void onSectionAttached(int number) {
switch (number) {
case 0:
mTitle = getString(R.string.main_name);
// mTitle = getString(R.string.main_name);
// Toast.makeText(this, "main", Toast.LENGTH_SHORT).show();
break;
case 1:
@ -117,7 +119,7 @@ public class MainActivity extends AppCompatActivity implements
// .setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP));
break;
case 2:
mTitle = getString(R.string.about_name);
// mTitle = getString(R.string.about_name);
break;
// case 3:
// break;