1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2021 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Magic Cube. //
|
5
|
// //
|
6
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9
|
|
10
|
package org.distorted.purchase;
|
11
|
|
12
|
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
13
|
|
14
|
import org.distorted.objectlib.BuildConfig;
|
15
|
import org.distorted.objectlib.helpers.ObjectLibInterface;
|
16
|
|
17
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
18
|
|
19
|
public class PurchaseObjectLibInterface implements ObjectLibInterface
|
20
|
{
|
21
|
public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
|
22
|
public void onScrambleEffectFinished() { }
|
23
|
public void onBeginRotation() { }
|
24
|
public void onSolved() { }
|
25
|
public void onObjectCreated(long time) { }
|
26
|
public void onReplaceModeDown(int cubit, int face) { }
|
27
|
public void onReplaceModeUp() { }
|
28
|
public void onFinishRotation(int axis, int row, int angle) { }
|
29
|
public void failedToDrag() { }
|
30
|
public void reportJSONError(String error, int ordinal) { }
|
31
|
public void reportBlockProblem(int type, int place, long pause, long resume, long time) { }
|
32
|
|
33
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
34
|
|
35
|
public void reportProblem(String problem, boolean reportException)
|
36
|
{
|
37
|
if( BuildConfig.DEBUG )
|
38
|
{
|
39
|
android.util.Log.e("interface", problem);
|
40
|
}
|
41
|
else
|
42
|
{
|
43
|
if( reportException )
|
44
|
{
|
45
|
Exception ex = new Exception(problem);
|
46
|
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
|
47
|
crashlytics.setCustomKey("problem" , problem);
|
48
|
crashlytics.recordException(ex);
|
49
|
}
|
50
|
else
|
51
|
{
|
52
|
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
|
53
|
crashlytics.log(problem);
|
54
|
}
|
55
|
}
|
56
|
}
|
57
|
}
|