2 * Copyright (C) 2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
9 #include "JNIXBMCURIUtils.h"
11 #include "CompileInfo.h"
12 #include "utils/URIUtils.h"
14 #include <androidjni/Context.h>
15 #include <androidjni/jutils-details.hpp>
19 static std::string s_className
= std::string(CCompileInfo::GetClass()) + "/XBMCURIUtils";
21 void CJNIXBMCURIUtils::RegisterNatives(JNIEnv
*env
)
23 jclass cClass
= env
->FindClass(s_className
.c_str());
26 JNINativeMethod methods
[] =
28 {"_substitutePath", "(Ljava/lang/String;)Ljava/lang/String;", (void*)&CJNIXBMCURIUtils::_substitutePath
},
31 env
->RegisterNatives(cClass
, methods
, sizeof(methods
)/sizeof(methods
[0]));
35 jstring
CJNIXBMCURIUtils::_substitutePath(JNIEnv
*env
, jobject thiz
, jstring path
)
37 std::string strPath
= jcast
<std::string
>(jhstring::fromJNI(path
));
38 std::string responseData
= URIUtils::SubstitutePath(strPath
);
40 jstring jres
= env
->NewStringUTF(responseData
.c_str());