Firebase登录有时会在其他时间无效

时间:2018-01-15 17:43:16

标签: android firebase firebase-authentication

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
typedef unsigned short int Boolean;
#define FALSE 0
#define TRUE 1
#include "header.h"
struct list{
int value;
int pos;
struct list * next_ptr;
};

Boolean function (struct list **L, int** V, int *length){
int i, j, size;
int * F;
struct list * positionPtr=*L;
struct list ** ptrptr=L;
struct list *tmp;
while (positionPtr!=NULL && positionPtr->next_ptr!=NULL)
    positionPtr=positionPtr->next_ptr;
if (positionPtr!=NULL) size=positionPtr->pos;
else return FALSE;
*V=(int*)malloc(sizeof(int)*(size));
F=(int*)malloc(sizeof(int)*(size));
if (*V==NULL || F==NULL) return FALSE;
F[0]=1;
F[1]=2;
for (i=2;i<size && F[i-1]<size;i++)
    F[i]=F[i-1]+F[i-2];
i=0;
j=size-1;
while (*ptrptr!=NULL){
    if ((*ptrptr)->pos==F[i]) {
        (*V)[j] = (*ptrptr)->value;
        tmp = *ptrptr;
        *ptrptr = (*ptrptr)->next_ptr;
        free(tmp);
        i++;
        j--;
    }
    else
        ptrptr=&((*ptrptr)->next_ptr);
}
for (i=j+1;i<size;i++)
    (*V)[i-j-1]=(*V)[i];
*length=size-j-1;
return TRUE;
}

上面的代码通常可以在我通过USB连接我的设备并运行它或使用模拟器时工作但是当我在生成签名的APK后尝试执行相同的操作时我得到了错误的错误。

1 个答案:

答案 0 :(得分:1)

您必须将应用的所有可能SHA-1哈希添加到Firebase控制台中。听起来你为调试签名密钥添加了哈希,但没有为发布密钥添加哈希。重复您为调试密钥所做的操作,但这次是您的发布密钥。

https://developers.google.com/android/guides/client-auth

https://firebase.google.com/docs/auth/android/google-signin

相关问题