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

没有文件生成 #35

Open
jackyzhougithub opened this issue Jun 21, 2022 · 4 comments
Open

没有文件生成 #35

jackyzhougithub opened this issue Jun 21, 2022 · 4 comments

Comments

@jackyzhougithub
Copy link

有成功onResultCallBack的回调 但是该文件地址找不到文件

@allenymt
Copy link
Owner

说下复现场景吧,我这边复现不了的

@zhjun2016
Copy link

我也遇到了。我这边手机是华为mate40, 鸿蒙系统2.0.. 用的默认配置,设置builder写入时间3分钟。java项目,target sdk26,compileSdk 29. 卸载apk后,第一次安装后,进入主页弹隐私协议弹窗,不同意,不初始化sdk,不申请权限。有成功onResultCallBack的回调 但是该文件地址找不到文件。5分钟后检查文件管理器,没有找到文件。

@allenymt
Copy link
Owner

@zhjun2016 初始化代码贴出来看看

@zhjun2016
Copy link

Owner
@allenymt
/**
* 分包处理
*/
@OverRide
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
//Nuwa.init(this);
try {
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + ("/app/qkclound/patch/" + AppConfig.APP_VERSION.substring(0, 5).replaceAll("\.", "")));
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files.length > 0) {
PrintLog.printError(TAG, "存在patch包,路径为:" + files[0].getAbsolutePath());
if (!AppConfig.ZHUZHAN_APP_ID.equals(AppConfig.APP_ID)) {
// Nuwa.loadPatch(this, files[0].getAbsolutePath());
}

            }
        }
    } catch (Exception e) {
        PrintLog.printError(TAG, "异常:" + e);
    }
    //5.0一下的需要dex优化一下
    if (!quickStart() && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        if (needWait(base)) {
            waitForDexopt(base);
        }
        MultiDex.install(this);
    }
    //TODO 隐私检测
    //完成功能的初始化
    PrivacySentryBuilder builder = new PrivacySentryBuilder()
            // 自定义文件结果的输出名
            .configResultFileName("buyer_privacy")
            // 配置游客模式,true打开游客模式,false关闭游客模式
            .configVisitorModel(false)
            // 配置写入文件日志 , 线上包这个开关不要打开!!!!,true打开文件输入,false关闭文件输入
            .enableFileResult(true)
            .syncDebug(true)
            // 持续写入文件30分钟
            .configWatchTime(3* 1000)
            // 文件输出后的回调
            .configResultCallBack(new PrivacyResultCallBack() {

                @Override
                public void onResultCallBack(@NonNull String s) {
                    System.out.println("隐私协议检出回调:"+s);

                }
            });
    PrivacySentry.Privacy.INSTANCE.init(this,builder);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants